Cloud Stack Ninja

I have multiple line items in the dropdown menu in flutter like this :

enter image description here

It is shown perfectly fine in the dropdown pop up but in dropdown button it shows bottomoverflow like this :

enter image description here

Here is code for the same :

DropdownButtonHideUnderline(
                                        child: DropdownButton(
                                          items: addresses.map((String value) {
                                            return new DropdownMenuItem<String>(
                                              value: value,
                                              child: SizedBox(
                                                height: 10 * SizeConfig.heightMultiplier,
                                                child: Column(
                                                  children: [
                                                    SizedBox(height: 1.5 * SizeConfig.heightMultiplier),
                                                    new Text(value, overflow: TextOverflow.clip),
                                                    SizedBox(height: 1.5 * SizeConfig.heightMultiplier),
                                                  ],
                                                ),
                                              ),
                                            );
                                          }).toList(),
                                          onChanged: (String newValue) {
                                            setState(() {
                                              _selectedShippingAddress = newValue;
                                            });
                                          },
                                          hint: Text("Select address"),
                                          selectedItemBuilder: (BuildContext context) {
                                            return addresses.map<Widget>((String item) {
                                              return Container(
                                                child: Text(item),
                                              );
                                            }).toList();
                                          },
                                          style: TextStyle(
                                              fontSize: 1.9 *
                                                  SizeConfig.textMultiplier,
                                              color:
                                              Theme.of(context).accentColor,
                                              fontFamily: 'Montserrat'),
                                          value: _selectedShippingAddress,
                                          isExpanded: true,
                                          underline: Container(
                                            height: 1,
                                            color: Theme.of(context)
                                                .textSelectionColor,
                                          ),
                                          icon: Icon(Icons.arrow_drop_down),
                                          isDense: true,
                                        ),
                                      )

So what is a solution for this? Can anyone help on this?



Read more here: https://stackoverflow.com/questions/64400143/bottom-overflow-while-having-multiple-line-item-in-dropdown-flutter

Content Attribution

This content was originally published by Karan Mehta at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: