I want to get all the items from the database, but i am stuck how to convert the Future list of strings to list of strings.
var x = DataBaseHelper.instance.queryAllRows();
Future<List<String>> queryAllRows() async {
Database db = await instance._initDatabase();
List<Map<String,dynamic>> s = await db.query(table ,columns: [columnname]);
List<String> list = new List();
for(var x in s){
x.forEach((k,v)=>list.add(v));
}
return list;
}
I want to get all the values in the database but dont know how to convert those values to the List
>' can't be assigned to the parameter type 'Iterable'". Thank you.
– Kamlesh Aug 08 '20 at 17:13