Home > Blockchain >  How To Get Specific Row from Map in Widget flutter
How To Get Specific Row from Map in Widget flutter

Time:02-17

[{'name':'a','age':'20'},{'name':'b','age':'21'},{'name':'c','age':'22'}]

Container(
 height: 100,
 child: Column(
         children: people.data!.map((e) {
          return Text(e.name.toString());
        }).toList()),
    ),

How to get 1 row people from list where name=='b'

CodePudding user response:

Try this:

 people.data!.where((e) => e["name"] == "b").map((e){
   return Text(e.name.toString());
 }).toList();
  • Related