getDatabaseName static method

Future<String?> getDatabaseName({
  1. Future<SharedPreferences>? sharedPreferenceInstance,
})

Get database name form shared preferences

Implementation

static Future<String?> getDatabaseName(
    {Future<SharedPreferences>? sharedPreferenceInstance}) async {
  WidgetsFlutterBinding.ensureInitialized();
  SharedPreferences prefs =
      await (sharedPreferenceInstance ?? SharedPreferences.getInstance());
  return prefs.getString('databaseName');
}