Issue
In here i want to make a condition if the dropdown box select the last option it will show new box but i don't know how to make that condition. What i use now is the condition where the option is "Other Impression" selected but the api has 2 language so i cannot hard code the condition. Maybe i think it's like dropdownOption.lastIndexOf
.... i don't know
This is the Json
List dummyDropdownOption = [
{
"value": 1,
"label": "Sistem Kemudi otomatis dapat diandalkan",
},
{
"value": 2,
"label": "Mobilitas tanpa awak mematuhi rambu dan aturan lalu lintas",
},
{
"value": 3,
"label": "Mobilitas tanpa awak memiliki kondisi kebersihan yang baik.",
},
{
"value": 4,
"label": "Other impressions",
},
];
The condition i use for now
(dropdownValue1 == 'Other impressions')
?
Solution
In Dart, you also have a last
property on the List
. Doc
void main() {
print(dummyDropdownOption.last);
}
Console log
{value: 4, label: Other impressions}
Answered By - Thierry
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.