问题
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