```
  static List categoryList() {
    final categorySnapshots = FirebaseFirestore.instance
        .collection('categories')
        .orderBy('name')
        .snapshots();

    List categories = [];
    categorySnapshots.map((snapshot) => snapshot.docs.map((doc) {
          print(snapshot.toString());
          categories.add(doc.data()['name']);
        }));

    print(categories);
    return categories;
  }

```

Categories is empty.
How to populate it with the data from snapshots?