openDatabaseMini method
DatabaseMiniGeneralLibrary
openDatabaseMini({
- required String key,
- required DatabaseMiniGeneralLibraryBaseOptions databaseMiniGeneralLibraryBaseOptions,
- required Map defaultData,
Implementation
DatabaseMiniGeneralLibrary openDatabaseMini({
required String key,
required DatabaseMiniGeneralLibraryBaseOptions
databaseMiniGeneralLibraryBaseOptions,
required Map<dynamic, dynamic> defaultData,
}) {
final DatabaseMiniGeneralLibrary? databaseMiniGeneralLibraryOld =
_stateDbMini[key];
if (databaseMiniGeneralLibraryOld == null) {
final DatabaseMiniGeneralLibrary newDatabaseMiniGeneralLibrary =
DatabaseMiniGeneralLibrary();
newDatabaseMiniGeneralLibrary.ensureInitialized(
pathToFile: key,
databaseMiniGeneralLibraryBaseOptions:
databaseMiniGeneralLibraryBaseOptions,
);
newDatabaseMiniGeneralLibrary.initiaLizedSync(
defaultData: defaultData,
);
_stateDbMini[key] = newDatabaseMiniGeneralLibrary;
return newDatabaseMiniGeneralLibrary;
}
return databaseMiniGeneralLibraryOld;
}