Importing a database using sqlite, flutter app

Deadly 提交于 2019-12-24 17:42:10

问题


My main goal is to import a database into a flutter app using sqlite(sqlflite plugin), instead of having to hard code all of the create tables into the apps code.

*I want the information to be accessed to the phone locally(access data from phone on airplane mode) that is why i am using sqlite

I am having trouble finding information on this online and was seeing if anyone had experience in doing this or has documentation/examples that could help.


回答1:


i think you are looking for this : Open an asset database in this case you must have the database already and you don't need to create tables




回答2:


Flutter supports an open source module SQFlite. SQFlite is a way of storing app data in Flutter Application. SQFlite is a Database plugin for flutter. It is highly reliable and embedded Database engine. All the CRUD operation in the database will run on a background thread. You can see a simple example of this here.



来源:https://stackoverflow.com/questions/51290232/importing-a-database-using-sqlite-flutter-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!