I am doing looping over the list items in ListView.builder
List _rBoxes = new List();//declare
the data i want to loop is seems like this:
{
"box_content": {
"box_1": [
{
"id": "9",
"name": "abc"
},
{
"id": "10",
"name": "xyz"
}
],
"box_2": [
{
"id": "8",
"name": "acc"
}
],
"box_3": [
{
"id": "1",
"name": "abc"
}
],
"box_4": [
{
"id": "4",
"name": "amno"
},
{
"id": "6",
"name": "jkl"
}
],
"box_5": [
{
"id": "7",
"name": "xre"
}
]
}
}
then i add this items to the list
_rBoxes.addAll(data['box_content']);//it gives error - Unhandled Exception: type '_InternalLinkedHashMap<String, dynamic>' is not a subtype of type 'Iterable<dynamic>'
//widget design
ListView.builder(
physics: NeverScrollableScrollPhysics(),
itemCount: _rBoxItems.length,
itemBuilder: (BuildContext context, int index) {
return Text("${_rBoxItems[index]}",
style: TextStyle(fontSize: 20.0));
})
Error :
//here i want to loop box_1 index (only) in list view, how to acheive this if i gave
_rBoxItems['box_1'].length the error will occur . actucally am stuck in this scenario, help me to resolve this problem.

_rBoxes.addAll(data['box_content']);You want add all torBoxes?