final activities = ['select'];
@override
void initState() {
FirebaseFirestore.instance.collection('activities').get().then(
(snapshot) => snapshot.docs.forEach((document) {
activities.add(document.reference.id);
}),
);
super.initState();
}
I have a dropdownbutton, and it uses 'activities' as a list, however, when the page loads it only shows 'select' as an option, and only after selecting select, and then clicking the drop down will the updated list show up.