flutter-类型' queryrow'不是类型的子类型' string'
类型“QueryRow”不是类型“String”的子类型 当我从 sqflite 检索数据时,我想将其添加到小部件
Future<List> getSpecificForm({String tableName, formId}) async {
final db = await database;
final List<Map<String, dynamic>> result = await db.rawQuery( 'SELECT * FROM $tableName WHERE id=? ORDER BY id DESC', [formId]);
return result;
}
type 'QueryRow' is not a subtype of type 'String'
when I retrieved data from sqflite, and I want to add it to widget
Future<List> getSpecificForm({String tableName, formId}) async {
final db = await database;
final List<Map<String, dynamic>> result = await db.rawQuery( 'SELECT * FROM $tableName WHERE id=? ORDER BY id DESC', [formId]);
return result;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最后我把函数改成这样:
返回列表元素的返回类型为
_InternalLinkedHashMap
Finally, I changed the function like this:
and the return type of elements of the returned list is
_InternalLinkedHashMap<String, dynamic>