createSharedDatabase function
Creates a shared database, with dependencies obtained from the given ref.
Implementation
SharedDatabase createSharedDatabase(
Ref ref, {
bool shouldDispose = true,
}) {
driftRuntimeOptions.dontWarnAboutMultipleDatabases = true;
final database = SharedDatabase(ref.watch(connectionProvider));
if (shouldDispose) {
ref.onDispose(database.close);
}
return database;
}