我正在使用sqflite
包,我想从它读取数据,在表中名为my_table
的表中的数据ins,我想读取它的name
属性,并在小部件中使用它,如文本小部件这里是我尝试过的\
list = await db.query('my_table', 'name');
@override
Widget build(BuildContext context) {
ScrollController _scrollController = new ScrollController();
return Scaffold(
floatingActionButton: FloatingActionButton(
onPressed: () {
_scrollController.jumpTo(_scrollController.position.maxScrollExtent);
},
),
body: Container(
color: Colors.blue,
height: 1000,
width: MediaQuery.of(context).size.width,
child: Text('${list}'),
), );
}
1条答案
按热度按时间aurhwmvo1#
请提供更多信息!
使用SQFLite时:
阅读:
https://github.com/tekartik/sqflite/blob/master/sqflite/doc/sql.md
查询用于阅读表内容。它返回一个map列表。
我可以推荐这个guide for SQFLite