Home > Enterprise >  how do i get access to the list in map for ElevatedButton in flutter?
how do i get access to the list in map for ElevatedButton in flutter?

Time:11-25

enter image description here[enter image description here](https://i.stack.imgur.com/HxY0x.png)

im new to the mobile development can anyone pleased tell me where did i do wrong?
im trying to access to the list inside the map

CodePudding user response:

List of map can be accessed as questions[i]["questionText"]

CodePudding user response:

Map is a function, not a Widget. But you can fix it by using ListView.builder like it :

ListView.builder(
  itemCount: questions[_questionIndex]["Questionanswers"].length,
  itemBuilder: (context, index) {
    return Answer(_quess, questions[_questionIndex]["Questionanswers"][index]);
  },
);

  • Related