init static method
dynamic
init()
初始化
Implementation
static init() async {
// open the database
var databasesPath = await getDatabasesPath();
String path = databasesPath + dbName;
if (Platform.isIOS) path = databasesPath + '/' + dbName;
_database = await openDatabase(path, version: dbVersion,
onCreate: (Database db, int version) async {
// When creating the db, create the table
//await db.execute('CREATE TABLE Test (id INTEGER PRIMARY KEY, name TEXT, value INTEGER, num REAL)');
}, onUpgrade: (Database db, int oldVersion, int newVersion) async {
//await db.execute('CREATE TABLE Test (id INTEGER PRIMARY KEY, name TEXT, value INTEGER, num REAL)');
});
}