title: How to show the months in array in a dropdown using flutter?
body: <p><a href="https://i.stack.imgur.com/ZeKUR.png" rel="nofollow noreferrer">Firestrore Schema</a></p>
  <pre><code>StreamBuilder&lt;QuerySnapshot&gt;(
             
              stream: FirebaseFirestore.instance
                  .collection('users')
                  .doc(uid)
                  .collection('transactions')
                  .doc(monthCode)
                  .collection('details')
                  .orderBy('date')
                  .snapshots(),
              builder: (BuildContext context,
                  AsyncSnapshot&lt;QuerySnapshot&gt; snapshot) {
                if (!snapshot.hasData) return Container();
  
                if (setDefaultMake) {
                  year = snapshot.data!.docs[0].get('date');
  
                  debugPrint('setDefault make: $year');
                }
                return DropdownButton(
                  dropdownColor: Colors.blue[700],
                  isExpanded: false,
                  value: year,
                  items: snapshot.data!.docs.map((value) {
                    return DropdownMenuItem(
                      value: value.get('date'),
                      child: Text(
                        '${value.get('date')}',
                        style: const TextStyle(
                          fontSize: 14,
                          color: Colors.white,
                        ),
                      ),
                    );
                  }).toList(),
                  onChanged: (value) {
                    debugPrint('selected onchange: $value');
                    setState(
                      () {
                        debugPrint('make selected: $value');
                        // Selected value will be stored
                        year = value;
                        // Default dropdown value won't be displayed anymore
                        setDefaultMake = false;
                        // Set makeModel to true to display first car from list
                        setDefaultMakeModel = true;
                      },
                    );
                  },
                );
              },
            ),
  </code></pre>
  <p>users/uid/transactions/20223/details/monthlydetails -&gt; Schema in firestore for where date is stored as field</p>
  <p>How to show the months in array in a dropdown using flutter? Thanks in advance.</p>
  <p>users/uid/transactions/20223/details/monthlydetails -&gt; Schema in firestore for where date is stored as field</p>
  <p>How to show the months in array in a dropdown using flutter? Thanks in advance.</p>