Created
November 3, 2021 16:16
-
-
Save abdulpiksi/5db6bc3ea70ed2d7d30cfc20d3839107 to your computer and use it in GitHub Desktop.
get length
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
List<Map<String, dynamic>> data = [ | |
{"title": "A"}, | |
{ | |
"title": "B", | |
"options": [ | |
{"name": "Joko Widodo"}, | |
{"name": "Maruf Amin"}, | |
{"name": "Tidak tahu"}, | |
{"name": "Tidak Menjawab"} | |
] | |
}, | |
{ | |
"title": "C", | |
"options": [ | |
{"name": "Joko Widodo"}, | |
{"name": "Maruf Amin"}, | |
{"name": "Tidak tahu"}, | |
{"name": "Tidak Menjawab"} | |
] | |
}, | |
{ | |
"title": "D", | |
"options": [ | |
{"name": "sangat puas"}, | |
{"name": "puas"}, | |
{"name": "kecewa"}, | |
{"name": "sangat kecewa"} | |
] | |
} | |
]; | |
var asem = | |
data.where((e) => e["title"] == 'B').toList().first['options'].length; | |
print(asem.toString()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment