I am using a gridview.builder to show my fetched data from firestore. But the builder is not showing my products. I checked out the complete code of firebase fetch and everything is working. Still I am unable to show data using builder. Here is the code. Please help
main.dart
if (state is SearchScreenDefaultState) {
return GridView.builder(
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
maxCrossAxisExtent: 2,
childAspectRatio: 1 / 1.3,
),
itemCount: state.snapshot.docs.length,
itemBuilder: (context, index) {
return productCard(
product: ProductModel.fromJson(
state.snapshot.docs[index].data()),
);
},
);
} else {
return Center(
child: CircularProgressIndicator(),
);
}
