init static method

dynamic init()

初始化

Implementation

static init() async {
  var databasesPath = await getDatabasesPath();
  String path = join(databasesPath, NAME);

  await deleteDatabase(path);
  // var data = await rootBundle.load(join('assets', 'soulchat.db'));

  // List<int> bytes = data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes);
  // // Write and flush the bytes written
  // await File(path).writeAsBytes(bytes, flush: true);
  _database = await openDatabase(
    path,
    version: _VERSION,
    onCreate: (Database db, int version) async {},
  );
}