i got a problem in this part
snapshot.data!.docs[0].data()['list']
but in visual studio no error notification appears in the problem section, how to fix it? did i miss something?
StreamBuilder(
stream:
_firestore.collection("utils").snapshots(),
builder: (
BuildContext context,
AsyncSnapshot<
QuerySnapshot<Map<String, dynamic>>>
snapshot,
) {
if (snapshot.hasData) {
final List<dynamic> _productGroups =
snapshot.data!.docs[0].data()['list']
as List<dynamic>;
_productGroups.sort();
return GridView.builder(
gridDelegate:
const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
childAspectRatio: 2,
crossAxisSpacing: 20,
mainAxisSpacing: 20,
),
itemCount: _productGroups.length,
itemBuilder: (context, index) {
return ProductGroupCard(
name: _productGroups[index] as String,
key: UniqueKey(),
);
},
);
} else {
return const Center(
child: SizedBox(
height: 40,
width: 40,
child: CircularProgressIndicator(
color: ColorPalette.pacificBlue,
),
),
);
}
},
),