DropdownButtonFormField Flutter中的高度

时间:2020-05-06 17:35:33

标签: flutter

            Padding(
                padding: EdgeInsets.only(left: 15),
                child: Container(
                  color: Colors.grey.withOpacity(0.35),
                  height: 74,
                  width: screenWidth * 0.93,
                  child: Padding(
                    padding:
                        const EdgeInsets.only(left: 10.0, right: 10, top: 2),
                    child: DropdownButtonFormField<String>(
                      value: _opcionSeleccionada,
                      decoration: InputDecoration(
                          enabledBorder: UnderlineInputBorder(
                              borderSide: BorderSide(color: Colors.white))),
                      iconEnabledColor: Colors.blue,
                      elevation: 1,
                      items: locations.map((String val) {
                        return new DropdownMenuItem<String>(
                          value: val,
                          child: new Text(
                            val,
                            style: TextStyle(color: Colors.black, fontSize: 16),
                          ),
                        );
                      }).toList(),
                      hint: Text("Opcion"),
                      onChanged: (opt) {
                        _opcionSeleccionada = opt;
                        setState(() {});
                      },
                    ),
                  ),
                )),

enter image description here

我需要使DropdownButtonFormField变小,但每次移动容器的高度时,都会使像素出现问题。有没有办法调整小部件的大小?

0 个答案:

没有答案