ensureSharedPrefIsInitialized method

Future<void> ensureSharedPrefIsInitialized()

Ensures that the SharedPreferences instance has been initialized.

This prevents reinitialization if the shared preferences are already initialized.

Implementation

Future<void> ensureSharedPrefIsInitialized() async {
  if (!sharedPrefIsReady) {
    await init();
  }
}