使用密码保护保护SQFlite数据库,使其只能由应用访问。
initDb() async {
var databasePath = await getDatabasesPath();
String path = join(databasePath, "Beta2.db");
var theDb = await openDatabase(path, version: 1, onCreate: _onCreate)
return theDb;
}
void _onCreate(Database db, int version) async {
await db.execute(
"CREATE TABLE Master(id INTEGER PRIMARY KEY, masterusername TEXT, masterpassword TEXT)");
print("Created master username and password table")
);
}