Home > Mobile >  how to show list of dropdown from botton in flutter
how to show list of dropdown from botton in flutter

Time:09-30

I want to start the list of dropdown from its bottom, here my dropdown code

Container(
                              height: 55.0,
                              width: MediaQuery.of(context).size.width *
                                  0.43,
                              child: DropdownButtonFormField<String>(
                                decoration: InputDecoration(
                                  errorText: _validatedrop
                                      ? 'This is the required field'
                                      : null,
                                      focusedBorder: OutlineInputBorder(borderSide: BorderSide(color: Color(int.parse(textfieldBorderColor)))),
                                  border: OutlineInputBorder(
                                      borderRadius: BorderRadius.all(
                                          Radius.circular(10.0))),
                                  errorBorder: OutlineInputBorder(
                                      borderSide: BorderSide(
                                          color: Colors.red, width: 5)),
                                ),
                                items: genderlist
                                    .map<DropdownMenuItem<String>>(
                                        (String value) {
                                  return DropdownMenuItem<String>(
                                 
                                      value: value, child: Text(value));
                                }).toList(),
                                hint: Text(
                                  "Male",
                                  style: GoogleFonts.montserrat(
                                      color: Color(
                                          int.parse(hinttextColor))),
                                ),
                                onChanged: (value) async {
                                  setState(() {
                                    this.selectedGender = value!;

                                    if (this.selectedGender == "") {
                                      _validatedrop = true;
                                      
                                    } else {
                                      _validatedrop = false;
                                    }
                                  });
                                },
                              )),

its output look like this

enter image description here

and i want its output like this, it should start from below

enter image description here

Please help if anyone know how to do this.

CodePudding user response:

Try below code hope its helpful to you . you must used dropdown_below from enter image description here

  • Related