I have questions table on my Sqflite database but ı can't show them on my Screen.
this all questions in my DatabaseHelper class
Future<List<Map<String, dynamic>>> allQuestions() async {
var db = await _getDataBase();
var sonuc = await db.query(_questionTable, orderBy: '$_columnId DESC');
return sonuc;
}
I can read my data with debugPrint but ı cant show them with future
bottom lines are nonfunctional.
Future<List<Questions>> qestionFromSqfliteDataBase() async {
List<Questions> a;
List<Questions> questionFromDb =
await _databaseHelper.allQuestions().then((mapListAllQuestions) {
for (Map m in mapListAllQuestions) {
a.add(Questions.dbdenOkudugunMapiObjeyeDonustur(m));
}
}).catchError((hata) => print("hata" + hata));
questionFromDb=a;
return questionFromDb;
}
child: FutureBuilder(
future: qestionFromSqfliteDataBase(),
builder: (context, sonuc) {
debugPrint(sonuc.hasData.toString());
if (sonuc.connectionState == ConnectionState.done &&
sonuc.hasData) {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
Padding(
> qestionFromSqfliteDataBase() method is not working
– Yalçın Yıldırım Dec 16 '20 at 11:51