Skip to content

Instantly share code, notes, and snippets.

@nonsocchi
Created May 17, 2023 19:49
Show Gist options
  • Save nonsocchi/4f488fc6f0e525de64150306ff016757 to your computer and use it in GitHub Desktop.
Save nonsocchi/4f488fc6f0e525de64150306ff016757 to your computer and use it in GitHub Desktop.
riverpod_theme_app: Setting up local storage access.
void main() async {
WidgetsFlutterBinding.ensureInitialized();
// Create the shared_preferences instance.
final sharedPreferences = await SharedPreferences.getInstance();
runApp(
ProviderScope(
// override the prefsProvider with this value.
overrides: [
prefsProvider.overrideWithValue(sharedPreferences),
],
child: const MyApp(),
),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment