there is error with the map even when i add .toList() to the map
CodePudding user response:
This error indicates that map((note) => Text(note.title)) can potentially be null.
If you are sure that you will always have items in notes, use the "!" to tell the compiler that it won't be null:
final children = notes.map((note) => Text(note.title))!.toList();