1

Using Flutter.

When a user taps a button, I want focus to shift to a dropDownButton and open up the options. Here is my attempt (not working):

                RaisedButton(
                  onPressed: () {setState(() {FocusScope.of(context).requestFocus(_node);exactTime = false;});},
                  color: Theme.of(context).primaryColor,
                  child: const Text(
                      'Estimate',
                      style: TextStyle(fontSize: 20)
                  ),
                )





DropdownButton<String>(
                            isExpanded: true,
                            focusNode: _node,
                            items: ageRanges.map((String value) {
                              return DropdownMenuItem<String>(
                                value: value,
                                child: Text(value, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)),
                              );
                            }).toList(),
                            value: pmhOnset,
                            onChanged: (String selected) {
                              setState(() {
                                pmhOnset = selected;
                              });
                            },
                          )

I don't get any errors. It just doesn't do anything. Any suggestions?

Coltuxumab
  • 615
  • 5
  • 16

1 Answers1

1

From what I have read it is not possible with out making your own DropDownButton class but that shouldn't be that hard after all just a matter of coping most of flutters code and changing it to fit your need I'll attach a link that I think you will find helpful.

wcyankees424
  • 2,554
  • 2
  • 12
  • 24