I want to create an empty list for a Flutter project.
final prefs = await SharedPreferences.getInstance(); final myStringList = prefs.getStringList(\'my_stri
There are a few ways to create an empty list in Dart:
[] List() <String>[] List<String>()
However, the Effective Dart Usage Guide recommends this:
[]
Or if you need to specify the type, then this:
<String>[]