Created
May 17, 2023 19:49
-
-
Save nonsocchi/4f488fc6f0e525de64150306ff016757 to your computer and use it in GitHub Desktop.
riverpod_theme_app: Setting up local storage access.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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