Questions tagged [flutter-dropdownbutton]

94 questions
1
vote
1 answer

Populate DropdownButton with sqflite in Flutter, when selecting value(OnChange) returns error

_AssertionError ('package:flutter/src/material/dropdown.dart': Failed assertion: line 894 pos 15: 'items == null || items.isEmpty || value == null || items.where((DropdownMenuItem item) { return item.value == value; }).length == 1': There…
1
vote
1 answer

Return dropdown other value click button (this dropdown on another page)

I have one filtering dropdown. I have one button on another page. When I click this button on another page, how can I return to other options of the dropdown on the other page? DropdownPage CustomDropdownButton( hintText: "Select…
Codeguru
  • 31
  • 6
1
vote
1 answer

Flutter how to set the value of the dropdown button programmatically

I m new to flutter, need help to set the value of the DropdownButton programmatically. The value is from textfield. Once i click it, it will set the value at the dropdownbutton automatically. Widget _districtListContainer() { return Container( …
LKC
  • 51
  • 4
1
vote
1 answer

flutter DropdownButton2 load remote data on taped and show drop down on completion

hello I need to use flutter DropdownButton2 to show a small loader in the drop down button when tapped and as soon as an async action which loads the data that should appear in the drop down button, then show the drop down list.
Ala'a Al Hallaq
  • 455
  • 5
  • 11
1
vote
1 answer

Flutter : Trying pass a variable to next screen based on DropDownButton input

I am trying to reduce a products(smartphone) price based on user dropdown input & pass the price to next screen. My code has no error & runs perfectly but the problem is, it reduces price based on only one switch statement (the initial one…
1
vote
1 answer

How to make short ListView of DropDownButtons build faster?

I have a short ListView of a maximum of 10 items. Each list item will contain a DropDownButton which will hold around 1K DropDownMenuItems for selections. In native Android, I was able to implement one that performed very smoothly, but with Flutter…
Mena
  • 3,019
  • 1
  • 25
  • 54
1
vote
2 answers

DropdownButton - Set value: with value NOT contained by The list of items the user can select - Flutter

I have this DropdownButton with two items in it's List When i Select Value 2 i'd like it to show a value not contained in the list Like this : Is it even possible ? It would look something like this : DropdownButton( value:…
Aristidios
  • 1,921
  • 2
  • 13
  • 24
1
vote
1 answer

DropdownButton using local data - Do not list items on the screen, only after hot reload

I'm new to the flutter and I don't know how to solve this problem. I have a List with await method, but my screen does not await for the list to load to list, only when I update with the hot-reload, the screen works. My async method ListaRefeitorio?…
1
vote
2 answers

Flutter: Close DropdownButton (DropdownMenu)

Is there a way to close the selection menu of a DropdownButton containing all the DropdownMenuItems when an onTap function is executed (GestureDetector inside a DropdownMenuItem)? Here is my implementation of the approach of Alperen Baskaya (in a…
PlutoHDDev
  • 540
  • 7
  • 25
1
vote
2 answers

Dropdownbutton restrict shown items

Ive got the following Problem: I want the user to choose a day of month with a dropdownbutton. So my items are the numbers 1 to 31. Now the list got pretty long and the Dropdownbutton is really large. Is there a Solution to show e.g. only 5 Elements…
0
votes
1 answer

Failed assertion:'items == null || items.isEmpty ||value == null || items.where((DropdownMenuItem item) {return item.value == value;}).length == 1'

I getting Failed assertion:'items == null || items.isEmpty || value == null || items.where((DropdownMenuItem item) return item.value == value;}).length == 1' this error I am very new to coding and don't understand why this error encountered. I am…
0
votes
1 answer

dropdown_search search text filed is not showing

i ma trying to add searchable drop down box for my flutter application but when i add code from package example it's not showing the text filed for enter the values that i need to search ? FYI showSearchBox is depericiated since it's not letting me…
Thalinda Bandara
  • 1,039
  • 1
  • 11
  • 27
0
votes
1 answer

flutter error: Either zero or 2 or more [DropdownMenuItem]s were detected with the same value

I am using two dropdowns. My dropdowns will be work alternate, We select city from first dropdown after selecting city I will get outlets then I will show outlets. For the first time its working fine but after selected both when i change my city…
0
votes
1 answer

Flutter Dropdown Different Selected Item Style than Items

I am developping an UI for the user to change the app language. When showing the currently selected language I want to only display the flag with a dropdown icon. When the user clicks on the dropdown button I want the full string representation of…
Patrick Michiels
  • 239
  • 4
  • 13
0
votes
1 answer

Flutter DropdownButton - Custom title for selected value?

I using this model for my DropdownButtonFormField: class MyItem { final String fullName; final String shortName; } This my UI code: List> _getItems() { return widget.items .map((e) => DropdownMenuItem( …
FetFrumos
  • 5,388
  • 8
  • 60
  • 98