init static method

dynamic init({
  1. String? dbName,
  2. required List<String> tables,
})

Implementation

static init({
  String? dbName,
  required List<String> tables,
}) async {
  final databasesPath = await getDatabasesPath();
  path = databasesPath + (dbName ?? 'sql_query') + '.db';
  database = await openDatabase(path, version: 1, onCreate: (Database db, int version) async {
    for (var i in tables) {
      await db.execute(i);
    }
  });
}