Flutter Multiple Dynamic Dependent Dropdown List Using JSON REST API

preview_player
Показать описание
Source code:

Buy Me a Coffee:
Рекомендации по теме
Комментарии
Автор

thank you so much man, , you helped me Alot, , was a project i got stacked with it for almost a week and now from your tutorial am okey

korichaspaceexplore
Автор

If you have an error when you select again add this in the 'Select State':
onChanged: (String? newValue) {
setState(() {
_myCity = null;
citiesList = [];
_myState = newValue;
_getCitiesList();
print("myState");
print(_myState);
});
},

rodnalcy
Автор

for the first time it works fine but when i choose state & city for second time it shows error --
There should be exactly one item with [DropdownButton]'s value: 14.
Either zero or 2 or more [DropdownMenuItem]s were detected with the same value

beak
Автор

Thanks this is good. But a little bit of exception handling is not done. For example, If I select some state, city's dropdown will be enabled, I select city. And then change the country, It give error. Failed Assertion: Line 805 pos 15: 'items == null || items.isEmpty()

trends
Автор

Thank you so muchhh....was searching for this for past many days... thanks a lot

nishithanasar
Автор

Hi am having the issue bellow please help me

Unhandled Exception: type 'String' is not a subtype of type 'int' of 'index'

petermakala
Автор

Can you please tell me how to create a similar api for different country's states and cities.
Can you share the link of the api you have used.

yuktat.n
Автор

i am not able to run this code with null safety, i am trying to run this code since 5 days but its not working, it will be very thankful, if u help me.i stuck on this point since 5 days. i getting error for this child: Text(item['STATE_NAME']),
value: item['STATE_CODE'], as The argument type 'String' can't be assigned to the parameter type 'int'.

anjalihali
Автор

hello have u tested this when u assign item[id] to value... it gives this Error There should be exactly one item with [DropdownButton]'s value,

but when i assign value: item[name ] it works perfectly . so my question is what did u mean by giving a value: item[id] ????

codeaxen
Автор

i am not change dropdown after change dropdown first
════════ Exception caught by widgets library
There should be exactly one item with [DropdownButton]'s value: 37.
Either zero or 2 or more [DropdownMenuItem]s were detected with the same value


Failed assertion: line 1543 pos 15: 'items == null || items.isEmpty || value == null ||
item) {
return item.value == value;
}).length == 1'

sandyeffendi
Автор

Sir I have two get method api, I want to show 2 dependent drop down in flutter, Please help me.

rahulsingh-cdok
Автор

Hi. Is an excelent tutorial. Give me an error if i change the value of first list. Maybe I have to clean the second list?

costimid
Автор

thank u man this helpful video just a question is there any way to use hardcoded list instead of json ?

soufeeljazouli
Автор

Hi, i've consumed an api and added the list of countries to the list box. However, i'm just wondering how can i add a default option as well as a tag saying "select country" to my drop down list using json which will prompt the user to click on the drop down list, no HTML?

ladej
Автор

Hello, Can you share the code by adding this code to another drop down list?

hudaansari
Автор

Hello dear friend, thank you for your great tutorial. I adapted your source code to my project but my concern is that when selecting a state that has no city, I have a bug. And it works when the state has cities. If you can help me with the php code. Thank you in advance.

anomanjeanjacquessika
Автор

How you can do this with flutter bloc please 🙏🙏🙏🙏🙏 let me knoe

harshvardhansinghgaharwar
Автор

5:36 how to limit the height of that list, since it is taking entire screen

Its_Pritam_
Автор

very good friend. In which page do I register my api key?

CLY_-mjtg
Автор

Hello guys, please i want to get flutter dynamic dependent dropdown list using cloud firestore. Thank you

mahmudidris