[Here is the error] I've created constructors in another class but it ain't working.
Here is the code...
body: StreamBuilder<QuerySnapshot>(
stream: FirebaseFirestore.instance.collection("products").snapshots(),
builder: (context, snapshot) {
return !snapshot.hasData
? Center(child: CircularProgressIndicator())
: ListView.builder(
itemCount: snapshot.data.docs.length,
itemBuilder: (context, index) {
DocumentSnapshot data = snapshot.data.docs[index];
return ProductItem(
documentSnapshot: data,
id: data.id,
isFavourite: data['isFavourite'],
imageUrl: data['imageUrl'],
productName: data['productName'],
productPrice: data['productPrice'],
);
},
);
},
),
);
}
}