I need to use my list from Firestore, but I'am stuck how to convert my Future list which I get from Firestore to list of strings:
Future<List> getListOfProducts() async {
List<String> productsList;
final List<DocumentSnapshot> documents =
(await FirebaseFirestore.instance.collection('products').get()).docs;
productsList = documents
.map((documentSnapshot) => documentSnapshot['productName'] as String)
.toList();
return productsList;
}
What should I do with productList now ?