Flutter error: The following NoSuchMethodError was thrown building
It seems that your provider takes a little time to fetch the Store List so the stores
is null for a while. You can display a progress indicator while the stores
is null then display the data afterwards
class _DataListState extends State<DataList> { @override Widget build(BuildContext context) { final stores = Provider.of<List<Store>>(context); // stores.forEach((d) { // print(d.name); // }); return stores == null ? Center(child: CircularProgressIndicator()) : ListView.builder( itemCount: stores.length, itemBuilder: (context, index) { return StoreTile(store: stores[index]); }, ); }}