Skip to content

Instantly share code, notes, and snippets.

@nonsocchi
Last active May 14, 2023 21:04
Show Gist options
  • Save nonsocchi/7d095d6bc931ef6ceb3f6d4d35e668fa to your computer and use it in GitHub Desktop.
Save nonsocchi/7d095d6bc931ef6ceb3f6d4d35e668fa to your computer and use it in GitHub Desktop.
riverpod_theme_app: service layer providers.
// Creates a themingServiceProvider used by the ThemingController.
@riverpod
ThemingService themingService(ThemingServiceRef ref) {
final prefs = ref.read(prefsProvider);
return ThemingService(prefs);
}
// Override in `Provider Container` when app starts.
@riverpod
SharedPreferences prefs(PrefsRef ref) => throw UnimplementedError();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment