getDb method

  1. @protected
Future<Database> getDb()

Access the latest instantiation of the database safely.

Implementation

@protected
Future<Database> getDb() {
  if (_openDb == null) {
    if (databaseFactory != null) {
      _openDb = databaseFactory!.openDatabase(dbName);
    } else {
      _openDb = openDatabase(dbName);
    }
  }
  return _openDb!;
}