Currently, I am working on updating the codebase for a Flutter project which was developed on previous versions. The error occurred once we updated to the latest version of Dart and Flutter.
The code here is related to when we are returning the list from the FutureBuilder.
body: new FutureBuilder<List>(
future: getData(),
builder: (context, snapshot) {
if (snapshot.hasError) print(snapshot.error);
return snapshot.hasData
? new ItemList(
list: snapshot.data, <--- error in here
)
: new Center(
child: new CircularProgressIndicator(),
);
},
),
Flutter Version: 2.2.2
Dart Version: 2.13.3
Please help me to point out which part that I should take care of for this one. Thank you!