0

我的 Sqflite 数据库上有问题表,但我无法在我的屏幕上显示它们。

我的 DatabaseHelper 类中的所有问题

Future<List<Map<String, dynamic>>> allQuestions() async {
var db = await _getDataBase();
var sonuc = await db.query(_questionTable, orderBy: '$_columnId DESC'); 
return sonuc;
}

我可以用 debugPrint 读取我的数据,但我不能在未来显示它们

底线是无效的。

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(
4

0 回答 0