icemanbsi / searchable_dropdown

MIT License
107 stars 162 forks source link

After selecting sropdown data, showing left side space #59

Open abhihasabe opened 4 years ago

abhihasabe commented 4 years ago

I used below code, but showing some garbage data/ ![Uploading Screenshot_2020-04-29-23-57-14-011_mahindra.com.btl.jpg…]()

SearchableDropdown.multiple( items: _dropdownMenuItems, disabledHint: "Select State", selectedItems: selectedState, displayClearIcon: false, //hint: Text("Select State "), searchHint: "Select State ", label: Text( "Select State ", style: TextStyle(color: Colors.black54), ), onChanged: (value) { setState(() { selectedState = value; }); if (selectedState.length > 0) getDealers(selectedState); }, closeButton: (selectedItems) { return ("Save"); }, underline: Container( height: 1.0, decoration: BoxDecoration( border: Border( bottom: BorderSide( color: Colors.black38, width: 1.0))), ), isExpanded: true, selectedValueWidgetFn: (item) { return Container( transform: Matrix4.translationValues(-10, 0, 0), alignment: Alignment.centerLeft, child: (Text(item.toString()))); }, )

pkmangukiya commented 4 years ago

To fix this you can do something like this

 selectedValueWidgetFn: (item) {
     return Container(
     transform: Matrix4.translationValues(0,0,0,0),
     alignment: Alignment.centerLeft,
     child: (Text(item.toString())));
 },