├── .gitattributes ├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── config.yml │ ├── example_request.md │ └── feature_request.md ├── PULL_REQUEST_TEMPLATE.md ├── dependabot.yaml └── workflows │ ├── build.yml │ ├── changelog.yml │ ├── check_generation.yml │ └── riverpod_lint.yml ├── .gitignore ├── .tasks.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── all_lint_rules.yaml ├── analysis_options.yaml ├── benchmarks ├── .gitignore ├── .metadata ├── README.md ├── analysis_options.yaml ├── lib │ ├── add_listener.dart │ ├── common.dart │ ├── create_bench.dart │ ├── main.dart │ ├── read_bench.dart │ └── remove_listener.dart └── pubspec.yaml ├── codecov.yml ├── examples ├── analysis_options.yaml ├── counter │ ├── .metadata │ ├── README.md │ ├── analysis_options.yaml │ ├── lib │ │ ├── main.dart │ │ └── main.g.dart │ ├── pubspec.yaml │ └── test │ │ └── widget_test.dart ├── marvel │ ├── .metadata │ ├── README.md │ ├── analysis_options.yaml │ ├── assets │ │ ├── configurations.json │ │ ├── marvel.svg │ │ └── marvel_background.jpeg │ ├── lib │ │ ├── main.dart │ │ └── src │ │ │ ├── character_1009368.json │ │ │ ├── characters.json │ │ │ ├── characters_20.json │ │ │ ├── characters_name= Iron man (.json │ │ │ ├── characters_name= Iron man.json │ │ │ ├── configuration.dart │ │ │ ├── configuration.freezed.dart │ │ │ ├── configuration.g.dart │ │ │ ├── fake_marvel.dart │ │ │ ├── fake_marvel.g.dart │ │ │ ├── marvel.dart │ │ │ ├── marvel.freezed.dart │ │ │ ├── marvel.g.dart │ │ │ ├── result.dart │ │ │ ├── result.freezed.dart │ │ │ ├── screens │ │ │ ├── character_detail.dart │ │ │ ├── home.dart │ │ │ └── home.freezed.dart │ │ │ └── widgets │ │ │ ├── loading_image.dart │ │ │ ├── marvel_logo.dart │ │ │ └── search_bar.dart │ ├── macos │ │ ├── .gitignore │ │ ├── Flutter │ │ │ ├── Flutter-Debug.xcconfig │ │ │ ├── Flutter-Release.xcconfig │ │ │ └── GeneratedPluginRegistrant.swift │ │ ├── Runner.xcodeproj │ │ │ ├── project.pbxproj │ │ │ ├── project.xcworkspace │ │ │ │ └── xcshareddata │ │ │ │ │ └── IDEWorkspaceChecks.plist │ │ │ └── xcshareddata │ │ │ │ └── xcschemes │ │ │ │ └── Runner.xcscheme │ │ ├── Runner.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ └── Runner │ │ │ ├── AppDelegate.swift │ │ │ ├── Assets.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ ├── Contents.json │ │ │ │ ├── app_icon_1024.png │ │ │ │ ├── app_icon_128.png │ │ │ │ ├── app_icon_16.png │ │ │ │ ├── app_icon_256.png │ │ │ │ ├── app_icon_32.png │ │ │ │ ├── app_icon_512.png │ │ │ │ └── app_icon_64.png │ │ │ ├── Base.lproj │ │ │ └── MainMenu.xib │ │ │ ├── Configs │ │ │ ├── AppInfo.xcconfig │ │ │ ├── Debug.xcconfig │ │ │ ├── Release.xcconfig │ │ │ └── Warnings.xcconfig │ │ │ ├── DebugProfile.entitlements │ │ │ ├── Info.plist │ │ │ ├── MainFlutterWindow.swift │ │ │ └── Release.entitlements │ ├── pubspec.yaml │ └── resources │ │ ├── home.png │ │ ├── marvel_portal.png │ │ └── search.png ├── pub │ ├── .metadata │ ├── README.md │ ├── analysis_options.yaml │ ├── assets │ │ └── search_background.png │ ├── build.yaml │ ├── lib │ │ ├── detail.dart │ │ ├── detail.g.dart │ │ ├── main.dart │ │ ├── pub_repository.dart │ │ ├── pub_repository.freezed.dart │ │ ├── pub_repository.g.dart │ │ ├── pub_ui │ │ │ ├── appbar.dart │ │ │ ├── package_detail_body.dart │ │ │ ├── package_item.dart │ │ │ └── searchbar.dart │ │ ├── search.dart │ │ └── search.g.dart │ └── pubspec.yaml ├── random_number │ ├── .metadata │ ├── README.md │ ├── analysis_options.yaml │ ├── lib │ │ └── main.dart │ └── pubspec.yaml ├── stackoverflow │ ├── .metadata │ ├── README.md │ ├── analysis_options.yaml │ ├── build.yaml │ ├── foo.sh │ ├── lib │ │ ├── common.dart │ │ ├── common.g.dart │ │ ├── home.dart │ │ ├── main.dart │ │ ├── question.dart │ │ ├── question.freezed.dart │ │ ├── question.g.dart │ │ ├── tag.dart │ │ ├── tag.freezed.dart │ │ ├── tag.g.dart │ │ ├── user.dart │ │ ├── user.freezed.dart │ │ └── user.g.dart │ ├── macos │ │ └── Runner │ │ │ └── DebugProfile.entitlements │ └── pubspec.yaml └── todos │ ├── .metadata │ ├── README.md │ ├── analysis_options.yaml │ ├── lib │ ├── main.dart │ └── todo.dart │ ├── pubspec.yaml │ ├── test │ ├── initial_state.png │ ├── new_todo.png │ └── widget_test.dart │ └── todo_screenshot.jpg ├── packages ├── flutter_riverpod │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── dartdoc │ │ ├── core.md │ │ ├── notifiers.md │ │ └── providers.md │ ├── dartdoc_options.yaml │ ├── example │ │ ├── .gitignore │ │ ├── .metadata │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── main.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── widget_test.dart │ ├── lib │ │ ├── experimental │ │ │ └── persist.dart │ │ ├── flutter_riverpod.dart │ │ ├── legacy.dart │ │ ├── misc.dart │ │ └── src │ │ │ ├── builders.dart │ │ │ ├── core.dart │ │ │ ├── core │ │ │ ├── consumer.dart │ │ │ ├── provider_scope.dart │ │ │ └── widget_ref.dart │ │ │ ├── internals.dart │ │ │ └── providers │ │ │ └── legacy │ │ │ └── change_notifier_provider.dart │ ├── pubspec.yaml │ └── test │ │ ├── analysis_options.yaml │ │ ├── auto_dispose_change_notifier_provider_test.dart │ │ ├── consumer_listen_test.dart │ │ ├── framework_test.dart │ │ ├── future_provider_test.dart │ │ ├── listen_test.dart │ │ ├── provider_container_test.dart │ │ ├── provider_scope_test.dart │ │ ├── provider_test.dart │ │ ├── providers │ │ └── change_notifier │ │ │ ├── auto_dispose_change_notifier_provider_test.dart │ │ │ ├── change_notifier_provider_test.dart │ │ │ ├── family_auto_dispose_change_notifier_provider_test.dart │ │ │ └── family_change_notifier_provider_test.dart │ │ ├── src │ │ └── core │ │ │ └── consumer_test.dart │ │ ├── utils.dart │ │ └── widget_ref_test.dart ├── hooks_riverpod │ ├── .metadata │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── dartdoc │ │ ├── core.md │ │ ├── notifiers.md │ │ └── providers.md │ ├── dartdoc_options.yaml │ ├── example │ │ ├── .metadata │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── main.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── widget_test.dart │ ├── lib │ │ ├── experimental │ │ │ └── persist.dart │ │ ├── hooks_riverpod.dart │ │ ├── legacy.dart │ │ ├── misc.dart │ │ └── src │ │ │ ├── consumer.dart │ │ │ └── internals.dart │ ├── pubspec.yaml │ └── test │ │ ├── analysis_options.yaml │ │ ├── hook_consumer_test.dart │ │ ├── internal_test.dart │ │ └── version_test.dart ├── internal_lint │ ├── lib │ │ ├── internal_lint.dart │ │ └── src │ │ │ └── lints │ │ │ └── show_all.dart │ └── pubspec.yaml ├── lint_visitor_generator │ ├── LICENSE │ ├── README.md │ ├── build.yaml │ ├── lib │ │ ├── builder.dart │ │ └── src │ │ │ └── type_checker.dart │ └── pubspec.yaml ├── riverpod │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── dartdoc │ │ ├── core.md │ │ ├── notifiers.md │ │ └── providers.md │ ├── dartdoc_options.yaml │ ├── example │ │ ├── .gitignore │ │ ├── README.md │ │ ├── analysis_options.yaml │ │ ├── build.yaml │ │ ├── lib │ │ │ ├── main.dart │ │ │ ├── models.dart │ │ │ ├── models.freezed.dart │ │ │ └── models.g.dart │ │ └── pubspec.yaml │ ├── lib │ │ ├── experimental │ │ │ └── persist.dart │ │ ├── legacy.dart │ │ ├── misc.dart │ │ ├── riverpod.dart │ │ └── src │ │ │ ├── builder.dart │ │ │ ├── common │ │ │ ├── env.dart │ │ │ ├── internal_lints.dart │ │ │ ├── listenable.dart │ │ │ ├── pragma.dart │ │ │ ├── result.dart │ │ │ ├── stack_trace.dart │ │ │ └── tenable.dart │ │ │ ├── core │ │ │ ├── async_value.dart │ │ │ ├── element.dart │ │ │ ├── family.dart │ │ │ ├── foundation.dart │ │ │ ├── modifiers │ │ │ │ ├── future.dart │ │ │ │ ├── select.dart │ │ │ │ └── select_async.dart │ │ │ ├── override.dart │ │ │ ├── override_with_value.dart │ │ │ ├── persist.dart │ │ │ ├── provider │ │ │ │ ├── functional_provider.dart │ │ │ │ ├── notifier_provider.dart │ │ │ │ └── provider.dart │ │ │ ├── provider_container.dart │ │ │ ├── provider_subscription.dart │ │ │ ├── proxy_provider_listenable.dart │ │ │ ├── ref.dart │ │ │ └── scheduler.dart │ │ │ ├── framework.dart │ │ │ ├── internals.dart │ │ │ ├── mutation.dart │ │ │ └── providers │ │ │ ├── async_notifier.dart │ │ │ ├── async_notifier │ │ │ ├── family.dart │ │ │ └── orphan.dart │ │ │ ├── future_provider.dart │ │ │ ├── legacy │ │ │ ├── state_controller.dart │ │ │ ├── state_notifier_provider.dart │ │ │ └── state_provider.dart │ │ │ ├── notifier.dart │ │ │ ├── notifier │ │ │ ├── family.dart │ │ │ └── orphan.dart │ │ │ ├── provider.dart │ │ │ ├── stream_notifier.dart │ │ │ ├── stream_notifier │ │ │ ├── family.dart │ │ │ └── orphan.dart │ │ │ └── stream_provider.dart │ ├── pubspec.yaml │ └── test │ │ ├── analysis_options.yaml │ │ ├── feature │ │ ├── auto_dispose_test.dart │ │ ├── offline_test.dart │ │ ├── scope_test.dart │ │ ├── uni_directional_test.dart │ │ └── visit_states_test.dart │ │ ├── meta_test.dart │ │ ├── old │ │ ├── framework │ │ │ ├── auto_dispose_test.dart │ │ │ ├── family_test.dart │ │ │ ├── modifiers_test.dart │ │ │ ├── provider_container_test.dart │ │ │ ├── proxy_provider_listenable_test.dart │ │ │ └── ref_watch_test.dart │ │ ├── legacy │ │ │ ├── framework2 │ │ │ │ └── framework_test.dart │ │ │ └── framework_test.dart │ │ ├── legacy_providers │ │ │ ├── deprecated │ │ │ │ ├── state_notifier_provider │ │ │ │ │ ├── auto_dispose_family_test.dart │ │ │ │ │ ├── auto_dispose_state_notifier_provider_test.dart │ │ │ │ │ ├── family_test.dart │ │ │ │ │ └── state_notifier_provider_test.dart │ │ │ │ └── state_provider │ │ │ │ │ ├── state_controller_test.dart │ │ │ │ │ ├── state_provider_auto_dispose_test.dart │ │ │ │ │ ├── state_provider_family_auto_dispose_test.dart │ │ │ │ │ ├── state_provider_family_test.dart │ │ │ │ │ └── state_provider_test.dart │ │ │ ├── future_provider │ │ │ │ ├── auto_dispose_family_future_provider_test.dart │ │ │ │ ├── auto_dispose_future_provider_test.dart │ │ │ │ ├── family_future_provider_test.dart │ │ │ │ └── future_provider_test.dart │ │ │ ├── provider │ │ │ │ ├── auto_dispose_provider_family_test.dart │ │ │ │ ├── auto_dispose_provider_test.dart │ │ │ │ ├── provider_family_test.dart │ │ │ │ └── provider_test.dart │ │ │ ├── scoped_provider │ │ │ │ └── scoped_provider_test.dart │ │ │ └── stream_provider │ │ │ │ ├── auto_dispose_family_stream_provider_test.dart │ │ │ │ ├── auto_dispose_stream_provider_test.dart │ │ │ │ ├── stream_provider_family_test.dart │ │ │ │ └── stream_provider_test.dart │ │ └── utils.dart │ │ ├── src │ │ ├── common │ │ │ ├── result_test.dart │ │ │ └── stack_trace_test.dart │ │ ├── core │ │ │ ├── async_value_test.dart │ │ │ ├── auto_dispose_test.dart │ │ │ ├── family_test.dart │ │ │ ├── modifiers │ │ │ │ ├── future_test.dart │ │ │ │ ├── select_async_test.dart │ │ │ │ └── select_test.dart │ │ │ ├── overrides_test.dart │ │ │ ├── provider_container_test.dart │ │ │ ├── provider_element_test.dart │ │ │ ├── provider_observer_test.dart │ │ │ ├── provider_subscription_test.dart │ │ │ ├── provider_test.dart │ │ │ ├── proxy_provider_listenable_test.dart │ │ │ └── ref_test.dart │ │ ├── matrix.dart │ │ ├── matrix │ │ │ ├── async_notifier_provider.dart │ │ │ ├── notifier_mixin.dart │ │ │ ├── notifier_provider.dart │ │ │ └── stream_notifier_provider.dart │ │ ├── providers │ │ │ ├── async_notifier_test.dart │ │ │ ├── future_provider_test.dart │ │ │ ├── notifier_test.dart │ │ │ └── stream_notifier_test.dart │ │ └── utils.dart │ │ └── third_party │ │ └── fake_async.dart ├── riverpod_analyzer_utils │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── analysis_options.yaml │ ├── lib │ │ ├── riverpod_analyzer_utils.dart │ │ └── src │ │ │ ├── analyzer_utils.dart │ │ │ ├── argument_list_utils.dart │ │ │ ├── element_util.dart │ │ │ ├── errors.dart │ │ │ ├── nodes.dart │ │ │ ├── nodes.g.dart │ │ │ ├── nodes │ │ │ ├── annotation.dart │ │ │ ├── dependencies.dart │ │ │ ├── provider_for.dart │ │ │ ├── provider_listenable.dart │ │ │ ├── provider_or_family.dart │ │ │ ├── providers │ │ │ │ ├── function.dart │ │ │ │ ├── identifiers.dart │ │ │ │ ├── legacy.dart │ │ │ │ ├── notifier.dart │ │ │ │ └── providers.dart │ │ │ ├── ref_invocation.dart │ │ │ ├── scopes │ │ │ │ ├── overrides.dart │ │ │ │ ├── provider_container.dart │ │ │ │ └── provider_scope.dart │ │ │ ├── widget_ref_invocation.dart │ │ │ └── widgets │ │ │ │ ├── state.dart │ │ │ │ ├── stateful_widget.dart │ │ │ │ ├── stateless_widget.dart │ │ │ │ └── widget.dart │ │ │ ├── object_extensions.dart │ │ │ ├── riverpod_types.dart │ │ │ └── riverpod_types │ │ │ ├── core.dart │ │ │ ├── generator.dart │ │ │ ├── legacy_providers.dart │ │ │ ├── providers.dart │ │ │ └── widgets.dart │ └── pubspec.yaml ├── riverpod_analyzer_utils_tests │ ├── README.md │ ├── pubspec.yaml │ └── test │ │ ├── analyzer_test_utils.dart │ │ ├── consumer_test.dart │ │ ├── legacy_provider_declaration_test.dart │ │ ├── matchers.dart │ │ ├── mutation_test.dart │ │ ├── nodes │ │ ├── dependencies_test.dart │ │ ├── providers │ │ │ ├── generated_providers_test.dart │ │ │ └── identifiers_test.dart │ │ └── riverpod_test.dart │ │ ├── provider_container_test.dart │ │ ├── provider_scope_test.dart │ │ ├── ref_invocation_test.dart │ │ ├── type_utils_test.dart │ │ └── widget_ref_invocation_test.dart ├── riverpod_annotation │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── analysis_options.yaml │ ├── lib │ │ ├── experimental │ │ │ ├── json_persist.dart │ │ │ ├── mutation.dart │ │ │ ├── persist.dart │ │ │ └── scope.dart │ │ ├── riverpod_annotation.dart │ │ └── src │ │ │ ├── internal.dart │ │ │ └── riverpod_annotation.dart │ └── pubspec.yaml ├── riverpod_generator │ ├── .pubignore │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── analysis_options.yaml │ ├── build.yaml │ ├── dartdoc_options.yaml │ ├── integration │ │ └── build_yaml │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── build.yaml │ │ │ ├── lib │ │ │ ├── dependencies.dart │ │ │ ├── dependencies.g.dart │ │ │ ├── main.dart │ │ │ └── main.g.dart │ │ │ ├── pubspec.yaml │ │ │ └── test │ │ │ └── build_yaml_test.dart │ ├── lib │ │ ├── builder.dart │ │ └── src │ │ │ ├── json_generator.dart │ │ │ ├── models.dart │ │ │ ├── parse_generator.dart │ │ │ ├── riverpod_generator.dart │ │ │ ├── templates │ │ │ ├── element.dart │ │ │ ├── family.dart │ │ │ ├── hash.dart │ │ │ ├── mutation.dart │ │ │ ├── notifier.dart │ │ │ ├── parameters.dart │ │ │ ├── provider.dart │ │ │ ├── provider_variable.dart │ │ │ └── template.dart │ │ │ └── validation.dart │ ├── pubspec.yaml │ └── test │ │ ├── analysis_options.yaml │ │ ├── annotated_test.dart │ │ ├── async_notifier_test.dart │ │ ├── async_test.dart │ │ ├── auto_dispose_test.dart │ │ ├── build_yaml_config_test.dart │ │ ├── dependencies_test.dart │ │ ├── doc_test.dart │ │ ├── error_test.dart │ │ ├── hash_test.dart │ │ ├── integration │ │ ├── annotated.dart │ │ ├── annotated.g.dart │ │ ├── async.dart │ │ ├── async.g.dart │ │ ├── auto_dispose.dart │ │ ├── auto_dispose.g.dart │ │ ├── dependencies.dart │ │ ├── dependencies.g.dart │ │ ├── dependencies2.dart │ │ ├── dependencies2.g.dart │ │ ├── documented.dart │ │ ├── documented.g.dart │ │ ├── generated.dart │ │ ├── generated.freezed.dart │ │ ├── generated.g.dart │ │ ├── hash │ │ │ ├── hash1.dart │ │ │ ├── hash1.g.dart │ │ │ ├── retry.dart │ │ │ └── retry.g.dart │ │ ├── mutation.dart │ │ ├── mutation.g.dart │ │ ├── offline.dart │ │ ├── offline.g.dart │ │ ├── scopes.dart │ │ ├── scopes.g.dart │ │ ├── split.dart │ │ ├── split.g.dart │ │ ├── split2.dart │ │ ├── stream.dart │ │ ├── stream.g.dart │ │ ├── sync.dart │ │ └── sync.g.dart │ │ ├── mock.dart │ │ ├── mutation_test.dart │ │ ├── notifier_test.dart │ │ ├── offline_test.dart │ │ ├── retry_test.dart │ │ ├── scoped_test.dart │ │ ├── stream_notifier_test.dart │ │ ├── stream_test.dart │ │ └── sync_test.dart ├── riverpod_graph │ ├── CHANGELOG.md │ ├── README.md │ ├── bin │ │ └── riverpod_graph.dart │ ├── lib │ │ ├── riverpod_graph.dart │ │ └── src │ │ │ └── analyze.dart │ ├── pubspec.yaml │ └── test │ │ ├── analyze_test.dart │ │ └── integration │ │ ├── addition │ │ ├── addition_test.dart │ │ └── golden │ │ │ ├── lib │ │ │ ├── base_providers.dart │ │ │ ├── combined_provider.dart │ │ │ └── constructor_providers.dart │ │ │ └── pubspec.yaml │ │ ├── analysis_options.yaml │ │ ├── consumer_widget │ │ ├── consumer_widget_test.dart │ │ └── golden │ │ │ ├── lib │ │ │ └── main.dart │ │ │ └── pubspec.yaml │ │ └── generated │ │ ├── generated_test.dart │ │ └── golden │ │ ├── lib │ │ ├── sync.dart │ │ └── sync.g.dart │ │ └── pubspec.yaml ├── riverpod_lint │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── analysis_options.yaml │ ├── lib │ │ ├── riverpod_lint.dart │ │ └── src │ │ │ ├── assists │ │ │ ├── class_based_to_functional_provider.dart │ │ │ ├── convert_to_stateful_base_widget.dart │ │ │ ├── convert_to_stateless_base_widget.dart │ │ │ ├── convert_to_widget_utils.dart │ │ │ ├── functional_to_class_based_provider.dart │ │ │ ├── wrap_with_consumer.dart │ │ │ └── wrap_with_provider_scope.dart │ │ │ ├── imports.dart │ │ │ ├── lints │ │ │ ├── async_value_nullable_pattern.dart │ │ │ ├── avoid_build_context_in_providers.dart │ │ │ ├── avoid_manual_providers_as_generated_provider_dependency.dart │ │ │ ├── avoid_public_notifier_properties.dart │ │ │ ├── avoid_ref_inside_state_dispose.dart │ │ │ ├── functional_ref.dart │ │ │ ├── missing_provider_scope.dart │ │ │ ├── notifier_build.dart │ │ │ ├── notifier_extends.dart │ │ │ ├── only_use_keep_alive_inside_keep_alive.dart │ │ │ ├── protected_notifier_properties.dart │ │ │ ├── provider_dependencies.dart │ │ │ ├── provider_parameters.dart │ │ │ ├── riverpod_syntax_error.dart │ │ │ ├── scoped_providers_should_specify_dependencies.dart │ │ │ └── unsupported_provider_value.dart │ │ │ ├── object_utils.dart │ │ │ └── riverpod_custom_lint.dart │ ├── pubspec.yaml │ └── resources │ │ ├── convert_to_class_provider.gif │ │ ├── convert_to_consumer_widget.gif │ │ ├── convert_to_functional_provider.gif │ │ ├── convert_to_stateful_consumer.gif │ │ ├── wrap_with_consumer.gif │ │ └── wrap_with_provider_scope.gif ├── riverpod_lint_flutter_test │ ├── README.md │ ├── analysis_options.yaml │ ├── build.yaml │ ├── pubspec.yaml │ ├── pubspec_overrides.yaml │ └── test │ │ ├── assists │ │ ├── convert_class_based_provider_to_functional │ │ │ ├── convert_class_based_provider_to_functional.dart │ │ │ ├── convert_class_based_provider_to_functional.g.dart │ │ │ └── convert_class_based_provider_to_functional_test.dart │ │ ├── convert_functional_provider_to_class_based │ │ │ ├── convert_functional_provider_to_class_based.dart │ │ │ ├── convert_functional_provider_to_class_based.g.dart │ │ │ └── convert_functional_provider_to_class_based_test.dart │ │ ├── convert_to_widget │ │ │ ├── convert_to_widget.dart │ │ │ └── convert_to_widget_test.dart │ │ ├── goldens │ │ │ ├── convert_class_based_provider_to_functional │ │ │ │ └── convert_class_based_provider_to_functional.diff │ │ │ ├── convert_functional_provider_to_class_based │ │ │ │ └── convert_functional_provider_to_class_based.diff │ │ │ ├── convert_to_widget │ │ │ │ ├── convert_to_consumer_stateful_widget.diff │ │ │ │ ├── convert_to_consumer_widget.diff │ │ │ │ ├── convert_to_hook_consumer_widget.diff │ │ │ │ ├── convert_to_hook_widget.diff │ │ │ │ ├── convert_to_stateful_hook_consumer_widget.diff │ │ │ │ ├── convert_to_stateful_hook_widget.diff │ │ │ │ ├── convert_to_stateful_widget.diff │ │ │ │ └── convert_to_stateless_widget.diff │ │ │ └── wrap_widget │ │ │ │ ├── wrap_with_consumer.diff │ │ │ │ └── wrap_with_provider_scope.diff │ │ └── wrap_widget │ │ │ ├── wrap_widget.dart │ │ │ └── wrap_widget_test.dart │ │ ├── encoders.dart │ │ ├── golden.dart │ │ ├── io_utils.dart │ │ ├── lints │ │ ├── async_value_nullable_pattern.dart │ │ ├── avoid_build_context_in_providers.dart │ │ ├── avoid_build_context_in_providers.g.dart │ │ ├── avoid_public_notifier_properties.dart │ │ ├── avoid_public_notifier_properties.g.dart │ │ ├── avoid_ref_inside_state_dispose.dart │ │ ├── functional_ref │ │ │ ├── failing_functional_ref.dart │ │ │ ├── fix │ │ │ │ ├── failing_functional_ref.diff │ │ │ │ ├── functional_ref.diff │ │ │ │ └── functional_ref_test.dart │ │ │ ├── functional_ref.dart │ │ │ ├── functional_ref.diff │ │ │ └── functional_ref.g.dart │ │ ├── goldens │ │ │ ├── async_value_nullable_pattern │ │ │ │ ├── async_value_nullable_pattern_fix.diff │ │ │ │ └── async_value_nullable_pattern_lint.md │ │ │ ├── avoid_build_context_in_providers │ │ │ │ └── avoid_build_context_in_providers_lint.md │ │ │ ├── avoid_public_notifier_properties │ │ │ │ └── avoid_public_notifier_properties_lint.md │ │ │ ├── avoid_ref_inside_state_dispose │ │ │ │ └── avoid_ref_inside_state_dispose_lint.md │ │ │ ├── functional_ref │ │ │ │ ├── failing_functional_ref_fix.diff │ │ │ │ ├── failing_functional_ref_lint.md │ │ │ │ ├── functional_ref_fix.diff │ │ │ │ └── functional_ref_lint.md │ │ │ ├── missing_provider_scope │ │ │ │ ├── missing_provider_scope_fix.diff │ │ │ │ └── missing_provider_scope_lint.md │ │ │ ├── notifier_build │ │ │ │ ├── notifier_build_fix.diff │ │ │ │ └── notifier_build_lint.md │ │ │ ├── notifier_extends │ │ │ │ ├── failing_notifier_extends_fix.diff │ │ │ │ ├── failing_notifier_extends_lint.md │ │ │ │ ├── notifier_extends_fix.diff │ │ │ │ └── notifier_extends_lint.md │ │ │ ├── only_use_keep_alive_inside_keep_alive │ │ │ │ └── only_use_keep_alive_inside_keep_alive_lint.md │ │ │ ├── protected_notifier_properties │ │ │ │ └── protected_notifier_properties_lint.md │ │ │ ├── provider_dependencies │ │ │ │ ├── missing_dependencies2_fix.diff │ │ │ │ ├── missing_dependencies2_lint.md │ │ │ │ ├── missing_dependencies_fix.diff │ │ │ │ ├── missing_dependencies_lint.md │ │ │ │ ├── unused_dependency_fix.diff │ │ │ │ └── unused_dependency_lint.md │ │ │ ├── provider_parameters │ │ │ │ └── provider_parameters_lint.md │ │ │ ├── riverpod_syntax_error │ │ │ │ └── riverpod_syntax_error_lint.md │ │ │ ├── scoped_providers_should_specify_dependencies │ │ │ │ └── scoped_providers_should_specify_dependencies_lint.md │ │ │ └── unsupported_provider_value │ │ │ │ └── unsupported_provider_value_lint.md │ │ ├── missing_provider_scope.dart │ │ ├── notifier_build.dart │ │ ├── notifier_extends │ │ │ ├── failing_notifier_extends.dart │ │ │ ├── notifier_extends.dart │ │ │ └── notifier_extends.g.dart │ │ ├── only_use_keep_alive_inside_keep_alive.dart │ │ ├── only_use_keep_alive_inside_keep_alive.g.dart │ │ ├── protected_notifier_properties.dart │ │ ├── protected_notifier_properties.g.dart │ │ ├── provider_dependencies │ │ │ ├── another.dart │ │ │ ├── another.g.dart │ │ │ ├── missing_dependencies.dart │ │ │ ├── missing_dependencies.g.dart │ │ │ ├── missing_dependencies2.dart │ │ │ ├── missing_dependencies2.g.dart │ │ │ ├── unused_dependency.dart │ │ │ └── unused_dependency.g.dart │ │ ├── provider_parameters.dart │ │ ├── provider_parameters.freezed.dart │ │ ├── provider_parameters.g.dart │ │ ├── riverpod_syntax_error.dart │ │ ├── scoped_providers_should_specify_dependencies.dart │ │ ├── scoped_providers_should_specify_dependencies.g.dart │ │ ├── unsupported_provider_value.dart │ │ └── unsupported_provider_value.g.dart │ │ ├── riverpod_test.dart │ │ └── test_lint.dart └── riverpod_sqflite │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── example │ ├── .gitignore │ ├── README.md │ ├── analysis_options.yaml │ ├── lib │ │ ├── generated.dart │ │ ├── generated.freezed.dart │ │ ├── generated.g.dart │ │ └── manual.dart │ └── pubspec.yaml │ ├── lib │ ├── riverpod_sqflite.dart │ └── src │ │ └── riverpod_sqflite.dart │ ├── pubspec.yaml │ └── test │ ├── persist_test.dart │ └── third_party │ └── fake_async.dart ├── pubspec.yaml ├── resources ├── devtool_graph.jpeg ├── flutter_favorite.png └── icon │ ├── Facebook Cover A.png │ ├── Instagaram.png │ ├── Linked In Cover A.png │ ├── Logo A1.jpg │ ├── Logo A1.png │ ├── Logo-A1-icon copy.png │ ├── Logo-A1-icon.jpg │ ├── Logo-A1-icon.png │ ├── Twitter Cover A.png │ ├── Youtube Cover A.png │ └── vector file.eps ├── scripts ├── coverage.sh ├── generate.sh └── test_all.sh ├── tools └── generate_providers │ ├── bin │ └── generate_providers.dart │ ├── pubspec.yaml │ └── src │ └── docs.dart └── website ├── .gitignore ├── README.md ├── analysis_options.yaml ├── build.yaml ├── docs ├── 3.0_migration.mdx ├── advanced │ ├── select.mdx │ └── select │ │ ├── select │ │ ├── codegen.dart │ │ ├── codegen.g.dart │ │ ├── index.ts │ │ └── raw.dart │ │ └── select_async │ │ ├── codegen.dart │ │ ├── codegen.g.dart │ │ ├── index.ts │ │ └── raw.dart ├── case_studies │ ├── cancel.mdx │ ├── cancel │ │ ├── detail_screen │ │ │ ├── codegen.dart │ │ │ ├── codegen.freezed.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.ts │ │ │ └── raw.dart │ │ ├── detail_screen_cancel │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.ts │ │ │ └── raw.dart │ │ ├── detail_screen_debounce │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.ts │ │ │ └── raw.dart │ │ ├── extension.dart │ │ ├── home_screen.dart │ │ └── provider_with_extension │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.ts │ │ │ └── raw.dart │ ├── pull_to_refresh.mdx │ └── pull_to_refresh │ │ ├── activity │ │ ├── codegen.dart │ │ ├── codegen.freezed.dart │ │ ├── codegen.g.dart │ │ ├── index.ts │ │ └── raw.dart │ │ ├── display_activity.dart │ │ ├── display_activity2.dart │ │ ├── display_activity3.dart │ │ ├── display_activity4.dart │ │ ├── fetch_activity │ │ ├── codegen.dart │ │ ├── codegen.g.dart │ │ ├── index.ts │ │ └── raw.dart │ │ └── full_app │ │ ├── codegen.dart │ │ ├── codegen.freezed.dart │ │ ├── codegen.g.dart │ │ ├── index.ts │ │ └── raw.dart ├── concepts │ ├── about_code_generation.mdx │ ├── about_codegen │ │ ├── main.dart │ │ ├── main.g.dart │ │ ├── provider_type │ │ │ ├── async_class_future.dart │ │ │ ├── async_class_future.g.dart │ │ │ ├── async_class_stream.dart │ │ │ ├── async_class_stream.g.dart │ │ │ ├── async_fn_future.dart │ │ │ ├── async_fn_future.g.dart │ │ │ ├── async_fn_stream.dart │ │ │ ├── async_fn_stream.g.dart │ │ │ ├── auto_dispose.dart │ │ │ ├── auto_dispose.g.dart │ │ │ ├── family.dart │ │ │ ├── family.g.dart │ │ │ ├── family_class.dart │ │ │ ├── family_class.g.dart │ │ │ ├── family_fn.dart │ │ │ ├── family_fn.g.dart │ │ │ ├── non_code_gen │ │ │ │ ├── async_notifier_provider.dart │ │ │ │ ├── auto_dispose.dart │ │ │ │ ├── family.dart │ │ │ │ ├── future_provider.dart │ │ │ │ ├── notifier_provider.dart │ │ │ │ ├── provider.dart │ │ │ │ ├── stream_notifier_provider.dart │ │ │ │ └── stream_provider.dart │ │ │ ├── sync_class.dart │ │ │ ├── sync_class.g.dart │ │ │ ├── sync_fn.dart │ │ │ └── sync_fn.g.dart │ │ └── raw.dart │ ├── about_hooks.mdx │ ├── about_hooks │ │ ├── hook_and_consumer.dart │ │ ├── hook_consumer.dart │ │ └── hook_consumer_widget.dart │ ├── async_initialization.dart │ ├── combining_provider_states │ │ ├── characters_provider │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.tsx │ │ │ ├── models.dart │ │ │ └── raw.dart │ │ ├── city_provider │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.tsx │ │ │ └── raw.dart │ │ ├── filtered_todo_list_provider │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.tsx │ │ │ └── raw.dart │ │ ├── read_in_provider │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.tsx │ │ │ └── raw.dart │ │ ├── select_async_provider │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.tsx │ │ │ ├── models.dart │ │ │ └── raw.dart │ │ ├── todo_list_provider │ │ │ ├── codegen.dart │ │ │ ├── codegen.freezed.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.tsx │ │ │ └── raw.dart │ │ ├── weather_provider │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.tsx │ │ │ └── raw.dart │ │ └── whole_object_provider │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.tsx │ │ │ ├── models.dart │ │ │ └── raw.dart │ ├── combining_providers.mdx │ ├── lifecycle_on_dispose │ │ ├── codegen.dart │ │ ├── codegen.g.dart │ │ ├── index.tsx │ │ └── raw.dart │ ├── modifiers │ │ ├── auto_dispose.mdx │ │ └── family.mdx │ ├── provider_lifecycles.mdx │ ├── provider_observer.mdx │ ├── provider_observer_logger.dart │ ├── providers.mdx │ ├── providers │ │ ├── creating_a_provider │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.tsx │ │ │ └── raw.dart │ │ └── declaring_many_providers │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.tsx │ │ │ └── raw.dart │ ├── reading.mdx │ ├── reading │ │ ├── consumer_hook.dart │ │ ├── consumer_stateful_widget │ │ │ ├── hooks.dart │ │ │ ├── index.tsx │ │ │ └── raw.dart │ │ ├── consumer_widget │ │ │ ├── hooks.dart │ │ │ ├── index.tsx │ │ │ └── raw.dart │ │ ├── counter │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.tsx │ │ │ └── raw.dart │ │ ├── listen │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.tsx │ │ │ └── raw.dart │ │ ├── listen_build │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── codegen_hooks.dart │ │ │ ├── codegen_hooks.g.dart │ │ │ ├── index.tsx │ │ │ ├── raw.dart │ │ │ └── raw_hooks.dart │ │ ├── provider │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.tsx │ │ │ └── raw.dart │ │ ├── read │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── codegen_hooks.dart │ │ │ ├── codegen_hooks.g.dart │ │ │ ├── index.tsx │ │ │ ├── raw.dart │ │ │ └── raw_hooks.dart │ │ ├── read_build │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.tsx │ │ │ └── raw.dart │ │ ├── read_notifier_build │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.tsx │ │ │ └── raw.dart │ │ ├── watch │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.tsx │ │ │ └── raw.dart │ │ ├── watch_build │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── codegen_hooks.dart │ │ │ ├── codegen_hooks.g.dart │ │ │ ├── index.tsx │ │ │ ├── raw.dart │ │ │ └── raw_hooks.dart │ │ └── watch_notifier_build │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.tsx │ │ │ └── raw.dart │ ├── scopes.mdx │ ├── subtree_scope.dart │ ├── theme_scope.dart │ ├── why_immutability.mdx │ └── why_immutability │ │ ├── codegen.dart │ │ ├── codegen.freezed.dart │ │ ├── codegen.g.dart │ │ ├── index.tsx │ │ └── raw.dart ├── cookbooks │ ├── search_as_we_type.mdx │ ├── testing.mdx │ ├── testing_dart.dart │ ├── testing_flutter.dart │ ├── testing_full.dart │ ├── testing_original_test_dart.dart │ ├── testing_original_test_flutter.dart │ ├── testing_override_info.dart │ └── testing_repository.dart ├── essentials │ ├── auto_dispose.mdx │ ├── auto_dispose │ │ ├── cache_for_extension.dart │ │ ├── cache_for_usage │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.ts │ │ │ └── raw.dart │ │ ├── codegen_keep_alive.dart │ │ ├── codegen_keep_alive.g.dart │ │ ├── invalidate_example.dart │ │ ├── invalidate_family_example │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.ts │ │ │ └── raw.dart │ │ ├── keep_alive │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.ts │ │ │ └── raw.dart │ │ ├── on_dispose_example │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.ts │ │ │ └── raw.dart │ │ └── raw_auto_dispose.dart │ ├── combining_requests.mdx │ ├── combining_requests │ │ ├── functional_ref │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.ts │ │ │ └── raw.dart │ │ ├── listen_example │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.ts │ │ │ └── raw.dart │ │ ├── notifier_ref │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.ts │ │ │ └── raw.dart │ │ ├── read_example │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.ts │ │ │ └── raw.dart │ │ ├── watch_example │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.ts │ │ │ └── raw.dart │ │ └── watch_placement │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.ts │ │ │ └── raw.dart │ ├── do_dont.mdx │ ├── eager_initialization.mdx │ ├── eager_initialization │ │ ├── async_consumer_example.dart │ │ ├── consumer_example.dart │ │ └── require_value │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.ts │ │ │ └── raw.dart │ ├── faq.mdx │ ├── first_request.mdx │ ├── first_request │ │ ├── activity.ts │ │ ├── codegen │ │ │ ├── activity.dart │ │ │ ├── activity.freezed.dart │ │ │ ├── activity.g.dart │ │ │ ├── provider.dart │ │ │ └── provider.g.dart │ │ ├── consumer.ts │ │ ├── consumer_stateful_widget.ts │ │ ├── consumer_widget.ts │ │ ├── hook_consumer_widget.ts │ │ ├── legend │ │ │ ├── DocuCode.scss │ │ │ └── legend.tsx │ │ ├── provider.ts │ │ └── raw │ │ │ ├── activity.dart │ │ │ ├── consumer.dart │ │ │ ├── consumer_stateful_widget.dart │ │ │ ├── consumer_widget.dart │ │ │ ├── hook_consumer_widget.dart │ │ │ └── provider.dart │ ├── passing_args.mdx │ ├── passing_args │ │ ├── family │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.ts │ │ │ └── raw.dart │ │ ├── no_arg_provider │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.ts │ │ │ └── raw.dart │ │ └── raw │ │ │ ├── consumer_family.dart │ │ │ ├── consumer_list_family.dart │ │ │ ├── consumer_provider.dart │ │ │ ├── consumer_tuple_family.dart │ │ │ ├── multiple_consumer_family.dart │ │ │ └── tuple_family.dart │ ├── provider_observer.mdx │ ├── provider_observer │ │ └── provider_observer.dart │ ├── side_effects.mdx │ ├── side_effects │ │ ├── codegen │ │ │ ├── todo_list_notifier.dart │ │ │ ├── todo_list_notifier.freezed.dart │ │ │ ├── todo_list_notifier.g.dart │ │ │ ├── todo_list_notifier_add_todo.dart │ │ │ ├── todo_list_notifier_add_todo.g.dart │ │ │ ├── todo_list_provider.dart │ │ │ ├── todo_list_provider.freezed.dart │ │ │ └── todo_list_provider.g.dart │ │ ├── raw │ │ │ ├── consumer_add_todo_call.dart │ │ │ ├── invalidate_self_add_todo.dart │ │ │ ├── manual_add_todo.dart │ │ │ ├── mutable_manual_add_todo.dart │ │ │ ├── render_add_todo.dart │ │ │ ├── render_add_todo_hooks.dart │ │ │ ├── rest_add_todo.dart │ │ │ ├── todo_list_notifier.dart │ │ │ ├── todo_list_notifier_add_todo.dart │ │ │ └── todo_list_provider.dart │ │ ├── render_add_todo.ts │ │ ├── todo_list_notifier.ts │ │ ├── todo_list_notifier_add_todo.ts │ │ └── todo_list_provider.ts │ ├── testing.mdx │ ├── testing │ │ ├── auto_dispose_listen.dart │ │ ├── await_future.dart │ │ ├── full_widget_test.dart │ │ ├── listen_provider.dart │ │ ├── mock_provider.dart │ │ ├── notifier_mock │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.ts │ │ │ └── raw.dart │ │ ├── notifier_usage.dart │ │ ├── provider_to_mock │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.ts │ │ │ └── raw.dart │ │ ├── unit_test.dart │ │ ├── widget_container_of.dart │ │ └── widget_test.dart │ ├── websockets_sync.mdx │ └── websockets_sync │ │ ├── change_notifier_provider.dart │ │ ├── pipe_change_notifier.dart │ │ ├── pipe_change_notifier.g.dart │ │ ├── raw_usage.dart │ │ ├── raw_usage.g.dart │ │ ├── shared_pipe_change_notifier.dart │ │ ├── shared_pipe_change_notifier.g.dart │ │ ├── stream_provider │ │ ├── codegen.dart │ │ ├── codegen.g.dart │ │ ├── index.ts │ │ └── raw.dart │ │ ├── sync_consumer.dart │ │ └── sync_definition │ │ ├── codegen.dart │ │ ├── codegen.g.dart │ │ ├── index.ts │ │ └── raw.dart ├── from_provider │ ├── family │ │ ├── family.dart │ │ ├── family.g.dart │ │ ├── index.tsx │ │ └── raw.dart │ ├── helpers │ │ ├── item.dart │ │ ├── item.freezed.dart │ │ ├── item.g.dart │ │ └── json.dart │ ├── motivation │ │ ├── async_values │ │ │ ├── async_values.dart │ │ │ ├── async_values.g.dart │ │ │ ├── index.tsx │ │ │ └── raw.dart │ │ ├── auto_dispose │ │ │ ├── auto_dispose.dart │ │ │ ├── auto_dispose.g.dart │ │ │ ├── index.tsx │ │ │ └── raw.dart │ │ ├── combine │ │ │ ├── combine.dart │ │ │ ├── combine.g.dart │ │ │ ├── index.tsx │ │ │ └── raw.dart │ │ ├── motivation.mdx │ │ ├── override │ │ │ ├── index.tsx │ │ │ └── raw.dart │ │ ├── same_type │ │ │ ├── index.tsx │ │ │ ├── raw.dart │ │ │ ├── same_type.dart │ │ │ └── same_type.g.dart │ │ └── side_effects │ │ │ ├── index.tsx │ │ │ └── raw.dart │ ├── provider_vs_riverpod.mdx │ └── quickstart.mdx ├── introduction │ ├── getting_started.mdx │ ├── getting_started │ │ ├── dart_hello_world │ │ │ ├── index.tsx │ │ │ ├── main.dart │ │ │ ├── main.g.dart │ │ │ └── raw.dart │ │ ├── dart_pub_add.tsx │ │ ├── dart_pubspec.tsx │ │ ├── hello_world │ │ │ ├── hooks_codegen │ │ │ │ ├── main.dart │ │ │ │ └── main.g.dart │ │ │ ├── index.tsx │ │ │ ├── main.dart │ │ │ ├── main.g.dart │ │ │ ├── raw.dart │ │ │ └── raw_hooks.dart │ │ ├── pub_add.tsx │ │ └── pubspec.tsx │ ├── why_riverpod.mdx │ └── why_riverpod │ │ ├── codegen.dart │ │ ├── codegen.g.dart │ │ ├── index.tsx │ │ └── raw.dart ├── migration │ ├── 0.13.0_to_0.14.0.mdx │ ├── 0.14.0_to_1.0.0.mdx │ ├── from_change_notifier.mdx │ ├── from_change_notifier │ │ ├── declaration │ │ │ ├── declaration.dart │ │ │ ├── declaration.g.dart │ │ │ ├── index.tsx │ │ │ └── raw.dart │ │ ├── initialization │ │ │ ├── index.tsx │ │ │ ├── initialization.dart │ │ │ ├── initialization.g.dart │ │ │ └── raw.dart │ │ ├── migrated │ │ │ ├── index.tsx │ │ │ ├── migrated.dart │ │ │ ├── migrated.g.dart │ │ │ └── raw.dart │ │ └── old.dart │ ├── from_state_notifier.mdx │ ├── from_state_notifier │ │ ├── add_listener │ │ │ ├── add_listener.dart │ │ │ ├── add_listener.g.dart │ │ │ ├── index.tsx │ │ │ └── raw.dart │ │ ├── add_listener_old.dart │ │ ├── async_notifier │ │ │ ├── async_notifier.dart │ │ │ ├── async_notifier.g.dart │ │ │ ├── index.tsx │ │ │ └── raw.dart │ │ ├── async_notifier_old.dart │ │ ├── build_init │ │ │ ├── build_init.dart │ │ │ ├── build_init.g.dart │ │ │ ├── index.tsx │ │ │ └── raw.dart │ │ ├── build_init_old.dart │ │ ├── consumers_dont_change.dart │ │ ├── family_and_dispose │ │ │ ├── family_and_dispose.dart │ │ │ ├── family_and_dispose.g.dart │ │ │ ├── index.tsx │ │ │ └── raw.dart │ │ ├── family_and_dispose_old.dart │ │ ├── from_state_provider │ │ │ ├── from_state_provider.dart │ │ │ ├── from_state_provider.g.dart │ │ │ ├── index.tsx │ │ │ └── raw.dart │ │ ├── from_state_provider_old.dart │ │ ├── obtain_notifier_on_tests.dart │ │ ├── old_lifecycles │ │ │ ├── index.tsx │ │ │ ├── old_lifecycles.dart │ │ │ ├── old_lifecycles.g.dart │ │ │ └── raw.dart │ │ ├── old_lifecycles_final │ │ │ ├── index.tsx │ │ │ ├── old_lifecycles_final.dart │ │ │ ├── old_lifecycles_final.g.dart │ │ │ └── raw.dart │ │ └── old_lifecycles_old.dart │ └── utils.dart ├── providers │ ├── change_notifier_provider.mdx │ ├── change_notifier_provider │ │ ├── todos.dart │ │ └── todos_consumer.dart │ ├── future_provider.mdx │ ├── future_provider │ │ ├── config_consumer │ │ │ ├── codegen.dart │ │ │ ├── hooks.dart │ │ │ ├── hooks_codegen.dart │ │ │ ├── index.tsx │ │ │ └── raw.dart │ │ └── config_provider │ │ │ ├── codegen.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.tsx │ │ │ └── raw.dart │ ├── notifier_provider.mdx │ ├── notifier_provider │ │ ├── remote_todos │ │ │ ├── codegen.dart │ │ │ ├── codegen.freezed.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.tsx │ │ │ ├── raw.dart │ │ │ └── todos_consumer.dart │ │ └── todos │ │ │ ├── codegen.dart │ │ │ ├── codegen.freezed.dart │ │ │ ├── codegen.g.dart │ │ │ ├── index.tsx │ │ │ ├── raw.dart │ │ │ └── todos_consumer.dart │ ├── provider.mdx │ ├── provider │ │ ├── completed_todos │ │ │ ├── completed_todos.dart │ │ │ ├── completed_todos.g.dart │ │ │ ├── index.tsx │ │ │ └── raw.dart │ │ ├── optimized_previous_button │ │ │ ├── index.tsx │ │ │ ├── optimized_previous_button.dart │ │ │ ├── optimized_previous_button.g.dart │ │ │ └── raw.dart │ │ ├── todo │ │ │ ├── index.tsx │ │ │ ├── raw.dart │ │ │ ├── todo.dart │ │ │ └── todo.g.dart │ │ ├── todos_consumer.dart │ │ └── unoptimized_previous_button │ │ │ ├── index.tsx │ │ │ ├── raw.dart │ │ │ ├── unoptimized_previous_button.dart │ │ │ └── unoptimized_previous_button.g.dart │ ├── state_notifier_provider.mdx │ ├── state_notifier_provider │ │ ├── todos.dart │ │ └── todos_consumer.dart │ ├── state_provider.mdx │ ├── state_provider │ │ ├── connected_dropdown.dart │ │ ├── dartpad_metadata.yaml │ │ ├── dropdown.dart │ │ ├── full.dart │ │ ├── product.dart │ │ ├── product_list_view.dart │ │ ├── sort_provider.dart │ │ ├── sorted_product_provider.dart │ │ ├── update_read_once.dart │ │ └── update_read_twice.dart │ ├── stream_provider.mdx │ └── stream_provider │ │ ├── live_stream_chat_consumer.dart │ │ ├── live_stream_chat_provider.dart │ │ └── live_stream_chat_provider │ │ ├── codegen.dart │ │ ├── codegen.g.dart │ │ ├── index.tsx │ │ └── raw.dart ├── whats_new.mdx └── whats_new │ └── offline │ └── raw.dart ├── docusaurus.config.js ├── i18n ├── bn │ ├── code.json │ ├── docusaurus-plugin-content-docs │ │ ├── current.json │ │ └── current │ │ │ ├── concepts │ │ │ ├── combining_providers.mdx │ │ │ ├── modifiers │ │ │ │ ├── auto_dispose.mdx │ │ │ │ └── family.mdx │ │ │ ├── provider_observer.mdx │ │ │ ├── providers.mdx │ │ │ ├── reading.mdx │ │ │ ├── reading_consumer_hook.dart │ │ │ ├── reading_consumer_hook_widget.dart │ │ │ ├── reading_consumer_stateful_widget.dart │ │ │ ├── reading_consumer_widget.dart │ │ │ ├── reading_counter.dart │ │ │ ├── reading_listen.dart │ │ │ ├── reading_listen_build.dart │ │ │ ├── reading_read.dart │ │ │ ├── reading_read_build.dart │ │ │ ├── reading_read_notifier_build.dart │ │ │ ├── reading_watch.dart │ │ │ ├── reading_watch_build.dart │ │ │ └── reading_watch_notifier_build.dart │ │ │ ├── cookbooks │ │ │ ├── refresh.mdx │ │ │ ├── search_as_we_type.mdx │ │ │ └── testing.mdx │ │ │ ├── getting_started.mdx │ │ │ ├── getting_started_hello_world_dart.dart │ │ │ ├── getting_started_hello_world_flutter.dart │ │ │ ├── getting_started_hello_world_hooks.dart │ │ │ ├── migration │ │ │ ├── 0.13.0_to_0.14.0.mdx │ │ │ └── 0.14.0_to_1.0.0.mdx │ │ │ └── providers │ │ │ ├── future_provider.mdx │ │ │ ├── future_provider │ │ │ ├── config_consumer.dart │ │ │ └── config_provider.dart │ │ │ ├── provider.mdx │ │ │ ├── provider │ │ │ ├── completed_todos.dart │ │ │ ├── optimized_previous_button.dart │ │ │ ├── todo.dart │ │ │ └── unoptimized_previous_button.dart │ │ │ ├── state_notifier_provider.mdx │ │ │ ├── state_provider.mdx │ │ │ ├── state_provider │ │ │ ├── dartpad_metadata.yaml │ │ │ └── full.dart │ │ │ └── stream_provider.mdx │ └── docusaurus-theme-classic │ │ ├── footer.json │ │ └── navbar.json ├── de │ ├── code.json │ ├── docusaurus-plugin-content-blog │ │ └── options.json │ ├── docusaurus-plugin-content-docs │ │ ├── current.json │ │ └── current │ │ │ ├── concepts │ │ │ ├── combining_providers.mdx │ │ │ ├── modifiers │ │ │ │ ├── auto_dispose.mdx │ │ │ │ └── family.mdx │ │ │ ├── provider_observer.mdx │ │ │ ├── provider_observer_logger.dart │ │ │ ├── providers.mdx │ │ │ ├── reading.mdx │ │ │ ├── reading_consumer_hook.dart │ │ │ ├── reading_consumer_hook_widget.dart │ │ │ ├── reading_consumer_stateful_widget.dart │ │ │ ├── reading_consumer_widget.dart │ │ │ ├── reading_counter.dart │ │ │ ├── reading_listen.dart │ │ │ ├── reading_listen_build.dart │ │ │ ├── reading_read.dart │ │ │ ├── reading_read_build.dart │ │ │ ├── reading_read_notifier_build.dart │ │ │ ├── reading_watch.dart │ │ │ ├── reading_watch_build.dart │ │ │ └── reading_watch_notifier_build.dart │ │ │ ├── cookbooks │ │ │ ├── refresh.mdx │ │ │ ├── search_as_we_type.mdx │ │ │ ├── testing.mdx │ │ │ ├── testing_dart.dart │ │ │ ├── testing_flutter.dart │ │ │ ├── testing_full.dart │ │ │ ├── testing_original_test_dart.dart │ │ │ ├── testing_original_test_flutter.dart │ │ │ ├── testing_override_info.dart │ │ │ └── testing_repository.dart │ │ │ ├── getting_started.mdx │ │ │ ├── getting_started_hello_world_dart.dart │ │ │ ├── getting_started_hello_world_flutter.dart │ │ │ ├── getting_started_hello_world_hooks.dart │ │ │ ├── migration │ │ │ ├── 0.13.0_to_0.14.0.mdx │ │ │ └── 0.14.0_to_1.0.0.mdx │ │ │ └── providers │ │ │ ├── future_provider.mdx │ │ │ ├── future_provider │ │ │ ├── config_consumer.dart │ │ │ └── config_provider.dart │ │ │ ├── provider.mdx │ │ │ ├── provider │ │ │ ├── completed_todos.dart │ │ │ ├── optimized_previous_button.dart │ │ │ ├── todo.dart │ │ │ └── unoptimized_previous_button.dart │ │ │ ├── state_notifier_provider.mdx │ │ │ ├── state_notifier_provider │ │ │ ├── todos.dart │ │ │ └── todos_consumer.dart │ │ │ ├── state_provider.mdx │ │ │ └── state_provider │ │ │ ├── connected_dropdown.dart │ │ │ ├── dartpad_metadata.yaml │ │ │ ├── dropdown.dart │ │ │ ├── full.dart │ │ │ ├── product.dart │ │ │ ├── product_list_view.dart │ │ │ ├── sort_provider.dart │ │ │ ├── sorted_product_provider.dart │ │ │ ├── update_read_once.dart │ │ │ └── update_read_twice.dart │ └── docusaurus-theme-classic │ │ ├── footer.json │ │ └── navbar.json ├── es │ ├── code.json │ ├── docusaurus-plugin-content-docs │ │ ├── current.json │ │ └── current │ │ │ ├── concepts │ │ │ ├── combining_providers.mdx │ │ │ ├── modifiers │ │ │ │ ├── auto_dispose.mdx │ │ │ │ └── family.mdx │ │ │ ├── provider_observer.mdx │ │ │ ├── providers.mdx │ │ │ └── reading.mdx │ │ │ ├── cookbooks │ │ │ └── testing.mdx │ │ │ ├── getting_started.mdx │ │ │ ├── migration │ │ │ ├── 0.13.0_to_0.14.0.mdx │ │ │ └── 0.14.0_to_1.0.0.mdx │ │ │ └── providers │ │ │ ├── future_provider.mdx │ │ │ ├── future_provider │ │ │ ├── config_consumer.dart │ │ │ └── config_provider.dart │ │ │ ├── provider.mdx │ │ │ ├── provider │ │ │ ├── completed_todos.dart │ │ │ ├── optimized_previous_button.dart │ │ │ ├── todo.dart │ │ │ └── unoptimized_previous_button.dart │ │ │ ├── state_notifier_provider.mdx │ │ │ ├── state_notifier_provider │ │ │ ├── todos.dart │ │ │ └── todos_consumer.dart │ │ │ ├── state_provider.mdx │ │ │ ├── state_provider │ │ │ ├── connected_dropdown.dart │ │ │ ├── dartpad_metadata.yaml │ │ │ ├── dropdown.dart │ │ │ ├── full.dart │ │ │ ├── product.dart │ │ │ ├── product_list_view.dart │ │ │ ├── sort_provider.dart │ │ │ ├── sorted_product_provider.dart │ │ │ ├── update_read_once.dart │ │ │ └── update_read_twice.dart │ │ │ └── stream_provider.mdx │ └── docusaurus-theme-classic │ │ ├── footer.json │ │ └── navbar.json ├── fr │ ├── code.json │ ├── docusaurus-plugin-content-docs │ │ ├── current.json │ │ └── current │ │ │ ├── about_code_generation.mdx │ │ │ ├── about_codegen │ │ │ ├── main.dart │ │ │ └── raw.dart │ │ │ ├── about_hooks.mdx │ │ │ ├── concepts │ │ │ ├── async_initialization.dart │ │ │ ├── combining_providers.mdx │ │ │ ├── lifecycle_on_dispose.dart │ │ │ ├── modifiers │ │ │ │ ├── auto_dispose.mdx │ │ │ │ └── family.mdx │ │ │ ├── provider_lifecycles.mdx │ │ │ ├── provider_observer.mdx │ │ │ ├── provider_observer_logger.dart │ │ │ ├── providers.mdx │ │ │ ├── reading.mdx │ │ │ ├── reading_consumer_hook.dart │ │ │ ├── reading_consumer_hook_widget.dart │ │ │ ├── reading_consumer_stateful_widget.dart │ │ │ ├── reading_consumer_widget.dart │ │ │ ├── reading_counter.dart │ │ │ ├── reading_listen.dart │ │ │ ├── reading_listen_build.dart │ │ │ ├── reading_read.dart │ │ │ ├── reading_read_build.dart │ │ │ ├── reading_read_notifier_build.dart │ │ │ ├── reading_stateful_hook_consumer_widget.dart │ │ │ ├── reading_watch.dart │ │ │ ├── reading_watch_build.dart │ │ │ ├── reading_watch_notifier_build.dart │ │ │ ├── scopes.mdx │ │ │ ├── subtree_scope.dart │ │ │ ├── theme_scope.dart │ │ │ └── why_immutability.mdx │ │ │ ├── cookbooks │ │ │ ├── refresh.mdx │ │ │ ├── search_as_we_type.mdx │ │ │ ├── testing.mdx │ │ │ ├── testing_dart.dart │ │ │ ├── testing_flutter.dart │ │ │ ├── testing_full.dart │ │ │ ├── testing_original_test_dart.dart │ │ │ ├── testing_original_test_flutter.dart │ │ │ ├── testing_override_info.dart │ │ │ └── testing_repository.dart │ │ │ ├── getting_started.mdx │ │ │ ├── getting_started │ │ │ ├── dart_hello_world │ │ │ │ ├── index.tsx │ │ │ │ ├── main.dart │ │ │ │ └── raw.dart │ │ │ ├── dart_pubspec │ │ │ │ ├── codegen.yaml │ │ │ │ ├── index.tsx │ │ │ │ └── raw.yaml │ │ │ ├── hello_world │ │ │ │ ├── index.tsx │ │ │ │ ├── main.dart │ │ │ │ └── raw.dart │ │ │ └── pubspec │ │ │ │ ├── codegen.yaml │ │ │ │ ├── hooks.yaml │ │ │ │ ├── hooks_codegen.yaml │ │ │ │ ├── index.tsx │ │ │ │ └── raw.yaml │ │ │ ├── getting_started_hello_world_dart.dart │ │ │ ├── getting_started_hello_world_flutter.dart │ │ │ ├── getting_started_hello_world_hooks.dart │ │ │ ├── introduction.mdx │ │ │ ├── migration │ │ │ ├── 0.13.0_to_0.14.0.mdx │ │ │ └── 0.14.0_to_1.0.0.mdx │ │ │ ├── providers │ │ │ ├── change_notifier_provider.mdx │ │ │ ├── change_notifier_provider │ │ │ │ ├── todos.dart │ │ │ │ └── todos_consumer.dart │ │ │ ├── future_provider.mdx │ │ │ ├── future_provider │ │ │ │ ├── config_consumer.dart │ │ │ │ └── config_provider.dart │ │ │ ├── notifier_provider.mdx │ │ │ ├── provider.mdx │ │ │ ├── provider │ │ │ │ ├── completed_todos.dart │ │ │ │ ├── optimized_previous_button.dart │ │ │ │ ├── todo.dart │ │ │ │ ├── todos_consumer.dart │ │ │ │ └── unoptimized_previous_button.dart │ │ │ ├── state_notifier_provider.mdx │ │ │ ├── state_notifier_provider │ │ │ │ ├── todos.dart │ │ │ │ └── todos_consumer.dart │ │ │ ├── state_provider.mdx │ │ │ ├── state_provider │ │ │ │ ├── connected_dropdown.dart │ │ │ │ ├── dartpad_metadata.yaml │ │ │ │ ├── dropdown.dart │ │ │ │ ├── full.dart │ │ │ │ ├── product.dart │ │ │ │ ├── product_list_view.dart │ │ │ │ ├── sort_provider.dart │ │ │ │ ├── sorted_product_provider.dart │ │ │ │ ├── update_read_once.dart │ │ │ │ └── update_read_twice.dart │ │ │ └── stream_provider.mdx │ │ │ └── riverpod_for_provider_users.mdx │ └── docusaurus-theme-classic │ │ ├── footer.json │ │ └── navbar.json ├── it │ ├── code.json │ ├── docusaurus-plugin-content-docs │ │ ├── current.json │ │ └── current │ │ │ ├── advanced │ │ │ └── select.mdx │ │ │ ├── case_studies │ │ │ ├── cancel.mdx │ │ │ ├── cancel │ │ │ │ ├── extension.dart │ │ │ │ └── home_screen.dart │ │ │ └── pull_to_refresh.mdx │ │ │ ├── concepts │ │ │ ├── about_code_generation.mdx │ │ │ ├── about_hooks.mdx │ │ │ ├── async_initialization.dart │ │ │ ├── combining_providers.mdx │ │ │ ├── modifiers │ │ │ │ ├── auto_dispose.mdx │ │ │ │ └── family.mdx │ │ │ ├── provider_lifecycles.mdx │ │ │ ├── provider_observer.mdx │ │ │ ├── provider_observer_logger.dart │ │ │ ├── providers.mdx │ │ │ ├── reading.mdx │ │ │ ├── reading │ │ │ │ └── consumer_hook.dart │ │ │ ├── scopes.mdx │ │ │ ├── subtree_scope.dart │ │ │ ├── theme_scope.dart │ │ │ └── why_immutability.mdx │ │ │ ├── cookbooks │ │ │ ├── search_as_we_type.mdx │ │ │ ├── testing.mdx │ │ │ ├── testing_dart.dart │ │ │ ├── testing_flutter.dart │ │ │ ├── testing_full.dart │ │ │ ├── testing_original_test_dart.dart │ │ │ ├── testing_original_test_flutter.dart │ │ │ ├── testing_override_info.dart │ │ │ └── testing_repository.dart │ │ │ ├── essentials │ │ │ ├── auto_dispose.mdx │ │ │ ├── combining_requests.mdx │ │ │ ├── do_dont.mdx │ │ │ ├── eager_initialization.mdx │ │ │ ├── faq.mdx │ │ │ ├── first_request.mdx │ │ │ ├── first_request │ │ │ │ ├── activity.ts │ │ │ │ ├── codegen │ │ │ │ │ ├── activity.dart │ │ │ │ │ └── provider.dart │ │ │ │ ├── consumer.ts │ │ │ │ ├── consumer_stateful_widget.ts │ │ │ │ ├── consumer_widget.ts │ │ │ │ ├── hook_consumer_widget.ts │ │ │ │ ├── legend │ │ │ │ │ ├── DocuCode.scss │ │ │ │ │ └── legend.tsx │ │ │ │ ├── provider.ts │ │ │ │ └── raw │ │ │ │ │ ├── activity.dart │ │ │ │ │ ├── consumer.dart │ │ │ │ │ ├── consumer_stateful_widget.dart │ │ │ │ │ ├── consumer_widget.dart │ │ │ │ │ ├── hook_consumer_widget.dart │ │ │ │ │ └── provider.dart │ │ │ ├── passing_args.mdx │ │ │ ├── passing_args │ │ │ │ ├── codegen │ │ │ │ │ ├── family.dart │ │ │ │ │ └── provider.dart │ │ │ │ ├── no_arg_provider.ts │ │ │ │ └── raw │ │ │ │ │ ├── family.dart │ │ │ │ │ └── provider.dart │ │ │ ├── provider_observer.mdx │ │ │ ├── side_effects.mdx │ │ │ ├── side_effects │ │ │ │ ├── codegen │ │ │ │ │ ├── todo_list_notifier.dart │ │ │ │ │ ├── todo_list_notifier_add_todo.dart │ │ │ │ │ └── todo_list_provider.dart │ │ │ │ ├── raw │ │ │ │ │ ├── render_add_todo.dart │ │ │ │ │ ├── render_add_todo_hooks.dart │ │ │ │ │ ├── todo_list_notifier.dart │ │ │ │ │ ├── todo_list_notifier_add_todo.dart │ │ │ │ │ └── todo_list_provider.dart │ │ │ │ ├── render_add_todo.ts │ │ │ │ ├── todo_list_notifier.ts │ │ │ │ ├── todo_list_notifier_add_todo.ts │ │ │ │ └── todo_list_provider.ts │ │ │ ├── testing.mdx │ │ │ └── websockets_sync.mdx │ │ │ ├── from_provider │ │ │ ├── helpers │ │ │ │ ├── item.dart │ │ │ │ └── json.dart │ │ │ ├── motivation │ │ │ │ └── motivation.mdx │ │ │ ├── provider_vs_riverpod.mdx │ │ │ └── quickstart.mdx │ │ │ ├── introduction │ │ │ ├── getting_started.mdx │ │ │ ├── getting_started │ │ │ │ ├── dart_pub_add.tsx │ │ │ │ ├── dart_pubspec.tsx │ │ │ │ ├── pub_add.tsx │ │ │ │ └── pubspec.tsx │ │ │ └── why_riverpod.mdx │ │ │ ├── migration │ │ │ ├── 0.13.0_to_0.14.0.mdx │ │ │ ├── 0.14.0_to_1.0.0.mdx │ │ │ ├── from_change_notifier.mdx │ │ │ ├── from_state_notifier.mdx │ │ │ └── utils.dart │ │ │ └── providers │ │ │ ├── change_notifier_provider.mdx │ │ │ ├── change_notifier_provider │ │ │ ├── todos.dart │ │ │ └── todos_consumer.dart │ │ │ ├── future_provider.mdx │ │ │ ├── notifier_provider.mdx │ │ │ ├── provider.mdx │ │ │ ├── provider │ │ │ └── todos_consumer.dart │ │ │ ├── state_notifier_provider.mdx │ │ │ ├── state_notifier_provider │ │ │ ├── todos.dart │ │ │ └── todos_consumer.dart │ │ │ ├── state_provider.mdx │ │ │ ├── state_provider │ │ │ ├── connected_dropdown.dart │ │ │ ├── dartpad_metadata.yaml │ │ │ ├── dropdown.dart │ │ │ ├── full.dart │ │ │ ├── product.dart │ │ │ ├── product_list_view.dart │ │ │ ├── sort_provider.dart │ │ │ ├── sorted_product_provider.dart │ │ │ ├── update_read_once.dart │ │ │ └── update_read_twice.dart │ │ │ ├── stream_provider.mdx │ │ │ └── stream_provider │ │ │ ├── live_stream_chat_consumer.dart │ │ │ └── live_stream_chat_provider.dart │ └── docusaurus-theme-classic │ │ ├── footer.json │ │ └── navbar.json ├── ja │ ├── code.json │ ├── docusaurus-plugin-content-docs │ │ ├── current.json │ │ └── current │ │ │ ├── Introduction │ │ │ ├── getting_started.mdx │ │ │ └── why_riverpod.mdx │ │ │ ├── about_code_generation.mdx │ │ │ ├── about_codegen │ │ │ ├── main.dart │ │ │ └── raw.dart │ │ │ ├── advanced │ │ │ └── select.mdx │ │ │ ├── case_studies │ │ │ ├── cancel.mdx │ │ │ └── pull_to_refresh.mdx │ │ │ ├── concepts │ │ │ ├── about_code_generation.mdx │ │ │ ├── about_hooks.mdx │ │ │ ├── combining_providers.mdx │ │ │ ├── modifiers │ │ │ │ ├── auto_dispose.mdx │ │ │ │ └── family.mdx │ │ │ ├── provider_observer.mdx │ │ │ ├── provider_observer_logger.dart │ │ │ ├── providers.mdx │ │ │ ├── reading.mdx │ │ │ ├── reading_consumer_hook.dart │ │ │ ├── reading_consumer_hook_widget.dart │ │ │ ├── reading_consumer_stateful_widget.dart │ │ │ ├── reading_consumer_widget.dart │ │ │ ├── reading_counter.dart │ │ │ ├── reading_listen.dart │ │ │ ├── reading_listen_build.dart │ │ │ ├── reading_read.dart │ │ │ ├── reading_read_build.dart │ │ │ ├── reading_read_notifier_build.dart │ │ │ ├── reading_stateful_hook_consumer_widget.dart │ │ │ ├── reading_watch.dart │ │ │ ├── reading_watch_build.dart │ │ │ ├── reading_watch_notifier_build.dart │ │ │ └── why_immutability.mdx │ │ │ ├── cookbooks │ │ │ ├── testing.mdx │ │ │ ├── testing_dart.dart │ │ │ ├── testing_flutter.dart │ │ │ ├── testing_full.dart │ │ │ ├── testing_original_test_dart.dart │ │ │ ├── testing_original_test_flutter.dart │ │ │ ├── testing_override_info.dart │ │ │ └── testing_repository.dart │ │ │ ├── essentials │ │ │ ├── auto_dispose.mdx │ │ │ ├── combining_requests.mdx │ │ │ ├── do_dont.mdx │ │ │ ├── eager_initialization.mdx │ │ │ ├── faq.mdx │ │ │ ├── first_request.mdx │ │ │ ├── passing_args.mdx │ │ │ ├── provider_observer.mdx │ │ │ ├── side_effects.mdx │ │ │ ├── testing.mdx │ │ │ └── websockets_sync.mdx │ │ │ ├── from_provider │ │ │ ├── motivation │ │ │ │ └── motivation.mdx │ │ │ ├── provider_vs_riverpod.mdx │ │ │ └── quickstart.mdx │ │ │ ├── getting_started.mdx │ │ │ ├── getting_started │ │ │ ├── dart_hello_world │ │ │ │ ├── index.tsx │ │ │ │ ├── main.dart │ │ │ │ └── raw.dart │ │ │ ├── dart_pubspec │ │ │ │ ├── codegen.yaml │ │ │ │ ├── index.tsx │ │ │ │ └── raw.yaml │ │ │ ├── hello_world │ │ │ │ ├── index.tsx │ │ │ │ ├── main.dart │ │ │ │ └── raw.dart │ │ │ └── pubspec │ │ │ │ ├── codegen.yaml │ │ │ │ ├── hooks.yaml │ │ │ │ ├── hooks_codegen.yaml │ │ │ │ ├── index.tsx │ │ │ │ └── raw.yaml │ │ │ ├── introduction.mdx │ │ │ ├── migration │ │ │ ├── 0.13.0_to_0.14.0.mdx │ │ │ └── 0.14.0_to_1.0.0.mdx │ │ │ └── providers │ │ │ ├── change_notifier_provider.mdx │ │ │ ├── change_notifier_provider │ │ │ ├── todos.dart │ │ │ └── todos_consumer.dart │ │ │ ├── future_provider.mdx │ │ │ ├── future_provider │ │ │ ├── config_consumer.dart │ │ │ └── config_provider.dart │ │ │ ├── provider.mdx │ │ │ ├── provider │ │ │ ├── completed_todos.dart │ │ │ ├── optimized_previous_button.dart │ │ │ ├── todo.dart │ │ │ ├── todos_consumer.dart │ │ │ └── unoptimized_previous_button.dart │ │ │ ├── state_notifier_provider.mdx │ │ │ ├── state_notifier_provider │ │ │ ├── todos.dart │ │ │ └── todos_consumer.dart │ │ │ ├── state_provider.mdx │ │ │ ├── state_provider │ │ │ ├── connected_dropdown.dart │ │ │ ├── dartpad_metadata.yaml │ │ │ ├── dropdown.dart │ │ │ ├── full.dart │ │ │ ├── product.dart │ │ │ ├── product_list_view.dart │ │ │ ├── sort_provider.dart │ │ │ ├── sorted_product_provider.dart │ │ │ ├── update_read_once.dart │ │ │ └── update_read_twice.dart │ │ │ └── stream_provider.mdx │ └── docusaurus-theme-classic │ │ ├── footer.json │ │ └── navbar.json ├── ko │ ├── NOTE.md │ ├── code.json │ ├── docusaurus-plugin-content-blog │ │ └── options.json │ ├── docusaurus-plugin-content-docs │ │ ├── current.json │ │ └── current │ │ │ ├── advanced │ │ │ └── select.mdx │ │ │ ├── case_studies │ │ │ ├── cancel.mdx │ │ │ └── pull_to_refresh.mdx │ │ │ ├── concepts │ │ │ ├── about_code_generation.mdx │ │ │ ├── about_hooks.mdx │ │ │ ├── async_initialization.dart │ │ │ ├── combining_providers.mdx │ │ │ ├── modifiers │ │ │ │ ├── auto_dispose.mdx │ │ │ │ └── family.mdx │ │ │ ├── provider_lifecycles.mdx │ │ │ ├── provider_observer.mdx │ │ │ ├── provider_observer_logger.dart │ │ │ ├── providers.mdx │ │ │ ├── reading.mdx │ │ │ ├── reading │ │ │ │ └── consumer_hook.dart │ │ │ ├── scopes.mdx │ │ │ ├── subtree_scope.dart │ │ │ ├── theme_scope.dart │ │ │ └── why_immutability.mdx │ │ │ ├── cookbooks │ │ │ ├── search_as_we_type.mdx │ │ │ ├── testing.mdx │ │ │ ├── testing_dart.dart │ │ │ ├── testing_flutter.dart │ │ │ ├── testing_full.dart │ │ │ ├── testing_original_test_dart.dart │ │ │ ├── testing_original_test_flutter.dart │ │ │ ├── testing_override_info.dart │ │ │ └── testing_repository.dart │ │ │ ├── essentials │ │ │ ├── auto_dispose.mdx │ │ │ ├── combining_requests.mdx │ │ │ ├── do_dont.mdx │ │ │ ├── eager_initialization.mdx │ │ │ ├── faq.mdx │ │ │ ├── first_request.mdx │ │ │ ├── passing_args.mdx │ │ │ ├── provider_observer.mdx │ │ │ ├── side_effects.mdx │ │ │ ├── testing.mdx │ │ │ └── websockets_sync.mdx │ │ │ ├── from_provider │ │ │ ├── motivation │ │ │ │ └── motivation.mdx │ │ │ ├── provider_vs_riverpod.mdx │ │ │ └── quickstart.mdx │ │ │ ├── introduction │ │ │ ├── getting_started.mdx │ │ │ └── why_riverpod.mdx │ │ │ ├── migration │ │ │ ├── 0.13.0_to_0.14.0.mdx │ │ │ ├── 0.14.0_to_1.0.0.mdx │ │ │ ├── from_change_notifier.mdx │ │ │ ├── from_state_notifier.mdx │ │ │ └── utils.dart │ │ │ └── providers │ │ │ ├── change_notifier_provider.mdx │ │ │ ├── change_notifier_provider │ │ │ ├── todos.dart │ │ │ └── todos_consumer.dart │ │ │ ├── future_provider.mdx │ │ │ ├── notifier_provider.mdx │ │ │ ├── provider.mdx │ │ │ ├── provider │ │ │ └── todos_consumer.dart │ │ │ ├── state_notifier_provider.mdx │ │ │ ├── state_notifier_provider │ │ │ ├── todos.dart │ │ │ └── todos_consumer.dart │ │ │ ├── state_provider.mdx │ │ │ ├── state_provider │ │ │ ├── connected_dropdown.dart │ │ │ ├── dartpad_metadata.yaml │ │ │ ├── dropdown.dart │ │ │ ├── full.dart │ │ │ ├── product.dart │ │ │ ├── product_list_view.dart │ │ │ ├── sort_provider.dart │ │ │ ├── sorted_product_provider.dart │ │ │ ├── update_read_once.dart │ │ │ └── update_read_twice.dart │ │ │ ├── stream_provider.mdx │ │ │ └── stream_provider │ │ │ ├── live_stream_chat_consumer.dart │ │ │ └── live_stream_chat_provider.dart │ └── docusaurus-theme-classic │ │ ├── footer.json │ │ └── navbar.json ├── ru │ ├── code.json │ ├── docusaurus-plugin-content-blog │ │ └── options.json │ ├── docusaurus-plugin-content-docs │ │ ├── current.json │ │ └── current │ │ │ ├── concepts │ │ │ ├── combining_providers.mdx │ │ │ ├── modifiers │ │ │ │ ├── auto_dispose.mdx │ │ │ │ └── family.mdx │ │ │ ├── provider_observer.mdx │ │ │ ├── providers.mdx │ │ │ ├── reading.mdx │ │ │ ├── reading_consumer_hook.dart │ │ │ ├── reading_consumer_hook_widget.dart │ │ │ ├── reading_consumer_stateful_widget.dart │ │ │ ├── reading_consumer_widget.dart │ │ │ ├── reading_counter.dart │ │ │ ├── reading_listen.dart │ │ │ ├── reading_listen_build.dart │ │ │ ├── reading_read.dart │ │ │ ├── reading_read_build.dart │ │ │ ├── reading_read_notifier_build.dart │ │ │ ├── reading_stateful_hook_consumer_widget.dart │ │ │ ├── reading_watch.dart │ │ │ ├── reading_watch_build.dart │ │ │ └── reading_watch_notifier_build.dart │ │ │ ├── cookbooks │ │ │ ├── refresh.mdx │ │ │ ├── search_as_we_type.mdx │ │ │ └── testing.mdx │ │ │ ├── getting_started.mdx │ │ │ ├── getting_started_hello_world_dart.dart │ │ │ ├── getting_started_hello_world_flutter.dart │ │ │ ├── getting_started_hello_world_hooks.dart │ │ │ ├── migration │ │ │ ├── 0.13.0_to_0.14.0.mdx │ │ │ └── 0.14.0_to_1.0.0.mdx │ │ │ └── providers │ │ │ ├── change_notifier_provider.mdx │ │ │ ├── future_provider.mdx │ │ │ ├── future_provider │ │ │ ├── config_consumer.dart │ │ │ └── config_provider.dart │ │ │ ├── provider.mdx │ │ │ ├── provider │ │ │ ├── completed_todos.dart │ │ │ ├── optimized_previous_button.dart │ │ │ ├── todo.dart │ │ │ └── unoptimized_previous_button.dart │ │ │ ├── state_notifier_provider.mdx │ │ │ ├── state_provider.mdx │ │ │ ├── state_provider │ │ │ ├── dartpad_metadata.yaml │ │ │ └── full.dart │ │ │ └── stream_provider.mdx │ └── docusaurus-theme-classic │ │ ├── footer.json │ │ └── navbar.json ├── tr │ ├── code.json │ ├── docusaurus-plugin-content-docs │ │ ├── current.json │ │ └── current │ │ │ ├── concepts │ │ │ ├── combining_providers.mdx │ │ │ ├── modifiers │ │ │ │ ├── auto_dispose.mdx │ │ │ │ └── family.mdx │ │ │ ├── provider_observer.mdx │ │ │ ├── providers.mdx │ │ │ └── reading.mdx │ │ │ ├── cookbooks │ │ │ └── testing.mdx │ │ │ ├── getting_started.mdx │ │ │ ├── migration │ │ │ ├── 0.13.0_to_0.14.0.mdx │ │ │ └── 0.14.0_to_1.0.0.mdx │ │ │ └── providers │ │ │ ├── future_provider.mdx │ │ │ ├── future_provider │ │ │ ├── config_consumer.dart │ │ │ └── config_provider.dart │ │ │ ├── provider.mdx │ │ │ ├── provider │ │ │ ├── completed_todos.dart │ │ │ ├── optimized_previous_button.dart │ │ │ ├── todo.dart │ │ │ └── unoptimized_previous_button.dart │ │ │ ├── state_notifier_provider.mdx │ │ │ ├── state_notifier_provider │ │ │ ├── todos.dart │ │ │ └── todos_consumer.dart │ │ │ ├── state_provider.mdx │ │ │ ├── state_provider │ │ │ ├── connected_dropdown.dart │ │ │ ├── dartpad_metadata.yaml │ │ │ ├── dropdown.dart │ │ │ ├── full.dart │ │ │ ├── product.dart │ │ │ ├── product_list_view.dart │ │ │ ├── sort_provider.dart │ │ │ ├── sorted_product_provider.dart │ │ │ ├── update_read_once.dart │ │ │ └── update_read_twice.dart │ │ │ └── stream_provider.mdx │ └── docusaurus-theme-classic │ │ ├── footer.json │ │ └── navbar.json └── zh-Hans │ ├── code.json │ ├── docusaurus-plugin-content-blog │ └── options.json │ ├── docusaurus-plugin-content-docs │ ├── current.json │ └── current │ │ ├── advanced │ │ └── select.mdx │ │ ├── case_studies │ │ ├── cancel.mdx │ │ ├── cancel │ │ │ ├── extension.dart │ │ │ └── home_screen.dart │ │ └── pull_to_refresh.mdx │ │ ├── concepts │ │ ├── about_code_generation.mdx │ │ ├── about_hooks.mdx │ │ ├── async_initialization.dart │ │ ├── combining_providers.mdx │ │ ├── modifiers │ │ │ ├── auto_dispose.mdx │ │ │ └── family.mdx │ │ ├── provider_lifecycles.mdx │ │ ├── provider_observer.mdx │ │ ├── provider_observer_logger.dart │ │ ├── providers.mdx │ │ ├── reading.mdx │ │ ├── reading │ │ │ └── consumer_hook.dart │ │ ├── scopes.mdx │ │ ├── subtree_scope.dart │ │ ├── theme_scope.dart │ │ └── why_immutability.mdx │ │ ├── cookbooks │ │ ├── search_as_we_type.mdx │ │ ├── testing.mdx │ │ ├── testing_dart.dart │ │ ├── testing_flutter.dart │ │ ├── testing_full.dart │ │ ├── testing_original_test_dart.dart │ │ ├── testing_original_test_flutter.dart │ │ ├── testing_override_info.dart │ │ └── testing_repository.dart │ │ ├── essentials │ │ ├── auto_dispose.mdx │ │ ├── combining_requests.mdx │ │ ├── do_dont.mdx │ │ ├── eager_initialization.mdx │ │ ├── faq.mdx │ │ ├── first_request.mdx │ │ ├── first_request │ │ │ ├── activity.ts │ │ │ ├── codegen │ │ │ │ ├── activity.dart │ │ │ │ └── provider.dart │ │ │ ├── consumer.ts │ │ │ ├── consumer_stateful_widget.ts │ │ │ ├── consumer_widget.ts │ │ │ ├── hook_consumer_widget.ts │ │ │ ├── legend │ │ │ │ ├── DocuCode.scss │ │ │ │ └── legend.tsx │ │ │ ├── provider.ts │ │ │ └── raw │ │ │ │ ├── activity.dart │ │ │ │ ├── consumer.dart │ │ │ │ ├── consumer_stateful_widget.dart │ │ │ │ ├── consumer_widget.dart │ │ │ │ ├── hook_consumer_widget.dart │ │ │ │ └── provider.dart │ │ ├── passing_args.mdx │ │ ├── passing_args │ │ │ ├── codegen │ │ │ │ ├── family.dart │ │ │ │ └── provider.dart │ │ │ ├── no_arg_provider.ts │ │ │ └── raw │ │ │ │ ├── family.dart │ │ │ │ └── provider.dart │ │ ├── provider_observer.mdx │ │ ├── side_effects.mdx │ │ ├── side_effects │ │ │ ├── codegen │ │ │ │ ├── todo_list_notifier.dart │ │ │ │ ├── todo_list_notifier_add_todo.dart │ │ │ │ └── todo_list_provider.dart │ │ │ ├── raw │ │ │ │ ├── render_add_todo.dart │ │ │ │ ├── render_add_todo_hooks.dart │ │ │ │ ├── todo_list_notifier.dart │ │ │ │ ├── todo_list_notifier_add_todo.dart │ │ │ │ └── todo_list_provider.dart │ │ │ ├── render_add_todo.ts │ │ │ ├── todo_list_notifier.ts │ │ │ ├── todo_list_notifier_add_todo.ts │ │ │ └── todo_list_provider.ts │ │ ├── testing.mdx │ │ └── websockets_sync.mdx │ │ ├── from_provider │ │ ├── helpers │ │ │ ├── item.dart │ │ │ └── json.dart │ │ ├── motivation │ │ │ └── motivation.mdx │ │ ├── provider_vs_riverpod.mdx │ │ └── quickstart.mdx │ │ ├── introduction │ │ ├── getting_started.mdx │ │ ├── getting_started │ │ │ ├── dart_pub_add.tsx │ │ │ ├── dart_pubspec.tsx │ │ │ ├── pub_add.tsx │ │ │ └── pubspec.tsx │ │ └── why_riverpod.mdx │ │ ├── migration │ │ ├── 0.13.0_to_0.14.0.mdx │ │ ├── 0.14.0_to_1.0.0.mdx │ │ ├── from_change_notifier.mdx │ │ ├── from_state_notifier.mdx │ │ └── utils.dart │ │ └── providers │ │ ├── change_notifier_provider.mdx │ │ ├── change_notifier_provider │ │ ├── todos.dart │ │ └── todos_consumer.dart │ │ ├── future_provider.mdx │ │ ├── notifier_provider.mdx │ │ ├── provider.mdx │ │ ├── provider │ │ └── todos_consumer.dart │ │ ├── state_notifier_provider.mdx │ │ ├── state_notifier_provider │ │ ├── todos.dart │ │ └── todos_consumer.dart │ │ ├── state_provider.mdx │ │ ├── state_provider │ │ ├── connected_dropdown.dart │ │ ├── dartpad_metadata.yaml │ │ ├── dropdown.dart │ │ ├── full.dart │ │ ├── product.dart │ │ ├── product_list_view.dart │ │ ├── sort_provider.dart │ │ ├── sorted_product_provider.dart │ │ ├── update_read_once.dart │ │ └── update_read_twice.dart │ │ ├── stream_provider.mdx │ │ └── stream_provider │ │ ├── live_stream_chat_consumer.dart │ │ └── live_stream_chat_provider.dart │ └── docusaurus-theme-classic │ ├── footer.json │ └── navbar.json ├── meta_generator.js ├── package.json ├── pubspec.yaml ├── sidebars.js ├── src ├── components │ ├── Banner │ │ ├── index.tsx │ │ └── style.scss │ ├── CodeSnippet │ │ ├── index.tsx │ │ └── style.scss │ ├── Feature │ │ ├── index.tsx │ │ └── style.scss │ ├── Highlight │ │ ├── index.tsx │ │ └── style.scss │ └── Link │ │ └── index.tsx ├── data │ ├── features.tsx │ └── highlights.tsx ├── documents_meta.js ├── pages │ └── index.tsx ├── scss │ ├── abstracts │ │ ├── _mixins.scss │ │ └── _variables.scss │ ├── base │ │ ├── _reset.scss │ │ └── _typography.scss │ ├── main.scss │ └── sidebar.scss ├── theme │ ├── DocItem │ │ ├── Layout │ │ │ ├── index.js │ │ │ └── styles.module.css │ │ ├── Metadata │ │ │ └── index.js │ │ └── index.js │ ├── DocPage │ │ ├── Layout │ │ │ └── index.tsx │ │ └── index.js │ └── DocVersionBanner │ │ └── index.js └── versions.js ├── static ├── img │ ├── case_studies │ │ ├── cancel │ │ │ └── app.gif │ │ └── pull_to_refresh │ │ │ └── app.gif │ ├── cover.png │ ├── essentials │ │ └── side_effects │ │ │ └── spinner.gif │ ├── favicon.ico │ ├── full_logo.svg │ ├── highlights │ │ ├── compile.svg │ │ ├── flutter.svg │ │ └── provider.svg │ ├── intro │ │ ├── convert_to_class_provider.gif │ │ ├── devtool.png │ │ ├── devtool_code.png │ │ ├── fr │ │ │ ├── async.png │ │ │ └── declare_anywhere.png │ │ ├── lint.gif │ │ └── reading.excalidraw │ ├── logo.png │ ├── logo.svg │ └── snippets │ │ └── greetingProvider.gif └── snippets │ ├── async.dart │ ├── async.g.dart │ ├── combine.dart │ ├── combine.g.dart │ ├── create.dart │ ├── create.g.dart │ ├── declare.dart │ ├── declare.g.dart │ └── read.dart ├── tsconfig.json └── yarn.lock /.gitattributes: -------------------------------------------------------------------------------- 1 | **/*.*.dart linguist-generated=true 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: rrousselGit 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: There is a problem in how provider behaves 4 | title: "" 5 | labels: bug, needs triage 6 | assignees: 7 | - rrousselGit 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | 15 | 16 | 17 | **Expected behavior** 18 | A clear and concise description of what you expected to happen. 19 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: I have a problem and I need help 4 | url: https://github.com/rrousselGit/riverpod/discussions 5 | about: Please ask and answer questions here. 6 | -------------------------------------------------------------------------------- /.github/dependabot.yaml: -------------------------------------------------------------------------------- 1 | version: 2 2 | enable-beta-ecosystems: true 3 | updates: 4 | - package-ecosystem: "pub" 5 | directory: "/" 6 | schedule: 7 | interval: "weekly" -------------------------------------------------------------------------------- /benchmarks/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: ede1b15b76c04e3a50ee95fab9152b3d49561918 8 | channel: master 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /benchmarks/README.md: -------------------------------------------------------------------------------- 1 | A list of benchmarks to measure the different aspects of Riverpod 2 | 3 | To run a benchmark, run: 4 | 5 | ```sh 6 | flutter run --release -t lib/some_benchmark.dart 7 | ``` 8 | -------------------------------------------------------------------------------- /benchmarks/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../analysis_options.yaml 2 | linter: 3 | rules: 4 | # Useful for packages but not for apps 5 | type_annotate_public_apis: false 6 | 7 | # generates false positives 8 | close_sinks: false 9 | 10 | # Our example actually wants to print to the console 11 | avoid_print: false 12 | 13 | # Not necessary for examples 14 | public_member_api_docs: false 15 | 16 | # Not necessary for examples 17 | use_key_in_widget_constructors: false 18 | 19 | # Too verbose for apps and bring very little value 20 | diagnostic_describe_all_properties: false -------------------------------------------------------------------------------- /benchmarks/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'add_listener.dart' as add_listener; 2 | import 'create_bench.dart' as create; 3 | import 'read_bench.dart' as read; 4 | import 'remove_listener.dart' as remove_listener; 5 | 6 | void main() { 7 | create.main(); 8 | read.main(); 9 | remove_listener.main(); 10 | add_listener.main(); 11 | } 12 | -------------------------------------------------------------------------------- /benchmarks/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: benchmarks 2 | description: A new Flutter project. 3 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 4 | version: 1.0.0+1 5 | 6 | environment: 7 | sdk: ^3.6.0 8 | 9 | resolution: workspace 10 | 11 | dependencies: 12 | flutter: 13 | sdk: flutter 14 | riverpod: 15 | 16 | dev_dependencies: 17 | flutter_test: 18 | sdk: flutter 19 | -------------------------------------------------------------------------------- /examples/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../analysis_options.yaml 2 | linter: 3 | rules: 4 | # Useful for packages but not for apps 5 | type_annotate_public_apis: false 6 | 7 | # generates false positives 8 | close_sinks: false 9 | 10 | # Our example actually wants to print to the console 11 | avoid_print: false 12 | 13 | # Not necessary for examples 14 | public_member_api_docs: false 15 | 16 | # Not necessary for examples 17 | use_key_in_widget_constructors: false 18 | 19 | # Too verbose for apps and bring very little value 20 | diagnostic_describe_all_properties: false -------------------------------------------------------------------------------- /examples/counter/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 94b7ff241e6e5445b7f30215a777eb4971311797 8 | channel: master 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /examples/counter/README.md: -------------------------------------------------------------------------------- 1 | The standard Flutter Counter example built with [Riverpod] 2 | 3 | This uses `ProviderScope`. 4 | 5 | 6 | [riverpod]: https://github.com/rrousselGit/riverpod 7 | -------------------------------------------------------------------------------- /examples/counter/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../analysis_options.yaml 2 | # enable riverpod_lint 3 | analyzer: 4 | plugins: 5 | - custom_lint -------------------------------------------------------------------------------- /examples/marvel/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: b8bd09db210d2c6299555643af8db4b8ff3e8d92 8 | channel: master 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /examples/marvel/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | import: ../../analysis_options.yaml 2 | analyzer: 3 | # enable riverpod_lint 4 | plugins: 5 | - custom_lint 6 | errors: 7 | # Some assets are voluntarily gitignored 8 | asset_does_not_exist: ignore 9 | # I prefer specifying a parameter on a widget even if they are unused (such as Key) 10 | # for the sake of consistency. 11 | unused_element_parameter: false 12 | unrecognized_error_code: ignore 13 | -------------------------------------------------------------------------------- /examples/marvel/assets/configurations.json: -------------------------------------------------------------------------------- 1 | { 2 | "public_key": "your public key", 3 | "private_key": "your private key" 4 | } 5 | -------------------------------------------------------------------------------- /examples/marvel/assets/marvel_background.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/examples/marvel/assets/marvel_background.jpeg -------------------------------------------------------------------------------- /examples/marvel/lib/src/widgets/marvel_logo.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_svg/flutter_svg.dart'; 2 | 3 | final marvelLogo = SvgPicture.asset( 4 | 'assets/marvel.svg', 5 | semanticsLabel: 'Marvel Logo', 6 | ); 7 | -------------------------------------------------------------------------------- /examples/marvel/macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/xcuserdata/ 7 | -------------------------------------------------------------------------------- /examples/marvel/macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /examples/marvel/macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /examples/marvel/macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | 9 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 10 | } 11 | -------------------------------------------------------------------------------- /examples/marvel/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/marvel/macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/marvel/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/marvel/macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @NSApplicationMain 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /examples/marvel/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/examples/marvel/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /examples/marvel/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/examples/marvel/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /examples/marvel/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/examples/marvel/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /examples/marvel/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/examples/marvel/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /examples/marvel/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/examples/marvel/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /examples/marvel/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/examples/marvel/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /examples/marvel/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/examples/marvel/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /examples/marvel/macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /examples/marvel/macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /examples/marvel/macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | com.apple.security.files.user-selected.read-only 12 | 13 | com.apple.security.network.client 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /examples/marvel/macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController.init() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /examples/marvel/macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/marvel/resources/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/examples/marvel/resources/home.png -------------------------------------------------------------------------------- /examples/marvel/resources/marvel_portal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/examples/marvel/resources/marvel_portal.png -------------------------------------------------------------------------------- /examples/marvel/resources/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/examples/marvel/resources/search.png -------------------------------------------------------------------------------- /examples/pub/README.md: -------------------------------------------------------------------------------- 1 | # Pub 2 | 3 | ## Install needed global packages 4 | 5 | ```bash 6 | cd riverpod 7 | dart pub global activate melos 8 | ``` 9 | 10 | ## Build the Example App 11 | 12 | Run the code generation 13 | ```bash 14 | cd examples/pub 15 | flutter pub get 16 | dart run build_runner build -d 17 | ``` 18 | 19 | ## Run the Example App 20 | 21 | Create and run the android deployable 22 | ```bash 23 | flutter create . --platforms android 24 | flutter run 25 | ``` 26 | -------------------------------------------------------------------------------- /examples/pub/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../analysis_options.yaml 2 | # enable riverpod_lint 3 | analyzer: 4 | plugins: 5 | - custom_lint -------------------------------------------------------------------------------- /examples/pub/assets/search_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/examples/pub/assets/search_background.png -------------------------------------------------------------------------------- /examples/pub/build.yaml: -------------------------------------------------------------------------------- 1 | targets: 2 | $default: 3 | builders: 4 | source_gen:combining_builder: 5 | options: 6 | ignore_for_file: 7 | - non_constant_identifier_names 8 | - require_trailing_commas -------------------------------------------------------------------------------- /examples/pub/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:hooks_riverpod/hooks_riverpod.dart'; 3 | import 'search.dart'; 4 | 5 | void main() { 6 | runApp(const ProviderScope(child: MyApp())); 7 | } 8 | 9 | class MyApp extends ConsumerWidget { 10 | const MyApp({super.key}); 11 | 12 | @override 13 | Widget build(BuildContext context, WidgetRef ref) { 14 | return const MaterialApp(home: SearchPage()); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /examples/random_number/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: cc00e7e6bc281f6af9a257e7e33868ef782b1cf7 8 | channel: dev 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /examples/random_number/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../analysis_options.yaml 2 | # enable riverpod_lint 3 | analyzer: 4 | plugins: 5 | - custom_lint -------------------------------------------------------------------------------- /examples/random_number/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: random_number 2 | description: A new Flutter project. 3 | publish_to: "none" 4 | 5 | environment: 6 | sdk: ^3.6.0 7 | 8 | resolution: workspace 9 | 10 | dependencies: 11 | build_runner: ^2.0.6 12 | cupertino_icons: ^1.0.2 13 | flutter: 14 | sdk: flutter 15 | flutter_riverpod: 16 | mockito: ^5.0.13 17 | 18 | dev_dependencies: 19 | custom_lint: ^0.7.5 20 | flutter_test: 21 | sdk: flutter 22 | riverpod_lint: 23 | 24 | flutter: 25 | uses-material-design: true 26 | -------------------------------------------------------------------------------- /examples/stackoverflow/README.md: -------------------------------------------------------------------------------- 1 | A StackOverflow client implemented using Riverpod and the official StackOverflow API 2 | 3 | The example is still in progress 4 | 5 | # Setup 6 | 7 | This example uses code generation. 8 | Before starting the application, you must first start the code generators. 9 | 10 | This can be done with: 11 | 12 | ```sh 13 | cd examples/stackoverflow 14 | dart run build_runner build -d 15 | ``` 16 | -------------------------------------------------------------------------------- /examples/stackoverflow/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../analysis_options.yaml 2 | # enable riverpod_lint 3 | analyzer: 4 | plugins: 5 | - custom_lint -------------------------------------------------------------------------------- /examples/stackoverflow/build.yaml: -------------------------------------------------------------------------------- 1 | targets: 2 | $default: 3 | builders: 4 | source_gen:combining_builder: 5 | options: 6 | ignore_for_file: 7 | - non_constant_identifier_names 8 | - require_trailing_commas -------------------------------------------------------------------------------- /examples/stackoverflow/foo.sh: -------------------------------------------------------------------------------- 1 | if ! grep -q publish_to "pubspec.yaml"; then 2 | dart doc --dry-run 3 | fi -------------------------------------------------------------------------------- /examples/stackoverflow/macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | com.apple.security.network.client 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /examples/todos/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: b8bd09db210d2c6299555643af8db4b8ff3e8d92 8 | channel: master 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /examples/todos/README.md: -------------------------------------------------------------------------------- 1 | A todo-list built with [Riverpod] 2 | 3 | This showcase slightly more advanced state manipulation, using [Computed]. 4 | 5 | todo screenshot 6 | 7 | 8 | [riverpod]: https://github.com/rrousselGit/riverpod 9 | -------------------------------------------------------------------------------- /examples/todos/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../analysis_options.yaml 2 | # enable riverpod_lint 3 | analyzer: 4 | plugins: 5 | - custom_lint -------------------------------------------------------------------------------- /examples/todos/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: todos 2 | description: A new Flutter project. 3 | publish_to: "none" 4 | 5 | environment: 6 | sdk: ^3.6.0 7 | flutter: ">=1.17.0" 8 | 9 | resolution: workspace 10 | 11 | dependencies: 12 | flutter: 13 | sdk: flutter 14 | flutter_hooks: ^0.21.2 15 | hooks_riverpod: 16 | riverpod: 17 | uuid: ^4.5.1 18 | 19 | dev_dependencies: 20 | build_runner: ^2.0.0 21 | custom_lint: ^0.7.5 22 | flutter_test: 23 | sdk: flutter 24 | riverpod_lint: 25 | 26 | flutter: 27 | uses-material-design: true 28 | -------------------------------------------------------------------------------- /examples/todos/test/initial_state.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/examples/todos/test/initial_state.png -------------------------------------------------------------------------------- /examples/todos/test/new_todo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/examples/todos/test/new_todo.png -------------------------------------------------------------------------------- /examples/todos/todo_screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/examples/todos/todo_screenshot.jpg -------------------------------------------------------------------------------- /packages/flutter_riverpod/LICENSE: -------------------------------------------------------------------------------- 1 | ../../LICENSE -------------------------------------------------------------------------------- /packages/flutter_riverpod/README.md: -------------------------------------------------------------------------------- 1 | ../../README.md -------------------------------------------------------------------------------- /packages/flutter_riverpod/dartdoc/notifiers.md: -------------------------------------------------------------------------------- 1 | 2 | Here, you will find all the notifier types. 3 | 4 | Notifiers are a way for providers to define methods that can modify their state. 5 | Those methods can then be invoked by objects external to the provider. 6 | -------------------------------------------------------------------------------- /packages/flutter_riverpod/dartdoc_options.yaml: -------------------------------------------------------------------------------- 1 | dartdoc: 2 | categories: 3 | "Core": 4 | markdown: ./dartdoc/core.md 5 | name: Core 6 | "Providers": 7 | markdown: ./dartdoc/providers.md 8 | name: Providers 9 | "Notifiers": 10 | markdown: ./dartdoc/notifiers.md 11 | name: Notifiers 12 | showUndocumentedCategories: true 13 | -------------------------------------------------------------------------------- /packages/flutter_riverpod/example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 94b7ff241e6e5445b7f30215a777eb4971311797 8 | channel: master 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /packages/flutter_riverpod/example/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../../../analysis_options.yaml 2 | linter: 3 | rules: 4 | # Useful for packages but not for apps 5 | type_annotate_public_apis: false 6 | 7 | # generates false positives 8 | close_sinks: false 9 | 10 | # Our example actually wants to print to the console 11 | avoid_print: false 12 | 13 | # Not necessary for examples 14 | public_member_api_docs: false 15 | 16 | # Not necessary for examples 17 | use_key_in_widget_constructors: false 18 | -------------------------------------------------------------------------------- /packages/flutter_riverpod/example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_riverpod_example 2 | description: A new Flutter project. 3 | 4 | publish_to: "none" 5 | 6 | environment: 7 | sdk: ^3.6.0 8 | 9 | resolution: workspace 10 | 11 | dependencies: 12 | flutter: 13 | sdk: flutter 14 | flutter_riverpod: 15 | hooks_riverpod: 16 | riverpod: 17 | 18 | dev_dependencies: 19 | flutter_test: 20 | sdk: flutter 21 | 22 | flutter: 23 | uses-material-design: true 24 | -------------------------------------------------------------------------------- /packages/flutter_riverpod/lib/experimental/persist.dart: -------------------------------------------------------------------------------- 1 | export '../src/internals.dart' 2 | show 3 | StorageOptions, 4 | PersistedData, 5 | Storage, 6 | StorageCacheTime, 7 | NotifierPersistX; 8 | -------------------------------------------------------------------------------- /packages/flutter_riverpod/lib/legacy.dart: -------------------------------------------------------------------------------- 1 | export 'src/internals.dart' 2 | show 3 | StateNotifier, 4 | StateController, 5 | StateNotifierProvider, 6 | StateProvider, 7 | ChangeNotifierProvider, 8 | StateNotifierProviderFamily, 9 | StateProviderFamily; 10 | -------------------------------------------------------------------------------- /packages/flutter_riverpod/lib/src/core.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/foundation.dart' hide describeIdentity; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter/scheduler.dart'; 4 | import 'package:meta/meta.dart'; 5 | 6 | import 'internals.dart'; 7 | 8 | part 'core/consumer.dart'; 9 | part 'core/widget_ref.dart'; 10 | part 'core/provider_scope.dart'; 11 | -------------------------------------------------------------------------------- /packages/flutter_riverpod/lib/src/internals.dart: -------------------------------------------------------------------------------- 1 | export 'package:riverpod/src/internals.dart'; 2 | 3 | export 'core.dart'; 4 | export 'providers/legacy/change_notifier_provider.dart'; 5 | -------------------------------------------------------------------------------- /packages/flutter_riverpod/test/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../../../analysis_options.yaml 2 | analyzer: 3 | errors: 4 | unused_local_variable: ignore 5 | 6 | linter: 7 | rules: 8 | # Some tests may want to explicitly create an unused variable without type inference, 9 | # for the sake of testing that that two types are assignable 10 | omit_local_variable_types: false 11 | -------------------------------------------------------------------------------- /packages/hooks_riverpod/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: b8bd09db210d2c6299555643af8db4b8ff3e8d92 8 | channel: master 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /packages/hooks_riverpod/LICENSE: -------------------------------------------------------------------------------- 1 | ../../LICENSE -------------------------------------------------------------------------------- /packages/hooks_riverpod/README.md: -------------------------------------------------------------------------------- 1 | ../../README.md -------------------------------------------------------------------------------- /packages/hooks_riverpod/dartdoc/notifiers.md: -------------------------------------------------------------------------------- 1 | 2 | Here, you will find all the notifier types. 3 | 4 | Notifiers are a way for providers to define methods that can modify their state. 5 | Those methods can then be invoked by objects external to the provider. 6 | -------------------------------------------------------------------------------- /packages/hooks_riverpod/dartdoc_options.yaml: -------------------------------------------------------------------------------- 1 | dartdoc: 2 | categories: 3 | "Core": 4 | markdown: ./dartdoc/core.md 5 | name: Core 6 | "Providers": 7 | markdown: ./dartdoc/providers.md 8 | name: Providers 9 | "Notifiers": 10 | markdown: ./dartdoc/notifiers.md 11 | name: Notifiers 12 | showUndocumentedCategories: true 13 | -------------------------------------------------------------------------------- /packages/hooks_riverpod/example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: b8bd09db210d2c6299555643af8db4b8ff3e8d92 8 | channel: master 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /packages/hooks_riverpod/example/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../../../analysis_options.yaml 2 | linter: 3 | rules: 4 | # Useful for packages but not for apps 5 | type_annotate_public_apis: false 6 | 7 | # generates false positives 8 | close_sinks: false 9 | 10 | # Our example actually wants to print to the console 11 | avoid_print: false 12 | 13 | public_member_api_docs: false 14 | -------------------------------------------------------------------------------- /packages/hooks_riverpod/example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: hooks_riverpod_example 2 | description: A new Flutter project. 3 | 4 | publish_to: "none" 5 | 6 | environment: 7 | sdk: ^3.6.0 8 | flutter: ">=1.17.0" 9 | 10 | resolution: workspace 11 | 12 | dependencies: 13 | flutter: 14 | sdk: flutter 15 | hooks_riverpod: 16 | 17 | dev_dependencies: 18 | flutter_test: 19 | sdk: flutter 20 | 21 | flutter: 22 | uses-material-design: true 23 | -------------------------------------------------------------------------------- /packages/hooks_riverpod/lib/experimental/persist.dart: -------------------------------------------------------------------------------- 1 | export '../src/internals.dart' 2 | show 3 | StorageOptions, 4 | PersistedData, 5 | Storage, 6 | StorageCacheTime, 7 | NotifierPersistX; 8 | -------------------------------------------------------------------------------- /packages/hooks_riverpod/lib/legacy.dart: -------------------------------------------------------------------------------- 1 | export 'src/internals.dart' 2 | show 3 | StateNotifier, 4 | StateController, 5 | StateNotifierProvider, 6 | StateProvider, 7 | ChangeNotifierProvider, 8 | StateNotifierProviderFamily, 9 | StateProviderFamily; 10 | -------------------------------------------------------------------------------- /packages/hooks_riverpod/lib/src/internals.dart: -------------------------------------------------------------------------------- 1 | export 'package:flutter_riverpod/src/internals.dart'; 2 | export './consumer.dart'; 3 | -------------------------------------------------------------------------------- /packages/hooks_riverpod/test/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | import: "../../analysis_options.yaml" 2 | 3 | analyzer: 4 | errors: 5 | deprecated_member_use_from_same_package: false 6 | -------------------------------------------------------------------------------- /packages/internal_lint/lib/internal_lint.dart: -------------------------------------------------------------------------------- 1 | import 'package:custom_lint_builder/custom_lint_builder.dart'; 2 | 3 | import 'src/lints/show_all.dart'; 4 | 5 | /// The plugin entry point. 6 | PluginBase createPlugin() => _InternalLints(); 7 | 8 | class _InternalLints extends PluginBase { 9 | @override 10 | List getLintRules(CustomLintConfigs configs) => [ 11 | const ShowAll(), 12 | ]; 13 | } 14 | -------------------------------------------------------------------------------- /packages/internal_lint/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: internal_lint 2 | publish_to: none 3 | 4 | environment: 5 | sdk: ^3.6.0 6 | 7 | resolution: workspace 8 | 9 | dependencies: 10 | analyzer: ^7.0.0 11 | analyzer_plugin: ^0.13.0 12 | custom_lint_builder: ^0.7.0 13 | meta: ^1.7.0 14 | path: ^1.8.1 15 | pubspec_parse: ^1.5.0 16 | -------------------------------------------------------------------------------- /packages/lint_visitor_generator/README.md: -------------------------------------------------------------------------------- 1 | Internal tooling to generate `riverpod_analyzer_utils`'s `RiverpodAstVisitor` (and variants). 2 | -------------------------------------------------------------------------------- /packages/lint_visitor_generator/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: lint_visitor_generator 2 | publish_to: none 3 | 4 | environment: 5 | sdk: ^3.6.0 6 | 7 | resolution: workspace 8 | 9 | dependencies: 10 | analyzer: ^7.0.0 11 | build: ^2.3.1 12 | build_config: ^1.1.0 13 | collection: ^1.17.1 14 | meta: ^1.7.0 15 | path: ^1.9.0 16 | source_gen: ^2.0.0 17 | source_span: ^1.10.0 18 | 19 | dev_dependencies: 20 | build_runner: ^2.2.0 21 | build_test: ^2.1.5 22 | source_gen_test: ^1.0.4 23 | -------------------------------------------------------------------------------- /packages/riverpod/LICENSE: -------------------------------------------------------------------------------- 1 | ../../LICENSE -------------------------------------------------------------------------------- /packages/riverpod/README.md: -------------------------------------------------------------------------------- 1 | ../../README.md -------------------------------------------------------------------------------- /packages/riverpod/dartdoc/notifiers.md: -------------------------------------------------------------------------------- 1 | 2 | Here, you will find all the notifier types. 3 | 4 | Notifiers are a way for providers to define methods that can modify their state. 5 | Those methods can then be invoked by objects external to the provider. 6 | -------------------------------------------------------------------------------- /packages/riverpod/dartdoc_options.yaml: -------------------------------------------------------------------------------- 1 | dartdoc: 2 | categories: 3 | "Core": 4 | markdown: ./dartdoc/core.md 5 | name: Core 6 | "Providers": 7 | markdown: ./dartdoc/providers.md 8 | name: Providers 9 | "Notifiers": 10 | markdown: ./dartdoc/notifiers.md 11 | name: Notifiers 12 | showUndocumentedCategories: true 13 | -------------------------------------------------------------------------------- /packages/riverpod/example/.gitignore: -------------------------------------------------------------------------------- 1 | configuration.json -------------------------------------------------------------------------------- /packages/riverpod/example/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../../../analysis_options.yaml 2 | linter: 3 | rules: 4 | # Useful for packages but not for apps 5 | type_annotate_public_apis: false 6 | 7 | # generates false positives 8 | close_sinks: false 9 | 10 | # Our example actually wants to print to the console 11 | avoid_print: false 12 | 13 | public_member_api_docs: false 14 | -------------------------------------------------------------------------------- /packages/riverpod/example/build.yaml: -------------------------------------------------------------------------------- 1 | targets: 2 | $default: 3 | builders: 4 | source_gen:combining_builder: 5 | options: 6 | ignore_for_file: 7 | - type=lint -------------------------------------------------------------------------------- /packages/riverpod/example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: riverpod_example 2 | publish_to: "none" 3 | 4 | environment: 5 | sdk: ^3.6.0 6 | 7 | resolution: workspace 8 | 9 | dependencies: 10 | crypto: ^3.0.0 11 | dio: 5.8.0+1 12 | freezed_annotation: ^3.0.0 13 | json_annotation: ^4.9.0 14 | riverpod: 15 | 16 | dev_dependencies: 17 | build_runner: ^2.0.0 18 | freezed: ^3.0.2 19 | json_serializable: ^6.3.0 20 | test: ^1.16.0 21 | -------------------------------------------------------------------------------- /packages/riverpod/lib/experimental/persist.dart: -------------------------------------------------------------------------------- 1 | export '../src/internals.dart' 2 | show 3 | StorageOptions, 4 | PersistedData, 5 | Storage, 6 | StorageCacheTime, 7 | NotifierPersistX; 8 | -------------------------------------------------------------------------------- /packages/riverpod/lib/legacy.dart: -------------------------------------------------------------------------------- 1 | export 'src/internals.dart' 2 | show 3 | StateNotifier, 4 | StateController, 5 | StateNotifierProvider, 6 | StateProvider, 7 | StateNotifierProviderFamily, 8 | StateProviderFamily; 9 | -------------------------------------------------------------------------------- /packages/riverpod/lib/src/common/pragma.dart: -------------------------------------------------------------------------------- 1 | import 'package:meta/meta.dart'; 2 | 3 | /// Alias for vm:prefer-inline 4 | @internal 5 | const preferInline = pragma('vm:prefer-inline'); 6 | 7 | /// Alias for vm:notify-debugger-on-exception 8 | @internal 9 | const notifyDebuggerOnException = pragma('vm:notify-debugger-on-exception'); 10 | -------------------------------------------------------------------------------- /packages/riverpod/test/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../../../analysis_options.yaml 2 | analyzer: 3 | errors: 4 | unused_local_variable: ignore 5 | 6 | linter: 7 | rules: 8 | # Some tests may want to explicitly create an unused variable without type inference, 9 | # for the sake of testing that that two types are assignable 10 | omit_local_variable_types: false 11 | -------------------------------------------------------------------------------- /packages/riverpod/test/old/framework/proxy_provider_listenable_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod/riverpod.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('ProviderElementProxy', () { 6 | test('implements ==/hashCode', () { 7 | final a = FutureProvider((ref) => 0); 8 | final b = FutureProvider((ref) => 0); 9 | 10 | expect(a.future, a.future); 11 | expect(a.future, isNot(b.future)); 12 | 13 | expect(a.future.hashCode, a.future.hashCode); 14 | expect(a.future.hashCode, isNot(b.future.hashCode)); 15 | }); 16 | }); 17 | } 18 | -------------------------------------------------------------------------------- /packages/riverpod/test/old/legacy_providers/deprecated/state_provider/state_controller_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod/legacy.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('StateController', () { 6 | test('update allows changing the state from the previous state', () { 7 | final controller = StateController(0); 8 | addTearDown(controller.dispose); 9 | 10 | expect(controller.state, 0); 11 | 12 | final result = controller.update((state) => state + 1); 13 | 14 | expect(result, 1); 15 | expect(controller.state, 1); 16 | }); 17 | }); 18 | } 19 | -------------------------------------------------------------------------------- /packages/riverpod_analyzer_utils/README.md: -------------------------------------------------------------------------------- 1 | A package internal to Riverpod, used to parse providers using the analyzer. 2 | -------------------------------------------------------------------------------- /packages/riverpod_analyzer_utils/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../../analysis_options.yaml 2 | linter: 3 | rules: 4 | # TODO enable later 5 | public_member_api_docs: false -------------------------------------------------------------------------------- /packages/riverpod_analyzer_utils/lib/src/object_extensions.dart: -------------------------------------------------------------------------------- 1 | import 'package:meta/meta.dart'; 2 | 3 | @internal 4 | extension ObjectX on T? { 5 | R? cast() { 6 | final that = this; 7 | if (that is R) return that; 8 | return null; 9 | } 10 | 11 | R? let(R? Function(T value)? cb) { 12 | if (cb == null) return null; 13 | final that = this; 14 | if (that != null) return cb(that); 15 | return null; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/riverpod_analyzer_utils_tests/README.md: -------------------------------------------------------------------------------- 1 | Tests for riverpod_analyzer_utils 2 | 3 | They are un a separate project as the analyzer utils tests depend on 4 | riverpod_generator; but riverpod_generator depends on analyzer utils. 5 | Separating them allows bypassing the circular dependency. -------------------------------------------------------------------------------- /packages/riverpod_annotation/LICENSE: -------------------------------------------------------------------------------- 1 | ../../LICENSE -------------------------------------------------------------------------------- /packages/riverpod_annotation/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../../analysis_options.yaml 2 | analyzer: 3 | errors: 4 | # We have a tight constraint on Riverpod to use its internal APIs 5 | invalid_use_of_internal_member: ignore 6 | implementation_imports: ignore 7 | -------------------------------------------------------------------------------- /packages/riverpod_annotation/lib/experimental/mutation.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: invalid_export_of_internal_element 2 | 3 | export '../src/internal.dart' 4 | show 5 | mutationZoneKey, 6 | mutation, 7 | Mutation, 8 | MutationState, 9 | MutationIdle, 10 | MutationPending, 11 | MutationError, 12 | MutationSuccess, 13 | MutationBase, 14 | $SyncMutationBase, 15 | $AsyncMutationBase; 16 | -------------------------------------------------------------------------------- /packages/riverpod_annotation/lib/src/internal.dart: -------------------------------------------------------------------------------- 1 | export 'package:riverpod/src/internals.dart'; 2 | 3 | export './riverpod_annotation.dart'; 4 | -------------------------------------------------------------------------------- /packages/riverpod_annotation/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: riverpod_annotation 2 | description: A package exposing annotations for riverpod_generator 3 | version: 3.0.0-dev.15 4 | repository: https://github.com/rrousselGit/riverpod 5 | issue_tracker: https://github.com/rrousselGit/riverpod/issues 6 | funding: 7 | - https://github.com/sponsors/rrousselGit/ 8 | 9 | environment: 10 | sdk: ^3.6.0 11 | 12 | resolution: workspace 13 | 14 | dependencies: 15 | meta: ^1.7.0 16 | riverpod: 3.0.0-dev.15 17 | 18 | dev_dependencies: 19 | test: ^1.21.0 20 | -------------------------------------------------------------------------------- /packages/riverpod_generator/.pubignore: -------------------------------------------------------------------------------- 1 | pubspec_overrides.yaml -------------------------------------------------------------------------------- /packages/riverpod_generator/LICENSE: -------------------------------------------------------------------------------- 1 | ../../LICENSE -------------------------------------------------------------------------------- /packages/riverpod_generator/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../../analysis_options.yaml 2 | linter: 3 | rules: 4 | # We don't really have public API 5 | public_member_api_docs: false 6 | -------------------------------------------------------------------------------- /packages/riverpod_generator/dartdoc_options.yaml: -------------------------------------------------------------------------------- 1 | dartdoc: 2 | categories: 3 | provider: 4 | markdown: doc/First.md 5 | name: Awesome 6 | core: 7 | markdown: doc/Second.md 8 | name: Great 9 | notifier: 10 | markdown: doc/Second.md 11 | name: Great 12 | categoryOrder: 13 | - core 14 | - provider 15 | - notifier 16 | -------------------------------------------------------------------------------- /packages/riverpod_generator/integration/build_yaml/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub. 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build output. 6 | build/ 7 | -------------------------------------------------------------------------------- /packages/riverpod_generator/integration/build_yaml/README.md: -------------------------------------------------------------------------------- 1 | # Pub 2 | 3 | Install needed global packages 4 | 5 | ```bash 6 | cd riverpod 7 | dart pub global activate melos 8 | ``` 9 | 10 | Build the riverpod packages 11 | 12 | ```bash 13 | flutter pub get 14 | ``` 15 | 16 | ## Start the tests 17 | 18 | ```bash 19 | cd examples/build_yaml 20 | dart run build_runner build 21 | 22 | flutter test 23 | ``` 24 | -------------------------------------------------------------------------------- /packages/riverpod_generator/integration/build_yaml/build.yaml: -------------------------------------------------------------------------------- 1 | targets: 2 | $default: 3 | builders: 4 | riverpod_generator: 5 | options: 6 | provider_name_prefix: 'my' 7 | provider_family_name_prefix: 'myFamily' 8 | provider_name_suffix: 'Pod' 9 | provider_family_name_suffix: 'ProviderFamily' 10 | -------------------------------------------------------------------------------- /packages/riverpod_generator/integration/build_yaml/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: build_yaml 2 | description: A sample command-line application. 3 | publish_to: none 4 | 5 | environment: 6 | sdk: ^3.6.0 7 | 8 | resolution: workspace 9 | 10 | dependencies: 11 | riverpod: 12 | riverpod_annotation: 13 | 14 | dev_dependencies: 15 | build_runner: ^2.3.2 16 | riverpod_generator: 17 | test: ^1.16.0 18 | -------------------------------------------------------------------------------- /packages/riverpod_generator/lib/builder.dart: -------------------------------------------------------------------------------- 1 | import 'package:build/build.dart'; 2 | import 'package:source_gen/source_gen.dart'; 3 | 4 | import 'src/json_generator.dart'; 5 | import 'src/riverpod_generator.dart'; 6 | 7 | /// Builds generators for `build_runner` to run 8 | Builder riverpodBuilder(BuilderOptions options) { 9 | return SharedPartBuilder( 10 | [RiverpodGenerator(options.config), JsonGenerator()], 11 | 'riverpod', 12 | ); 13 | } 14 | -------------------------------------------------------------------------------- /packages/riverpod_generator/lib/src/templates/hash.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod_analyzer_utils/riverpod_analyzer_utils.dart'; 2 | 3 | import '../riverpod_generator.dart'; 4 | import 'template.dart'; 5 | 6 | class HashFnTemplate extends Template { 7 | HashFnTemplate(this.provider); 8 | 9 | final GeneratorProviderDeclaration provider; 10 | 11 | @override 12 | void run(StringBuffer buffer) { 13 | buffer.writeln( 14 | "String ${provider.hashFnName}() => r'${provider.computeProviderHash()}';\n", 15 | ); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/riverpod_generator/lib/src/templates/template.dart: -------------------------------------------------------------------------------- 1 | abstract class Template { 2 | void run(StringBuffer buffer); 3 | } 4 | -------------------------------------------------------------------------------- /packages/riverpod_generator/test/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../analysis_options.yaml 2 | analyzer: 3 | errors: 4 | # We have a tight constraint on Riverpod to use its internal APIs 5 | invalid_use_of_internal_member: ignore 6 | -------------------------------------------------------------------------------- /packages/riverpod_generator/test/auto_dispose_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:test/test.dart'; 2 | import 'integration/auto_dispose.dart'; 3 | 4 | void main() { 5 | test('Respects keepAlive parameter', () { 6 | expect(keepAliveProvider.isAutoDispose, isFalse); 7 | expect(notKeepAliveProvider.isAutoDispose, isTrue); 8 | expect(defaultKeepAliveProvider.isAutoDispose, isTrue); 9 | }); 10 | } 11 | -------------------------------------------------------------------------------- /packages/riverpod_generator/test/integration/hash/hash1.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 2 | 3 | part 'hash1.g.dart'; 4 | 5 | @riverpod 6 | String simple(Ref ref) { 7 | return 'Hello world'; 8 | } 9 | 10 | @riverpod 11 | String simple2(Ref ref) { 12 | return 'Hello world2'; 13 | } 14 | 15 | @riverpod 16 | class SimpleClass extends _$SimpleClass { 17 | @override 18 | String build() => 'Hello world'; 19 | } 20 | -------------------------------------------------------------------------------- /packages/riverpod_generator/test/integration/hash/retry.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 2 | 3 | part 'retry.g.dart'; 4 | 5 | @Riverpod(retry: myRetry) 6 | String a(Ref ref) => throw UnimplementedError(); 7 | 8 | Duration? myRetry(int retryCount, Object error) => null; 9 | Duration? myRetry2(int retryCount, Object error) => null; 10 | 11 | @Riverpod(retry: myRetry2) 12 | String b(Ref ref, int arg) => throw UnimplementedError(); 13 | -------------------------------------------------------------------------------- /packages/riverpod_generator/test/integration/scopes.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 2 | 3 | part 'scopes.g.dart'; 4 | 5 | @riverpod 6 | class ScopedClass extends _$ScopedClass { 7 | @override 8 | int build(); 9 | } 10 | 11 | @riverpod 12 | class ScopedClassFamily extends _$ScopedClassFamily { 13 | @override 14 | int build(int a); 15 | } 16 | -------------------------------------------------------------------------------- /packages/riverpod_generator/test/integration/split.dart: -------------------------------------------------------------------------------- 1 | // Regression test for https://github.com/rrousselGit/riverpod/issues/2175 2 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 3 | 4 | part 'split2.dart'; 5 | part 'split.g.dart'; 6 | 7 | @riverpod 8 | int counter2(Ref ref) => 0; 9 | -------------------------------------------------------------------------------- /packages/riverpod_generator/test/integration/split2.dart: -------------------------------------------------------------------------------- 1 | part of 'split.dart'; 2 | 3 | @riverpod 4 | int counter(Ref ref) => 0; 5 | -------------------------------------------------------------------------------- /packages/riverpod_generator/test/retry_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:test/test.dart'; 2 | 3 | import 'integration/hash/retry.dart'; 4 | 5 | void main() { 6 | test('Passes retry', () { 7 | expect(aProvider.retry, myRetry); 8 | 9 | expect(bProvider.retry, myRetry2); 10 | expect(bProvider(42).retry, myRetry2); 11 | }); 12 | } 13 | -------------------------------------------------------------------------------- /packages/riverpod_graph/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.0.2 - 2023-08-03 2 | 3 | Support analyzer 6.0.0 4 | -------------------------------------------------------------------------------- /packages/riverpod_graph/lib/riverpod_graph.dart: -------------------------------------------------------------------------------- 1 | export 'package:riverpod_graph/src/analyze.dart' 2 | show 3 | analyze, 4 | rawNewline, 5 | graph, 6 | verifyRootDirectoryExists, 7 | SupportFormat, 8 | ProviderGraph, 9 | ConsumerWidgetNode, 10 | ConsumerWidgetVisitor, 11 | ProviderNode, 12 | ProviderDependencyVisitor, 13 | parseProviderFromExpression; 14 | -------------------------------------------------------------------------------- /packages/riverpod_graph/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: riverpod_graph 2 | version: 0.0.2 3 | homepage: https://riverpod.dev 4 | repository: https://github.com/rrousselGit/riverpod 5 | publish_to: none 6 | issue_tracker: https://github.com/rrousselGit/riverpod/issues 7 | funding: 8 | - https://github.com/sponsors/rrousselGit/ 9 | 10 | environment: 11 | sdk: ^3.6.0 12 | 13 | resolution: workspace 14 | 15 | dependencies: 16 | analyzer: ^7.0.0 17 | args: ^2.4.0 18 | collection: ^1.0.0 19 | path: ^1.8.2 20 | 21 | dev_dependencies: 22 | test: ^1.21.4 23 | test_process: ^2.0.2 24 | 25 | executables: 26 | riverpod_graph: 27 | -------------------------------------------------------------------------------- /packages/riverpod_graph/test/integration/addition/golden/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: riverpod_graph_golden_addition 2 | publish_to: none 3 | 4 | environment: 5 | sdk: ^3.6.0 6 | 7 | resolution: workspace 8 | 9 | dependencies: 10 | riverpod: 11 | -------------------------------------------------------------------------------- /packages/riverpod_graph/test/integration/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../../../../analysis_options.yaml 2 | 3 | linter: 4 | rules: 5 | public_member_api_docs: false -------------------------------------------------------------------------------- /packages/riverpod_graph/test/integration/consumer_widget/golden/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: riverpod_graph_golden_consumer_widget 2 | description: A new Flutter project. 3 | 4 | publish_to: "none" 5 | 6 | environment: 7 | sdk: ^3.6.0 8 | flutter: ">=1.17.0" 9 | 10 | resolution: workspace 11 | 12 | dependencies: 13 | cupertino_icons: ^1.0.2 14 | flutter: 15 | sdk: flutter 16 | flutter_riverpod: 17 | riverpod: 18 | 19 | dev_dependencies: 20 | flutter_test: 21 | sdk: flutter 22 | 23 | flutter: 24 | uses-material-design: true 25 | -------------------------------------------------------------------------------- /packages/riverpod_graph/test/integration/generated/golden/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: riverpod_graph_golden_generated 2 | description: A new Flutter project. 3 | 4 | publish_to: "none" 5 | 6 | environment: 7 | sdk: ^3.6.0 8 | flutter: ">=1.17.0" 9 | 10 | resolution: workspace 11 | 12 | dependencies: 13 | cupertino_icons: ^1.0.2 14 | flutter: 15 | sdk: flutter 16 | flutter_riverpod: 17 | riverpod: 18 | riverpod_annotation: 19 | 20 | dev_dependencies: 21 | build_runner: ^2.2.0 22 | flutter_test: 23 | sdk: flutter 24 | riverpod_generator: 25 | 26 | flutter: 27 | uses-material-design: true 28 | -------------------------------------------------------------------------------- /packages/riverpod_lint/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../../analysis_options.yaml 2 | linter: 3 | rules: 4 | # Riverpod_lint has no public API 5 | public_member_api_docs: false 6 | -------------------------------------------------------------------------------- /packages/riverpod_lint/resources/convert_to_class_provider.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/packages/riverpod_lint/resources/convert_to_class_provider.gif -------------------------------------------------------------------------------- /packages/riverpod_lint/resources/convert_to_consumer_widget.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/packages/riverpod_lint/resources/convert_to_consumer_widget.gif -------------------------------------------------------------------------------- /packages/riverpod_lint/resources/convert_to_functional_provider.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/packages/riverpod_lint/resources/convert_to_functional_provider.gif -------------------------------------------------------------------------------- /packages/riverpod_lint/resources/convert_to_stateful_consumer.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/packages/riverpod_lint/resources/convert_to_stateful_consumer.gif -------------------------------------------------------------------------------- /packages/riverpod_lint/resources/wrap_with_consumer.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/packages/riverpod_lint/resources/wrap_with_consumer.gif -------------------------------------------------------------------------------- /packages/riverpod_lint/resources/wrap_with_provider_scope.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/packages/riverpod_lint/resources/wrap_with_provider_scope.gif -------------------------------------------------------------------------------- /packages/riverpod_lint_flutter_test/README.md: -------------------------------------------------------------------------------- 1 | ## Updating golden tests 2 | 3 | This folder uses snapshot testing. 4 | To update the "snapshots"/"goldens", run: 5 | 6 | ```sh 7 | goldens=true dart test 8 | ``` -------------------------------------------------------------------------------- /packages/riverpod_lint_flutter_test/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | plugins: 3 | - custom_lint 4 | exclude: 5 | # Files with errors on purpose 6 | - test/lints/notifier_extends/notifier_extends.g.dart 7 | - test/lints/functional_ref/functional_ref.g.dart 8 | - test/lints/functional_ref/fix/auto_import.g.dart 9 | - test/lints/functional_ref/fix/use_prefix.g.dart 10 | 11 | custom_lint: 12 | debug: true 13 | -------------------------------------------------------------------------------- /packages/riverpod_lint_flutter_test/build.yaml: -------------------------------------------------------------------------------- 1 | targets: 2 | $default: 3 | builders: 4 | riverpod_generator: 5 | generate_for: 6 | exclude: 7 | # Those files voluntarily have the generation fail 8 | - test/lints/notifier_build.dart 9 | - test/lints/riverpod_syntax_error.dart 10 | - test/lints/functional_ref/failing_functional_ref.dart 11 | - test/lints/notifier_extends/failing_notifier_extends.dart -------------------------------------------------------------------------------- /packages/riverpod_lint_flutter_test/pubspec_overrides.yaml: -------------------------------------------------------------------------------- 1 | # Needed for custom_lint 2 | dependency_overrides: 3 | flutter_riverpod: 4 | path: ../flutter_riverpod 5 | hooks_riverpod: 6 | path: ../hooks_riverpod 7 | riverpod: 8 | path: ../riverpod 9 | riverpod_analyzer_utils: 10 | path: ../riverpod_analyzer_utils 11 | riverpod_annotation: 12 | path: ../riverpod_annotation 13 | riverpod_generator: 14 | path: ../riverpod_generator 15 | riverpod_lint: 16 | path: ../riverpod_lint 17 | -------------------------------------------------------------------------------- /packages/riverpod_lint_flutter_test/test/assists/convert_functional_provider_to_class_based/convert_functional_provider_to_class_based.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 2 | 3 | part 'convert_functional_provider_to_class_based.g.dart'; 4 | 5 | /// Some comment 6 | @riverpod 7 | int example(Ref ref) => 0; 8 | 9 | /// Some comment 10 | @riverpod 11 | int exampleFamily(Ref ref, {required int a, String b = '42'}) { 12 | // Hello world 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /packages/riverpod_lint_flutter_test/test/io_utils.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:test/test.dart'; 4 | import 'package:path/path.dart'; 5 | 6 | File writeToTemporaryFile(String content) { 7 | final tempDir = Directory.systemTemp.createTempSync(); 8 | addTearDown(() => tempDir.deleteSync(recursive: true)); 9 | 10 | final file = File(join(tempDir.path, 'file.dart')) 11 | ..createSync(recursive: true) 12 | ..writeAsStringSync(content); 13 | 14 | return file; 15 | } 16 | -------------------------------------------------------------------------------- /packages/riverpod_lint_flutter_test/test/lints/functional_ref/failing_functional_ref.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 2 | 3 | @riverpod 4 | // expect_lint: functional_ref 5 | int refless() { 6 | return 0; 7 | } 8 | 9 | @riverpod 10 | int incorrectlyTyped( 11 | // expect_lint: functional_ref 12 | int ref, 13 | ) { 14 | return 0; 15 | } 16 | 17 | // Regression test for https://github.com/rrousselGit/riverpod/issues/2689 18 | @riverpod 19 | // expect_lint: functional_ref 20 | int noRefButArgs({int a = 42}) { 21 | return 0; 22 | } 23 | 24 | @riverpod 25 | int valid(Ref ref) => 0; 26 | -------------------------------------------------------------------------------- /packages/riverpod_lint_flutter_test/test/lints/functional_ref/fix/functional_ref.diff: -------------------------------------------------------------------------------- 1 | Message: `Type as Ref` 2 | Priority: 90 3 | Diff for file `test/lints/functional_ref/functional_ref.dart:8`: 4 | ``` 5 | int nameless( 6 | // expect_lint: functional_ref 7 | - ref, 8 | + Ref ref, 9 | ) { 10 | return 0; 11 | ``` 12 | --- 13 | -------------------------------------------------------------------------------- /packages/riverpod_lint_flutter_test/test/lints/functional_ref/functional_ref.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 2 | 3 | part 'functional_ref.g.dart'; 4 | 5 | @riverpod 6 | int nameless( 7 | // expect_lint: functional_ref 8 | ref, 9 | ) { 10 | return 0; 11 | } 12 | 13 | @riverpod 14 | int generics(Ref ref) => 0; 15 | 16 | @riverpod 17 | int valid(Ref ref) => 0; 18 | -------------------------------------------------------------------------------- /packages/riverpod_lint_flutter_test/test/lints/goldens/functional_ref/functional_ref_fix.diff: -------------------------------------------------------------------------------- 1 | Message: `Type as Ref` 2 | Priority: 90 3 | Diff for file `test/lints/functional_ref/functional_ref.dart:8`: 4 | ``` 5 | int nameless( 6 | // expect_lint: functional_ref 7 | - ref, 8 | + Ref ref, 9 | ) { 10 | return 0; 11 | ``` 12 | --- 13 | -------------------------------------------------------------------------------- /packages/riverpod_lint_flutter_test/test/lints/goldens/functional_ref/functional_ref_lint.md: -------------------------------------------------------------------------------- 1 | code: functional_ref 2 | severity: Severity.warning 3 | message: Functional providers must receive a ref matching the provider name as their first positional parameter. 4 | test/lints/functional_ref/functional_ref.dart:8:3 5 | 6 | ```dart 7 | int nameless( 8 | // expect_lint: functional_ref 9 | >>>ref<<<, 10 | ) { 11 | return 0; 12 | ``` 13 | -------------------------------------------------------------------------------- /packages/riverpod_lint_flutter_test/test/lints/goldens/notifier_build/notifier_build_fix.diff: -------------------------------------------------------------------------------- 1 | Message: `Add build method` 2 | Priority: 80 3 | Diff for file `test/lints/notifier_build.dart:12`: 4 | ``` 5 | @riverpod 6 | // expect_lint: notifier_build 7 | - class ExampleProvider1 extends _$ExampleProvider1 {} 8 | + class ExampleProvider1 extends _$ExampleProvider1 { 9 | + @override 10 | + dynamic build() { 11 | + // TODO: implement build 12 | + throw UnimplementedError(); 13 | + } 14 | + } 15 | 16 | @riverpod 17 | ``` 18 | --- 19 | -------------------------------------------------------------------------------- /packages/riverpod_lint_flutter_test/test/lints/goldens/notifier_build/notifier_build_lint.md: -------------------------------------------------------------------------------- 1 | code: notifier_build 2 | severity: Severity.error 3 | message: Classes annotated by `@riverpod` must have the `build` method 4 | test/lints/notifier_build.dart:12:7 5 | 6 | ```dart 7 | @riverpod 8 | // expect_lint: notifier_build 9 | class >>>ExampleProvider1<<< extends _$ExampleProvider1 {} 10 | 11 | @riverpod 12 | ``` 13 | -------------------------------------------------------------------------------- /packages/riverpod_lint_flutter_test/test/lints/goldens/riverpod_syntax_error/riverpod_syntax_error_lint.md: -------------------------------------------------------------------------------- 1 | code: riverpod_syntax_error 2 | severity: Severity.error 3 | message: Classes annotated with @riverpod cannot be abstract. 4 | test/lints/riverpod_syntax_error.dart:8:16 5 | 6 | ```dart 7 | @riverpod 8 | // expect_lint: riverpod_syntax_error 9 | abstract class >>>ExampleProvider1<<< extends _$ExampleProvider1 { 10 | int build() => 0; 11 | } 12 | ``` 13 | -------------------------------------------------------------------------------- /packages/riverpod_lint_flutter_test/test/lints/notifier_build.dart: -------------------------------------------------------------------------------- 1 | import 'package:hooks_riverpod/hooks_riverpod.dart'; 2 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 3 | 4 | /// Fake Provider 5 | typedef _$ExampleProvider1 = Object; 6 | 7 | /// Fake Provider 8 | typedef _$ExampleProvider = Notifier; 9 | 10 | @riverpod 11 | // expect_lint: notifier_build 12 | class ExampleProvider1 extends _$ExampleProvider1 {} 13 | 14 | @riverpod 15 | class ExampleProvider extends _$ExampleProvider { 16 | @override 17 | int build() => 0; 18 | } 19 | -------------------------------------------------------------------------------- /packages/riverpod_lint_flutter_test/test/lints/notifier_extends/failing_notifier_extends.dart: -------------------------------------------------------------------------------- 1 | import 'package:hooks_riverpod/hooks_riverpod.dart'; 2 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 3 | 4 | @riverpod 5 | // expect_lint: notifier_extends 6 | class NoExtends { 7 | int build() => 0; 8 | } 9 | 10 | @riverpod 11 | // expect_lint: notifier_extends 12 | class WrongExtends extends AsyncNotifier { 13 | int build() => 0; 14 | } 15 | -------------------------------------------------------------------------------- /packages/riverpod_lint_flutter_test/test/lints/provider_dependencies/another.dart: -------------------------------------------------------------------------------- 1 | import 'package:hooks_riverpod/hooks_riverpod.dart'; 2 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 3 | 4 | part 'another.g.dart'; 5 | 6 | final aProvider = Provider((ref) => 0); 7 | 8 | @riverpod 9 | int b(Ref ref) => 0; 10 | 11 | @Riverpod(dependencies: []) 12 | int anotherScoped(Ref ref) => 0; 13 | 14 | @Riverpod(dependencies: [anotherScoped]) 15 | int anotherNonEmptyScoped(Ref ref) { 16 | ref.watch(anotherScopedProvider); 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /packages/riverpod_lint_flutter_test/test/lints/riverpod_syntax_error.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 2 | 3 | /// Fake Provider 4 | typedef _$ExampleProvider1 = Object; 5 | 6 | @riverpod 7 | // expect_lint: riverpod_syntax_error 8 | abstract class ExampleProvider1 extends _$ExampleProvider1 { 9 | int build() => 0; 10 | } 11 | -------------------------------------------------------------------------------- /packages/riverpod_sqflite/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.1.1 - 2025-05-04 2 | 3 | - `riverpod` upgraded to `3.0.0-dev.15` 4 | 5 | ## 0.1.1 - 2023-05-02 6 | 7 | Bump dependencies 8 | 9 | ## 0.1.0 - 2025-05-02 10 | 11 | - `riverpod` upgraded to `3.0.0-dev.14` 12 | 13 | ## 0.1.0 - 2025-05-01 14 | 15 | - `riverpod` upgraded to `3.0.0-dev.13` 16 | 17 | Initial release -------------------------------------------------------------------------------- /packages/riverpod_sqflite/LICENSE: -------------------------------------------------------------------------------- 1 | ../../LICENSE -------------------------------------------------------------------------------- /packages/riverpod_sqflite/example/.gitignore: -------------------------------------------------------------------------------- 1 | linux 2 | macos 3 | windows 4 | .metadata 5 | -------------------------------------------------------------------------------- /packages/riverpod_sqflite/example/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../../../analysis_options.yaml 2 | 3 | linter: 4 | rules: 5 | public_member_api_docs: false 6 | -------------------------------------------------------------------------------- /packages/riverpod_sqflite/lib/riverpod_sqflite.dart: -------------------------------------------------------------------------------- 1 | export 'src/riverpod_sqflite.dart' show JsonSqFliteStorage; 2 | -------------------------------------------------------------------------------- /packages/riverpod_sqflite/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: riverpod_sqflite 2 | description: An adapter to connect riverpod_sqflite with Riverpod. 3 | version: 0.1.1 4 | environment: 5 | sdk: ^3.6.0 6 | 7 | resolution: workspace 8 | 9 | dependencies: 10 | clock: ^1.1.1 11 | collection: ^1.14.0 12 | meta: ^1.15.0 13 | riverpod: 3.0.0-dev.15 14 | sqflite: ^2.4.1 15 | test: ^1.25.8 16 | 17 | dev_dependencies: 18 | flutter_test: 19 | sdk: flutter 20 | sqflite_common_ffi: ^2.3.4+4 21 | -------------------------------------------------------------------------------- /resources/devtool_graph.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/resources/devtool_graph.jpeg -------------------------------------------------------------------------------- /resources/flutter_favorite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/resources/flutter_favorite.png -------------------------------------------------------------------------------- /resources/icon/Facebook Cover A.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/resources/icon/Facebook Cover A.png -------------------------------------------------------------------------------- /resources/icon/Instagaram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/resources/icon/Instagaram.png -------------------------------------------------------------------------------- /resources/icon/Linked In Cover A.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/resources/icon/Linked In Cover A.png -------------------------------------------------------------------------------- /resources/icon/Logo A1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/resources/icon/Logo A1.jpg -------------------------------------------------------------------------------- /resources/icon/Logo A1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/resources/icon/Logo A1.png -------------------------------------------------------------------------------- /resources/icon/Logo-A1-icon copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/resources/icon/Logo-A1-icon copy.png -------------------------------------------------------------------------------- /resources/icon/Logo-A1-icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/resources/icon/Logo-A1-icon.jpg -------------------------------------------------------------------------------- /resources/icon/Logo-A1-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/resources/icon/Logo-A1-icon.png -------------------------------------------------------------------------------- /resources/icon/Twitter Cover A.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/resources/icon/Twitter Cover A.png -------------------------------------------------------------------------------- /resources/icon/Youtube Cover A.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/resources/icon/Youtube Cover A.png -------------------------------------------------------------------------------- /resources/icon/vector file.eps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/resources/icon/vector file.eps -------------------------------------------------------------------------------- /scripts/coverage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Fast fail the script on failures. 4 | set -e 5 | 6 | dart pub global activate coverage 7 | 8 | dart pub global run coverage:test_with_coverage -------------------------------------------------------------------------------- /scripts/test_all.sh: -------------------------------------------------------------------------------- 1 | BASEDIR=$(dirname "$0") 2 | 3 | cd $BASEDIR/../packages/riverpod 4 | dart test 5 | cd ../flutter_riverpod 6 | flutter test --no-pub 7 | cd ../hooks_riverpod 8 | flutter test --no-pub -------------------------------------------------------------------------------- /tools/generate_providers/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: generate_providers 2 | publish_to: "none" 3 | 4 | environment: 5 | sdk: ^3.6.0 6 | 7 | resolution: workspace 8 | 9 | dependencies: 10 | dart_style: ^3.0.0 11 | trotter: ^2.0.0 12 | 13 | executables: 14 | generate_providers: 15 | -------------------------------------------------------------------------------- /website/.gitignore: -------------------------------------------------------------------------------- 1 | macos 2 | linux 3 | web 4 | windows 5 | android 6 | ios 7 | test 8 | 9 | # Dependencies 10 | /node_modules 11 | 12 | # Production 13 | /build 14 | 15 | # Generated files 16 | .docusaurus 17 | .cache-loader 18 | 19 | # Misc 20 | .DS_Store 21 | .env.local 22 | .env.development.local 23 | .env.test.local 24 | .env.production.local 25 | 26 | npm-debug.log* 27 | yarn-debug.log* 28 | yarn-error.log* 29 | /.yarn 30 | .yarnrc.yml -------------------------------------------------------------------------------- /website/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../analysis_options.yaml 2 | analyzer: 3 | exclude: 4 | - build/** 5 | - i18n/** 6 | errors: 7 | todo: ignore 8 | plugins: 9 | - custom_lint 10 | -------------------------------------------------------------------------------- /website/build.yaml: -------------------------------------------------------------------------------- 1 | targets: 2 | $default: 3 | sources: 4 | - $package$ 5 | - lib/$lib$ 6 | - docs/** 7 | - static/** 8 | builders: 9 | riverpod_generator: 10 | enabled: true 11 | source_gen:combining_builder: 12 | options: 13 | ignore_for_file: 14 | - non_constant_identifier_names 15 | -------------------------------------------------------------------------------- /website/docs/advanced/select/select/index.ts: -------------------------------------------------------------------------------- 1 | import raw from '!!raw-loader!./raw.dart'; 2 | import codegen from '!!raw-loader!./codegen.dart'; 3 | 4 | export default { raw, codegen }; 5 | -------------------------------------------------------------------------------- /website/docs/advanced/select/select_async/index.ts: -------------------------------------------------------------------------------- 1 | import raw from '!!raw-loader!./raw.dart'; 2 | import codegen from '!!raw-loader!./codegen.dart'; 3 | 4 | export default { raw, codegen }; 5 | -------------------------------------------------------------------------------- /website/docs/case_studies/cancel/detail_screen/index.ts: -------------------------------------------------------------------------------- 1 | import raw from '!!raw-loader!./raw.dart'; 2 | import codegen from '!!raw-loader!./codegen.dart'; 3 | 4 | export default { raw, codegen }; 5 | -------------------------------------------------------------------------------- /website/docs/case_studies/cancel/detail_screen_cancel/index.ts: -------------------------------------------------------------------------------- 1 | import raw from '!!raw-loader!./raw.dart'; 2 | import codegen from '!!raw-loader!./codegen.dart'; 3 | 4 | export default { raw, codegen }; 5 | -------------------------------------------------------------------------------- /website/docs/case_studies/cancel/detail_screen_debounce/index.ts: -------------------------------------------------------------------------------- 1 | import raw from '!!raw-loader!./raw.dart'; 2 | import codegen from '!!raw-loader!./codegen.dart'; 3 | 4 | export default { raw, codegen }; 5 | -------------------------------------------------------------------------------- /website/docs/case_studies/cancel/provider_with_extension/index.ts: -------------------------------------------------------------------------------- 1 | import raw from '!!raw-loader!./raw.dart'; 2 | import codegen from '!!raw-loader!./codegen.dart'; 3 | 4 | export default { raw, codegen }; 5 | -------------------------------------------------------------------------------- /website/docs/case_studies/pull_to_refresh/activity/codegen.dart: -------------------------------------------------------------------------------- 1 | import 'package:freezed_annotation/freezed_annotation.dart'; 2 | 3 | part 'codegen.g.dart'; 4 | part 'codegen.freezed.dart'; 5 | 6 | /* SNIPPET START */ 7 | @freezed 8 | sealed class Activity with _$Activity { 9 | factory Activity({ 10 | required String activity, 11 | required String type, 12 | required int participants, 13 | required double price, 14 | }) = _Activity; 15 | 16 | factory Activity.fromJson(Map json) => 17 | _$ActivityFromJson(json); 18 | } 19 | /* SNIPPET END */ 20 | -------------------------------------------------------------------------------- /website/docs/case_studies/pull_to_refresh/activity/index.ts: -------------------------------------------------------------------------------- 1 | import raw from '!!raw-loader!./raw.dart'; 2 | import codegen from '!!raw-loader!./codegen.dart'; 3 | 4 | export default { raw, codegen }; 5 | -------------------------------------------------------------------------------- /website/docs/case_studies/pull_to_refresh/fetch_activity/codegen.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:http/http.dart' as http; 4 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 5 | 6 | import '../activity/codegen.dart'; 7 | 8 | part 'codegen.g.dart'; 9 | 10 | /* SNIPPET START */ 11 | @riverpod 12 | Future activity(Ref ref) async { 13 | final response = await http.get( 14 | Uri.https('www.boredapi.com', '/api/activity'), 15 | ); 16 | 17 | final json = jsonDecode(response.body) as Map; 18 | return Activity.fromJson(Map.from(json)); 19 | } 20 | /* SNIPPET END */ 21 | -------------------------------------------------------------------------------- /website/docs/case_studies/pull_to_refresh/fetch_activity/index.ts: -------------------------------------------------------------------------------- 1 | import raw from '!!raw-loader!./raw.dart'; 2 | import codegen from '!!raw-loader!./codegen.dart'; 3 | 4 | export default { raw, codegen }; 5 | -------------------------------------------------------------------------------- /website/docs/case_studies/pull_to_refresh/fetch_activity/raw.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:http/http.dart' as http; 4 | import 'package:riverpod/riverpod.dart'; 5 | 6 | import '../activity/raw.dart'; 7 | 8 | /* SNIPPET START */ 9 | final activityProvider = FutureProvider.autoDispose((ref) async { 10 | final response = await http.get( 11 | Uri.https('www.boredapi.com', '/api/activity'), 12 | ); 13 | 14 | final json = jsonDecode(response.body) as Map; 15 | return Activity.fromJson(json); 16 | }); 17 | /* SNIPPET END */ 18 | -------------------------------------------------------------------------------- /website/docs/case_studies/pull_to_refresh/full_app/index.ts: -------------------------------------------------------------------------------- 1 | import raw from '!!raw-loader!./raw.dart'; 2 | import codegen from '!!raw-loader!./codegen.dart'; 3 | 4 | export default { raw, codegen }; 5 | -------------------------------------------------------------------------------- /website/docs/concepts/about_codegen/provider_type/async_class_future.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 2 | 3 | part 'async_class_future.g.dart'; 4 | 5 | /* SNIPPET START */ 6 | @riverpod 7 | class Example extends _$Example { 8 | @override 9 | Future build() async { 10 | return Future.value('foo'); 11 | } 12 | 13 | // Add methods to mutate the state 14 | } 15 | -------------------------------------------------------------------------------- /website/docs/concepts/about_codegen/provider_type/async_class_stream.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 2 | 3 | part 'async_class_stream.g.dart'; 4 | 5 | /* SNIPPET START */ 6 | @riverpod 7 | class Example extends _$Example { 8 | @override 9 | Stream build() async* { 10 | yield 'foo'; 11 | } 12 | 13 | // Add methods to mutate the state 14 | } 15 | -------------------------------------------------------------------------------- /website/docs/concepts/about_codegen/provider_type/async_fn_future.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 2 | 3 | part 'async_fn_future.g.dart'; 4 | 5 | /* SNIPPET START */ 6 | @riverpod 7 | Future example(Ref ref) async { 8 | return Future.value('foo'); 9 | } 10 | -------------------------------------------------------------------------------- /website/docs/concepts/about_codegen/provider_type/async_fn_stream.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 2 | 3 | part 'async_fn_stream.g.dart'; 4 | 5 | /* SNIPPET START */ 6 | @riverpod 7 | Stream example(Ref ref) async* { 8 | yield 'foo'; 9 | } 10 | -------------------------------------------------------------------------------- /website/docs/concepts/about_codegen/provider_type/auto_dispose.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 2 | 3 | part 'auto_dispose.g.dart'; 4 | 5 | /* SNIPPET START */ 6 | // AutoDispose provider (keepAlive is false by default) 7 | @riverpod 8 | String example1(Ref ref) => 'foo'; 9 | 10 | // Non autoDispose provider 11 | @Riverpod(keepAlive: true) 12 | String example2(Ref ref) => 'foo'; 13 | -------------------------------------------------------------------------------- /website/docs/concepts/about_codegen/provider_type/family.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 2 | 3 | part 'family.g.dart'; 4 | 5 | /* SNIPPET START */ 6 | @riverpod 7 | String example(Ref ref, int param) => 'Hello $param'; 8 | -------------------------------------------------------------------------------- /website/docs/concepts/about_codegen/provider_type/family_class.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 2 | 3 | part 'family_class.g.dart'; 4 | 5 | /* SNIPPET START */ 6 | @riverpod 7 | class Example extends _$Example { 8 | @override 9 | String build( 10 | int param1, { 11 | String param2 = 'foo', 12 | }) { 13 | return 'Hello $param1 & $param2'; 14 | } 15 | 16 | // Add methods to mutate the state 17 | } 18 | -------------------------------------------------------------------------------- /website/docs/concepts/about_codegen/provider_type/family_fn.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 2 | 3 | part 'family_fn.g.dart'; 4 | 5 | /* SNIPPET START */ 6 | @riverpod 7 | String example( 8 | Ref ref, 9 | int param1, { 10 | String param2 = 'foo', 11 | }) { 12 | return 'Hello $param1 & $param2'; 13 | } 14 | -------------------------------------------------------------------------------- /website/docs/concepts/about_codegen/provider_type/non_code_gen/async_notifier_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 2 | 3 | /* SNIPPET START */ 4 | final exampleProvider = 5 | AsyncNotifierProvider.autoDispose( 6 | ExampleNotifier.new, 7 | ); 8 | 9 | class ExampleNotifier extends AsyncNotifier { 10 | @override 11 | Future build() async { 12 | return Future.value('foo'); 13 | } 14 | 15 | // Add methods to mutate the state 16 | } 17 | -------------------------------------------------------------------------------- /website/docs/concepts/about_codegen/provider_type/non_code_gen/auto_dispose.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 2 | 3 | /* SNIPPET START */ 4 | // autoDispose provider 5 | final example1Provider = Provider.autoDispose((ref) { 6 | return 'foo'; 7 | }); 8 | 9 | // non autoDispose provider 10 | final example2Provider = Provider((ref) { 11 | return 'foo'; 12 | }); 13 | -------------------------------------------------------------------------------- /website/docs/concepts/about_codegen/provider_type/non_code_gen/family.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 2 | 3 | /* SNIPPET START */ 4 | final exampleProvider = Provider.family((ref, param) { 5 | return 'Hello $param'; 6 | }); 7 | -------------------------------------------------------------------------------- /website/docs/concepts/about_codegen/provider_type/non_code_gen/future_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 2 | 3 | /* SNIPPET START */ 4 | final exampleProvider = 5 | FutureProvider.autoDispose((ref) async { 6 | return Future.value('foo'); 7 | }); 8 | -------------------------------------------------------------------------------- /website/docs/concepts/about_codegen/provider_type/non_code_gen/notifier_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 2 | 3 | /* SNIPPET START */ 4 | final exampleProvider = NotifierProvider.autoDispose( 5 | ExampleNotifier.new, 6 | ); 7 | 8 | class ExampleNotifier extends Notifier { 9 | @override 10 | String build() { 11 | return 'foo'; 12 | } 13 | 14 | // Add methods to mutate the state 15 | } 16 | -------------------------------------------------------------------------------- /website/docs/concepts/about_codegen/provider_type/non_code_gen/provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 2 | 3 | /* SNIPPET START */ 4 | final exampleProvider = Provider.autoDispose( 5 | (ref) { 6 | return 'foo'; 7 | }, 8 | ); 9 | -------------------------------------------------------------------------------- /website/docs/concepts/about_codegen/provider_type/non_code_gen/stream_notifier_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 2 | 3 | /* SNIPPET START */ 4 | final exampleProvider = 5 | StreamNotifierProvider.autoDispose(() { 6 | return ExampleNotifier(); 7 | }); 8 | 9 | class ExampleNotifier extends StreamNotifier { 10 | @override 11 | Stream build() async* { 12 | yield 'foo'; 13 | } 14 | 15 | // Add methods to mutate the state 16 | } 17 | -------------------------------------------------------------------------------- /website/docs/concepts/about_codegen/provider_type/non_code_gen/stream_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 2 | 3 | /* SNIPPET START */ 4 | final exampleProvider = 5 | StreamProvider.autoDispose((ref) async* { 6 | yield 'foo'; 7 | }); 8 | -------------------------------------------------------------------------------- /website/docs/concepts/about_codegen/provider_type/sync_class.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 2 | 3 | part 'sync_class.g.dart'; 4 | 5 | /* SNIPPET START */ 6 | @riverpod 7 | class Example extends _$Example { 8 | @override 9 | String build() { 10 | return 'foo'; 11 | } 12 | 13 | // Add methods to mutate the state 14 | } 15 | -------------------------------------------------------------------------------- /website/docs/concepts/about_codegen/provider_type/sync_fn.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 2 | 3 | part 'sync_fn.g.dart'; 4 | 5 | /* SNIPPET START */ 6 | @riverpod 7 | String example(Ref ref) { 8 | return 'foo'; 9 | } 10 | -------------------------------------------------------------------------------- /website/docs/concepts/about_codegen/raw.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: use_key_in_widget_constructors, omit_local_variable_types, avoid_unused_constructor_parameters 2 | 3 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 4 | 5 | class User { 6 | User.fromJson(Object obj); 7 | } 8 | 9 | class Http { 10 | Future get(String str) async => str; 11 | } 12 | 13 | final http = Http(); 14 | 15 | /* SNIPPET START */ 16 | final fetchUserProvider = FutureProvider.autoDispose.family((ref, userId) async { 17 | final json = await http.get('api/user/$userId'); 18 | return User.fromJson(json); 19 | }); 20 | -------------------------------------------------------------------------------- /website/docs/concepts/combining_provider_states/characters_provider/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./codegen.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/concepts/combining_provider_states/characters_provider/models.dart: -------------------------------------------------------------------------------- 1 | 2 | class Character { 3 | Character(); 4 | 5 | // ignore: avoid_unused_constructor_parameters 6 | factory Character.fromJson(Map json) { 7 | return Character(); 8 | } 9 | } 10 | 11 | class Configuration { 12 | Configuration({ 13 | this.host = '', 14 | }); 15 | 16 | final String host; 17 | } 18 | -------------------------------------------------------------------------------- /website/docs/concepts/combining_provider_states/city_provider/codegen.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 2 | 3 | part 'codegen.g.dart'; 4 | 5 | /* SNIPPET START */ 6 | @riverpod 7 | String city(Ref ref) => 'London'; 8 | -------------------------------------------------------------------------------- /website/docs/concepts/combining_provider_states/city_provider/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./codegen.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/concepts/combining_provider_states/city_provider/raw.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 2 | 3 | /* SNIPPET START */ 4 | final cityProvider = Provider((ref) => 'London'); 5 | -------------------------------------------------------------------------------- /website/docs/concepts/combining_provider_states/filtered_todo_list_provider/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./codegen.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/concepts/combining_provider_states/read_in_provider/codegen.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 2 | 3 | part 'codegen.g.dart'; 4 | 5 | @riverpod 6 | MyValue another(Ref ref) => MyValue(); 7 | 8 | class MyValue {} 9 | 10 | /* SNIPPET START */ 11 | 12 | @riverpod 13 | MyValue my(Ref ref) { 14 | // Bad practice to call `read` here 15 | final value = ref.read(anotherProvider); 16 | return value; 17 | } 18 | -------------------------------------------------------------------------------- /website/docs/concepts/combining_provider_states/read_in_provider/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./codegen.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/concepts/combining_provider_states/read_in_provider/raw.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 2 | 3 | final anotherProvider = Provider((ref) => MyValue()); 4 | 5 | class MyValue {} 6 | 7 | /* SNIPPET START */ 8 | 9 | final myProvider = Provider((ref) { 10 | // Bad practice to call `read` here 11 | final value = ref.read(anotherProvider); 12 | return value; 13 | }); 14 | -------------------------------------------------------------------------------- /website/docs/concepts/combining_provider_states/select_async_provider/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./codegen.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/concepts/combining_provider_states/select_async_provider/models.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: sort_constructors_first 2 | 3 | class Product { 4 | const Product({this.title = ''}); 5 | 6 | final String title; 7 | 8 | factory Product.fromJson(Map map) { 9 | return Product( 10 | title: map['title'] as String, 11 | ); 12 | } 13 | } 14 | 15 | class Configuration { 16 | Configuration({ 17 | this.host = '', 18 | }); 19 | 20 | final String host; 21 | } 22 | -------------------------------------------------------------------------------- /website/docs/concepts/combining_provider_states/todo_list_provider/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./codegen.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/concepts/combining_provider_states/weather_provider/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./codegen.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/concepts/combining_provider_states/whole_object_provider/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./codegen.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/concepts/combining_provider_states/whole_object_provider/models.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: avoid_unused_constructor_parameters 2 | 3 | class Product { 4 | Product(); 5 | factory Product.fromJson(Map json) { 6 | return Product(); 7 | } 8 | } 9 | 10 | class Configuration { 11 | Configuration({ 12 | this.host = '', 13 | }); 14 | 15 | final String host; 16 | } 17 | -------------------------------------------------------------------------------- /website/docs/concepts/lifecycle_on_dispose/codegen.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: unnecessary_lambdas 2 | 3 | import 'dart:async'; 4 | 5 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 6 | 7 | part 'codegen.g.dart'; 8 | 9 | /* SNIPPET START */ 10 | @riverpod 11 | Stream example(Ref ref) { 12 | final streamController = StreamController(); 13 | 14 | ref.onDispose(() { 15 | // Closes the StreamController when the state of this provider is destroyed. 16 | streamController.close(); 17 | }); 18 | 19 | return streamController.stream; 20 | } 21 | -------------------------------------------------------------------------------- /website/docs/concepts/lifecycle_on_dispose/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./codegen.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/concepts/lifecycle_on_dispose/raw.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: unnecessary_lambdas 2 | 3 | import 'dart:async'; 4 | 5 | import 'package:hooks_riverpod/hooks_riverpod.dart'; 6 | 7 | /* SNIPPET START */ 8 | final example = StreamProvider.autoDispose((ref) { 9 | final streamController = StreamController(); 10 | 11 | ref.onDispose(() { 12 | // Closes the StreamController when the state of this provider is destroyed. 13 | streamController.close(); 14 | }); 15 | 16 | return streamController.stream; 17 | }); 18 | -------------------------------------------------------------------------------- /website/docs/concepts/providers/creating_a_provider/codegen.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 2 | 3 | part 'codegen.g.dart'; 4 | 5 | class MyValue {} 6 | 7 | /* SNIPPET START */ 8 | 9 | @riverpod 10 | MyValue my(Ref ref) { 11 | return MyValue(); 12 | } 13 | -------------------------------------------------------------------------------- /website/docs/concepts/providers/creating_a_provider/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./codegen.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/concepts/providers/creating_a_provider/raw.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 2 | 3 | class MyValue {} 4 | 5 | /* SNIPPET START */ 6 | 7 | final myProvider = Provider((ref) { 8 | return MyValue(); 9 | }); 10 | -------------------------------------------------------------------------------- /website/docs/concepts/providers/declaring_many_providers/codegen.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 2 | 3 | part 'codegen.g.dart'; 4 | 5 | /* SNIPPET START */ 6 | 7 | @riverpod 8 | String city(Ref ref) => 'London'; 9 | @riverpod 10 | String country(Ref ref) => 'England'; 11 | -------------------------------------------------------------------------------- /website/docs/concepts/providers/declaring_many_providers/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./codegen.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/concepts/providers/declaring_many_providers/raw.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 2 | 3 | /* SNIPPET START */ 4 | 5 | final cityProvider = Provider((ref) => 'London'); 6 | final countryProvider = Provider((ref) => 'England'); 7 | -------------------------------------------------------------------------------- /website/docs/concepts/reading/consumer_stateful_widget/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import hooks from "!!raw-loader!./hooks.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: hooks, 7 | codegen: undefined, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/concepts/reading/consumer_widget/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import hooks from "!!raw-loader!./hooks.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: hooks, 7 | codegen: undefined, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/concepts/reading/consumer_widget/raw.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 3 | import '../counter/raw.dart'; 4 | 5 | /* SNIPPET START */ 6 | 7 | class HomeView extends ConsumerWidget { 8 | const HomeView({super.key}); 9 | 10 | @override 11 | Widget build(BuildContext context, WidgetRef ref) { 12 | // use ref to listen to a provider 13 | final counter = ref.watch(counterProvider); 14 | return Text('$counter'); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /website/docs/concepts/reading/counter/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./codegen.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/concepts/reading/listen/codegen.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: omit_local_variable_types, avoid_types_on_closure_parameters, avoid_print 2 | 3 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 4 | import '../counter/codegen.dart'; 5 | 6 | part 'codegen.g.dart'; 7 | 8 | /* SNIPPET START */ 9 | 10 | @riverpod 11 | void another(Ref ref) { 12 | ref.listen(counterProvider, (int? previousCount, int newCount) { 13 | print('The counter changed $newCount'); 14 | }); 15 | // ... 16 | } 17 | -------------------------------------------------------------------------------- /website/docs/concepts/reading/listen/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./codegen.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/concepts/reading/listen/raw.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: omit_local_variable_types, avoid_types_on_closure_parameters, avoid_print 2 | 3 | import 'package:riverpod/riverpod.dart'; 4 | import '../counter/raw.dart'; 5 | 6 | /* SNIPPET START */ 7 | 8 | final anotherProvider = Provider((ref) { 9 | ref.listen(counterProvider, (int? previousCount, int newCount) { 10 | print('The counter changed $newCount'); 11 | }); 12 | // ... 13 | }); 14 | -------------------------------------------------------------------------------- /website/docs/concepts/reading/listen_build/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./codegen.dart"; 3 | import raw_hooks from "!!raw-loader!./raw_hooks.dart"; 4 | import codegen_hooks from "!!raw-loader!./codegen_hooks.dart"; 5 | 6 | export default { 7 | raw, 8 | hooks: raw_hooks, 9 | codegen, 10 | hooksCodegen: codegen_hooks, 11 | }; 12 | -------------------------------------------------------------------------------- /website/docs/concepts/reading/provider/codegen.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: avoid_positional_boolean_parameters 2 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 3 | 4 | part 'codegen.g.dart'; 5 | 6 | class Repository { 7 | String get() => ''; 8 | } 9 | 10 | @riverpod 11 | Repository repository(Ref ref) => Repository(); 12 | 13 | /* SNIPPET START */ 14 | 15 | @riverpod 16 | String value(Ref ref) { 17 | // use ref to obtain other providers 18 | final repository = ref.watch(repositoryProvider); 19 | return repository.get(); 20 | } 21 | -------------------------------------------------------------------------------- /website/docs/concepts/reading/provider/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./codegen.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/concepts/reading/provider/raw.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: avoid_positional_boolean_parameters 2 | 3 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 4 | 5 | class Repository { 6 | void get() {} 7 | } 8 | 9 | final repositoryProvider = Provider((ref) { 10 | return Repository(); 11 | }); 12 | 13 | /* SNIPPET START */ 14 | 15 | final valueProvider = Provider((ref) { 16 | // use ref to obtain other providers 17 | final repository = ref.watch(repositoryProvider); 18 | return repository.get(); 19 | }); 20 | -------------------------------------------------------------------------------- /website/docs/concepts/reading/read/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import raw_hooks from "!!raw-loader!./raw_hooks.dart"; 3 | import codegen from "!!raw-loader!./codegen.dart"; 4 | import codegen_hooks from "!!raw-loader!./codegen_hooks.dart"; 5 | 6 | export default { 7 | raw, 8 | hooks: raw_hooks, 9 | codegen, 10 | hooksCodegen: codegen_hooks, 11 | }; 12 | -------------------------------------------------------------------------------- /website/docs/concepts/reading/read_build/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./codegen.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/concepts/reading/read_notifier_build/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./codegen.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/concepts/reading/watch/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./codegen.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/concepts/reading/watch_build/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./codegen.dart"; 3 | import raw_hooks from "!!raw-loader!./raw_hooks.dart"; 4 | import codegen_hooks from "!!raw-loader!./codegen_hooks.dart"; 5 | 6 | export default { 7 | raw, 8 | hooks: raw_hooks, 9 | codegen, 10 | hooksCodegen: codegen_hooks, 11 | }; 12 | -------------------------------------------------------------------------------- /website/docs/concepts/reading/watch_notifier_build/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./codegen.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/concepts/why_immutability/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./codegen.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/essentials/auto_dispose/cache_for_usage/codegen.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: unused_local_variable 2 | 3 | import 'package:http/http.dart' as http; 4 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 5 | 6 | import '../cache_for_extension.dart'; 7 | 8 | part 'codegen.g.dart'; 9 | 10 | /* SNIPPET START */ 11 | @riverpod 12 | Future example(Ref ref) async { 13 | // {@template cacheFor} 14 | /// Keeps the state alive for 5 minutes 15 | // {@endtemplate} 16 | ref.cacheFor(const Duration(minutes: 5)); 17 | 18 | return http.get(Uri.https('example.com')); 19 | } 20 | -------------------------------------------------------------------------------- /website/docs/essentials/auto_dispose/cache_for_usage/index.ts: -------------------------------------------------------------------------------- 1 | import raw from '!!raw-loader!./raw.dart'; 2 | import codegen from '!!raw-loader!./codegen.dart'; 3 | 4 | export default { raw, codegen }; 5 | -------------------------------------------------------------------------------- /website/docs/essentials/auto_dispose/cache_for_usage/raw.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: unused_local_variable 2 | 3 | import 'package:http/http.dart' as http; 4 | import 'package:riverpod/riverpod.dart'; 5 | 6 | import '../cache_for_extension.dart'; 7 | 8 | /* SNIPPET START */ 9 | final provider = FutureProvider.autoDispose((ref) async { 10 | // {@template cacheFor} 11 | /// Keeps the state alive for 5 minutes 12 | // {@endtemplate} 13 | ref.cacheFor(const Duration(minutes: 5)); 14 | 15 | return http.get(Uri.https('example.com')); 16 | }); 17 | /* SNIPPET END */ 18 | -------------------------------------------------------------------------------- /website/docs/essentials/auto_dispose/codegen_keep_alive.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 2 | 3 | part 'codegen_keep_alive.g.dart'; 4 | 5 | /* SNIPPET START */ 6 | // {@template keepAlive} 7 | // We can specify "keepAlive" in the annotation to disable 8 | // the automatic state destruction 9 | // {@endtemplate} 10 | @Riverpod(keepAlive: true) 11 | int example(Ref ref) { 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /website/docs/essentials/auto_dispose/invalidate_family_example/index.ts: -------------------------------------------------------------------------------- 1 | import raw from '!!raw-loader!./raw.dart'; 2 | import codegen from '!!raw-loader!./codegen.dart'; 3 | 4 | export default { raw, codegen }; 5 | -------------------------------------------------------------------------------- /website/docs/essentials/auto_dispose/keep_alive/index.ts: -------------------------------------------------------------------------------- 1 | import raw from '!!raw-loader!./raw.dart'; 2 | import codegen from '!!raw-loader!./codegen.dart'; 3 | 4 | export default { raw, codegen }; 5 | -------------------------------------------------------------------------------- /website/docs/essentials/auto_dispose/on_dispose_example/index.ts: -------------------------------------------------------------------------------- 1 | import raw from '!!raw-loader!./raw.dart'; 2 | import codegen from '!!raw-loader!./codegen.dart'; 3 | 4 | export default { raw, codegen }; 5 | -------------------------------------------------------------------------------- /website/docs/essentials/auto_dispose/raw_auto_dispose.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod/riverpod.dart'; 2 | 3 | /* SNIPPET START */ 4 | // {@template autoDispose} 5 | // We can specify autoDispose to enable automatic state destruction. 6 | // {@endtemplate} 7 | final provider = Provider.autoDispose((ref) { 8 | return 0; 9 | }); 10 | -------------------------------------------------------------------------------- /website/docs/essentials/combining_requests/functional_ref/codegen.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: unused_local_variable 2 | 3 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 4 | 5 | part 'codegen.g.dart'; 6 | 7 | @riverpod 8 | int other(Ref ref) => 0; 9 | 10 | /* SNIPPET START */ 11 | @riverpod 12 | int example(Ref ref) { 13 | // {@template provider} 14 | // "Ref" can be used here to read other providers 15 | // {@endtemplate} 16 | final otherValue = ref.watch(otherProvider); 17 | 18 | return 0; 19 | } 20 | /* SNIPPET END */ 21 | -------------------------------------------------------------------------------- /website/docs/essentials/combining_requests/functional_ref/index.ts: -------------------------------------------------------------------------------- 1 | import raw from '!!raw-loader!./raw.dart'; 2 | import codegen from '!!raw-loader!./codegen.dart'; 3 | 4 | export default { raw, codegen }; 5 | -------------------------------------------------------------------------------- /website/docs/essentials/combining_requests/functional_ref/raw.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: unused_local_variable 2 | 3 | import 'package:riverpod/riverpod.dart'; 4 | 5 | final otherProvider = Provider((ref) => 0); 6 | 7 | /* SNIPPET START */ 8 | final provider = Provider((ref) { 9 | // {@template provider} 10 | // "Ref" can be used here to read other providers 11 | // {@endtemplate} 12 | final otherValue = ref.watch(otherProvider); 13 | 14 | return 0; 15 | }); 16 | /* SNIPPET END */ 17 | -------------------------------------------------------------------------------- /website/docs/essentials/combining_requests/listen_example/codegen.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: unused_local_variable, avoid_print 2 | 3 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 4 | 5 | part 'codegen.g.dart'; 6 | 7 | @riverpod 8 | int other(Ref ref) => 0; 9 | 10 | /* SNIPPET START */ 11 | @riverpod 12 | int example(Ref ref) { 13 | ref.listen(otherProvider, (previous, next) { 14 | print('Changed from: $previous, next: $next'); 15 | }); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /website/docs/essentials/combining_requests/listen_example/index.ts: -------------------------------------------------------------------------------- 1 | import raw from '!!raw-loader!./raw.dart'; 2 | import codegen from '!!raw-loader!./codegen.dart'; 3 | 4 | export default { raw, codegen }; 5 | -------------------------------------------------------------------------------- /website/docs/essentials/combining_requests/listen_example/raw.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: unused_local_variable, avoid_print 2 | import 'package:riverpod/riverpod.dart'; 3 | 4 | final otherProvider = Provider((ref) => 0); 5 | 6 | /* SNIPPET START */ 7 | final provider = Provider((ref) { 8 | ref.listen(otherProvider, (previous, next) { 9 | print('Changed from: $previous, next: $next'); 10 | }); 11 | 12 | return 0; 13 | }); 14 | -------------------------------------------------------------------------------- /website/docs/essentials/combining_requests/notifier_ref/codegen.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: unused_local_variable 2 | 3 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 4 | 5 | part 'codegen.g.dart'; 6 | 7 | @riverpod 8 | int other(Ref ref) => 0; 9 | 10 | /* SNIPPET START */ 11 | @riverpod 12 | class Example extends _$Example { 13 | @override 14 | int build() { 15 | // {@template watch} 16 | // "Ref" can be used here to read other providers 17 | // {@endtemplate} 18 | final otherValue = ref.watch(otherProvider); 19 | 20 | return 0; 21 | } 22 | } 23 | /* SNIPPET END */ 24 | -------------------------------------------------------------------------------- /website/docs/essentials/combining_requests/notifier_ref/index.ts: -------------------------------------------------------------------------------- 1 | import raw from '!!raw-loader!./raw.dart'; 2 | import codegen from '!!raw-loader!./codegen.dart'; 3 | 4 | export default { raw, codegen }; 5 | -------------------------------------------------------------------------------- /website/docs/essentials/combining_requests/read_example/index.ts: -------------------------------------------------------------------------------- 1 | import raw from '!!raw-loader!./raw.dart'; 2 | import codegen from '!!raw-loader!./codegen.dart'; 3 | 4 | export default { raw, codegen }; 5 | -------------------------------------------------------------------------------- /website/docs/essentials/combining_requests/watch_example/index.ts: -------------------------------------------------------------------------------- 1 | import raw from '!!raw-loader!./raw.dart'; 2 | import codegen from '!!raw-loader!./codegen.dart'; 3 | 4 | export default { raw, codegen }; 5 | -------------------------------------------------------------------------------- /website/docs/essentials/combining_requests/watch_placement/index.ts: -------------------------------------------------------------------------------- 1 | import raw from '!!raw-loader!./raw.dart'; 2 | import codegen from '!!raw-loader!./codegen.dart'; 3 | 4 | export default { raw, codegen }; 5 | -------------------------------------------------------------------------------- /website/docs/essentials/eager_initialization/require_value/index.ts: -------------------------------------------------------------------------------- 1 | import raw from '!!raw-loader!./raw.dart'; 2 | import codegen from '!!raw-loader!./codegen.dart'; 3 | 4 | export default { raw, codegen }; 5 | -------------------------------------------------------------------------------- /website/docs/essentials/first_request/activity.ts: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw/activity.dart"; 2 | import codegen from "!!raw-loader!./codegen/activity.dart"; 3 | 4 | export default { 5 | raw: raw, 6 | hooks: undefined, 7 | codegen: codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/essentials/first_request/consumer.ts: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw/consumer.dart"; 2 | 3 | export default { 4 | raw: raw, 5 | hooks: undefined, 6 | codegen: undefined, 7 | hooksCodegen: undefined, 8 | }; 9 | -------------------------------------------------------------------------------- /website/docs/essentials/first_request/consumer_stateful_widget.ts: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw/consumer_stateful_widget.dart"; 2 | 3 | export default { 4 | raw: raw, 5 | hooks: undefined, 6 | codegen: undefined, 7 | hooksCodegen: undefined, 8 | }; 9 | -------------------------------------------------------------------------------- /website/docs/essentials/first_request/consumer_widget.ts: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw/consumer_widget.dart"; 2 | 3 | export default { 4 | raw: raw, 5 | hooks: undefined, 6 | codegen: undefined, 7 | hooksCodegen: undefined, 8 | }; 9 | -------------------------------------------------------------------------------- /website/docs/essentials/first_request/hook_consumer_widget.ts: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw/hook_consumer_widget.dart"; 2 | 3 | export default { 4 | raw: raw, 5 | hooks: undefined, 6 | codegen: undefined, 7 | hooksCodegen: undefined, 8 | }; 9 | -------------------------------------------------------------------------------- /website/docs/essentials/first_request/legend/DocuCode.scss: -------------------------------------------------------------------------------- 1 | .legend { 2 | table, 3 | td, 4 | tr { 5 | background: none !important; 6 | border: none; 7 | 8 | vertical-align: top; 9 | } 10 | 11 | td:first-child { 12 | text-align: end; 13 | } 14 | 15 | tr + tr { 16 | border-top: solid 0.5px; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /website/docs/essentials/first_request/provider.ts: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw/provider.dart"; 2 | import codegen from "!!raw-loader!./codegen/provider.dart"; 3 | 4 | export default { 5 | raw: raw, 6 | hooks: undefined, 7 | codegen: codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/essentials/passing_args/family/index.ts: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./codegen.dart"; 3 | 4 | export default { 5 | raw: raw, 6 | hooks: undefined, 7 | codegen: codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/essentials/passing_args/no_arg_provider/index.ts: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./codegen.dart"; 3 | 4 | export default { 5 | raw: raw, 6 | hooks: undefined, 7 | codegen: codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/essentials/side_effects/render_add_todo.ts: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw/render_add_todo.dart"; 2 | import hooks from "!!raw-loader!./raw/render_add_todo_hooks.dart"; 3 | 4 | export default { 5 | raw: raw, 6 | hooks: hooks, 7 | codegen: undefined, 8 | hooksCodegen: undefined, 9 | }; -------------------------------------------------------------------------------- /website/docs/essentials/side_effects/todo_list_notifier.ts: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw/todo_list_notifier.dart"; 2 | import codegen from "!!raw-loader!./codegen/todo_list_notifier.dart"; 3 | 4 | export default { 5 | raw: raw, 6 | hooks: undefined, 7 | codegen: codegen, 8 | hooksCodegen: undefined, 9 | }; -------------------------------------------------------------------------------- /website/docs/essentials/side_effects/todo_list_notifier_add_todo.ts: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw/todo_list_notifier_add_todo.dart"; 2 | import codegen from "!!raw-loader!./codegen/todo_list_notifier_add_todo.dart"; 3 | 4 | export default { 5 | raw: raw, 6 | hooks: undefined, 7 | codegen: codegen, 8 | hooksCodegen: undefined, 9 | }; -------------------------------------------------------------------------------- /website/docs/essentials/side_effects/todo_list_provider.ts: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw/todo_list_provider.dart"; 2 | import codegen from "!!raw-loader!./codegen/todo_list_provider.dart"; 3 | 4 | export default { 5 | raw: raw, 6 | codegen: codegen, 7 | }; 8 | -------------------------------------------------------------------------------- /website/docs/essentials/testing/notifier_mock/index.ts: -------------------------------------------------------------------------------- 1 | import raw from '!!raw-loader!./raw.dart'; 2 | import codegen from '!!raw-loader!./codegen.dart'; 3 | 4 | export default { raw, codegen }; 5 | -------------------------------------------------------------------------------- /website/docs/essentials/testing/notifier_mock/raw.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: prefer_mixin 2 | 3 | import 'package:hooks_riverpod/hooks_riverpod.dart'; 4 | import 'package:mockito/mockito.dart'; 5 | 6 | /* SNIPPET START */ 7 | class MyNotifier extends Notifier { 8 | @override 9 | int build() => throw UnimplementedError(); 10 | } 11 | 12 | // {@template mock} 13 | // Your mock needs to subclass the Notifier base-class corresponding 14 | // to whatever your notifier uses 15 | // {@endtemplate} 16 | class MyNotifierMock extends Notifier with Mock implements MyNotifier {} 17 | /* SNIPPET END */ 18 | -------------------------------------------------------------------------------- /website/docs/essentials/testing/provider_to_mock/codegen.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 2 | 3 | part 'codegen.g.dart'; 4 | 5 | /* SNIPPET START */ 6 | // {@template provider} 7 | // An eagerly initialized provider. 8 | // {@endtemplate} 9 | @riverpod 10 | Future example(Ref ref) async => 'Hello world'; 11 | /* SNIPPET END */ 12 | -------------------------------------------------------------------------------- /website/docs/essentials/testing/provider_to_mock/index.ts: -------------------------------------------------------------------------------- 1 | import raw from '!!raw-loader!./raw.dart'; 2 | import codegen from '!!raw-loader!./codegen.dart'; 3 | 4 | export default { raw, codegen }; 5 | -------------------------------------------------------------------------------- /website/docs/essentials/testing/provider_to_mock/raw.dart: -------------------------------------------------------------------------------- 1 | import 'package:hooks_riverpod/hooks_riverpod.dart'; 2 | 3 | /* SNIPPET START */ 4 | // {@template provider} 5 | // An eagerly initialized provider. 6 | // {@endtemplate} 7 | final exampleProvider = FutureProvider((ref) async => 'Hello world'); 8 | /* SNIPPET END */ 9 | -------------------------------------------------------------------------------- /website/docs/essentials/testing/widget_container_of.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: unused_local_variable 2 | 3 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 4 | import 'package:flutter_test/flutter_test.dart'; 5 | 6 | import 'widget_test.dart'; 7 | 8 | void main() { 9 | testWidgets('Some description', (tester) async { 10 | /* SNIPPET START */ 11 | final element = tester.element(find.byType(YourWidgetYouWantToTest)); 12 | final container = ProviderScope.containerOf(element); 13 | /* SNIPPET END */ 14 | }); 15 | } 16 | -------------------------------------------------------------------------------- /website/docs/essentials/websockets_sync/change_notifier_provider.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: omit_local_variable_types 2 | 3 | import 'package:flutter/widgets.dart'; 4 | import 'package:flutter_riverpod/legacy.dart'; 5 | 6 | /* SNIPPET START */ 7 | final myProvider = ChangeNotifierProvider>((ref) { 8 | // {@template provider} 9 | // Will listen to and dispose of the ValueNotifier. 10 | // Widgets can then "ref.watch" this provider to listen to updates. 11 | // {@endtemplate} 12 | return ValueNotifier(0); 13 | }); 14 | -------------------------------------------------------------------------------- /website/docs/essentials/websockets_sync/stream_provider/index.ts: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./codegen.dart"; 3 | 4 | export default { raw, codegen }; 5 | -------------------------------------------------------------------------------- /website/docs/essentials/websockets_sync/sync_definition/codegen.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 2 | 3 | part 'codegen.g.dart'; 4 | 5 | /* SNIPPET START */ 6 | @riverpod 7 | int synchronousExample(Ref ref) { 8 | return 0; 9 | } 10 | /* SNIPPET END */ 11 | -------------------------------------------------------------------------------- /website/docs/essentials/websockets_sync/sync_definition/index.ts: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./codegen.dart"; 3 | 4 | export default { raw, codegen }; 5 | -------------------------------------------------------------------------------- /website/docs/essentials/websockets_sync/sync_definition/raw.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod/riverpod.dart'; 2 | 3 | /* SNIPPET START */ 4 | final synchronousExampleProvider = Provider.autoDispose((ref) { 5 | return 0; 6 | }); 7 | /* SNIPPET END */ 8 | -------------------------------------------------------------------------------- /website/docs/from_provider/family/family.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 4 | 5 | part 'family.g.dart'; 6 | /* SNIPPET START */ 7 | 8 | @riverpod 9 | int random(Ref ref, {required int seed, required int max}) { 10 | return Random(seed).nextInt(max); 11 | } 12 | -------------------------------------------------------------------------------- /website/docs/from_provider/family/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./family.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/from_provider/helpers/item.dart: -------------------------------------------------------------------------------- 1 | import 'package:freezed_annotation/freezed_annotation.dart'; 2 | 3 | import 'json.dart'; 4 | 5 | part 'item.freezed.dart'; 6 | part 'item.g.dart'; 7 | 8 | @freezed 9 | sealed class Item with _$Item { 10 | const factory Item({required int id}) = _Item; 11 | factory Item.fromJson(Json json) => _$ItemFromJson(json); 12 | } 13 | -------------------------------------------------------------------------------- /website/docs/from_provider/helpers/item.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | // ignore_for_file: non_constant_identifier_names 4 | 5 | part of 'item.dart'; 6 | 7 | // ************************************************************************** 8 | // JsonSerializableGenerator 9 | // ************************************************************************** 10 | 11 | _Item _$ItemFromJson(Map json) => _Item( 12 | id: (json['id'] as num).toInt(), 13 | ); 14 | 15 | Map _$ItemToJson(_Item instance) => { 16 | 'id': instance.id, 17 | }; 18 | -------------------------------------------------------------------------------- /website/docs/from_provider/helpers/json.dart: -------------------------------------------------------------------------------- 1 | typedef Json = Map; 2 | -------------------------------------------------------------------------------- /website/docs/from_provider/motivation/async_values/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./async_values.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/from_provider/motivation/auto_dispose/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./auto_dispose.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/from_provider/motivation/combine/combine.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 4 | 5 | part 'combine.g.dart'; 6 | 7 | /* SNIPPET START */ 8 | 9 | @riverpod 10 | int number(Ref ref) { 11 | return Random().nextInt(10); 12 | } 13 | 14 | @riverpod 15 | int doubled(Ref ref) { 16 | final number = ref.watch(numberProvider); 17 | 18 | return number * 2; 19 | } 20 | -------------------------------------------------------------------------------- /website/docs/from_provider/motivation/combine/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./combine.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/from_provider/motivation/combine/raw.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | import 'package:riverpod/riverpod.dart'; 4 | 5 | /* SNIPPET START */ 6 | 7 | final numberProvider = Provider.autoDispose((ref) { 8 | return Random().nextInt(10); 9 | }); 10 | 11 | final doubledProvider = Provider.autoDispose((ref) { 12 | final number = ref.watch(numberProvider); 13 | 14 | return number * 2; 15 | }); 16 | -------------------------------------------------------------------------------- /website/docs/from_provider/motivation/override/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | 3 | export default { 4 | raw, 5 | hooks: undefined, 6 | codegen: undefined, 7 | hooksCodegen: undefined, 8 | }; 9 | -------------------------------------------------------------------------------- /website/docs/from_provider/motivation/override/raw.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | import 'package:hooks_riverpod/hooks_riverpod.dart'; 3 | 4 | import '../combine/combine.dart'; 5 | 6 | /* SNIPPET START */ 7 | 8 | void main() { 9 | test('it doubles the value correctly', () async { 10 | final container = ProviderContainer( 11 | overrides: [numberProvider.overrideWith((ref) => 9)], 12 | ); 13 | final doubled = container.read(doubledProvider); 14 | expect(doubled, 9 * 2); 15 | }); 16 | } 17 | -------------------------------------------------------------------------------- /website/docs/from_provider/motivation/same_type/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./same_type.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/from_provider/motivation/same_type/raw.dart: -------------------------------------------------------------------------------- 1 | import 'package:collection/collection.dart'; 2 | import 'package:riverpod/riverpod.dart'; 3 | 4 | import '../../helpers/item.dart'; 5 | 6 | /* SNIPPET START */ 7 | 8 | final itemsProvider = Provider.autoDispose( 9 | (ref) => [], // ... 10 | ); 11 | 12 | final evenItemsProvider = Provider.autoDispose((ref) { 13 | final items = ref.watch(itemsProvider); 14 | return [...items.whereIndexed((index, element) => index.isEven)]; 15 | }); 16 | -------------------------------------------------------------------------------- /website/docs/from_provider/motivation/same_type/same_type.dart: -------------------------------------------------------------------------------- 1 | import 'package:collection/collection.dart'; 2 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 3 | 4 | import '../../helpers/item.dart'; 5 | 6 | part 'same_type.g.dart'; 7 | 8 | /* SNIPPET START */ 9 | 10 | @riverpod 11 | List items(Ref ref) { 12 | return []; // ... 13 | } 14 | 15 | @riverpod 16 | List evenItems(Ref ref) { 17 | final items = ref.watch(itemsProvider); 18 | return [...items.whereIndexed((index, element) => index.isEven)]; 19 | } 20 | -------------------------------------------------------------------------------- /website/docs/from_provider/motivation/side_effects/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./side_effects.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen: undefined, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/introduction/getting_started/dart_hello_world/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./main.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/introduction/getting_started/hello_world/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import raw_hooks from "!!raw-loader!./raw_hooks.dart"; 3 | import codegen from "!!raw-loader!./main.dart"; 4 | import hooksCodegen from "!!raw-loader!./hooks_codegen/main.dart"; 5 | 6 | export default { 7 | raw, 8 | hooks: raw_hooks, 9 | codegen, 10 | hooksCodegen: hooksCodegen, 11 | }; 12 | -------------------------------------------------------------------------------- /website/docs/introduction/why_riverpod/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./codegen.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/migration/from_change_notifier/declaration/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./declaration.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/migration/from_change_notifier/initialization/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./initialization.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/migration/from_change_notifier/migrated/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./migrated.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/migration/from_state_notifier/add_listener/add_listener.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: avoid_print 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 5 | 6 | part 'add_listener.g.dart'; 7 | 8 | /* SNIPPET START */ 9 | @riverpod 10 | class MyNotifier extends _$MyNotifier { 11 | @override 12 | int build() { 13 | listenSelf((_, next) => debugPrint('$next')); 14 | return 0; 15 | } 16 | 17 | void add() => state++; 18 | } 19 | -------------------------------------------------------------------------------- /website/docs/migration/from_state_notifier/add_listener/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./add_listener.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/migration/from_state_notifier/add_listener/raw.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: avoid_print 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:riverpod/riverpod.dart'; 5 | 6 | /* SNIPPET START */ 7 | class MyNotifier extends Notifier { 8 | @override 9 | int build() { 10 | listenSelf((_, next) => debugPrint('$next')); 11 | return 0; 12 | } 13 | 14 | void add() => state++; 15 | } 16 | 17 | final myNotifierProvider = NotifierProvider(MyNotifier.new); 18 | -------------------------------------------------------------------------------- /website/docs/migration/from_state_notifier/async_notifier/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./async_notifier.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/migration/from_state_notifier/build_init/build_init.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: avoid_print 2 | 3 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 4 | 5 | part 'build_init.g.dart'; 6 | 7 | /* SNIPPET START */ 8 | @riverpod 9 | class CounterNotifier extends _$CounterNotifier { 10 | @override 11 | int build() => 0; 12 | 13 | void increment() => state++; 14 | void decrement() => state--; 15 | } 16 | -------------------------------------------------------------------------------- /website/docs/migration/from_state_notifier/build_init/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./build_init.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/migration/from_state_notifier/build_init/raw.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: avoid_print 2 | 3 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 4 | 5 | /* SNIPPET START */ 6 | class CounterNotifier extends Notifier { 7 | @override 8 | int build() => 0; 9 | 10 | void increment() => state++; 11 | void decrement() => state++; 12 | } 13 | 14 | final counterNotifierProvider = NotifierProvider(CounterNotifier.new); 15 | -------------------------------------------------------------------------------- /website/docs/migration/from_state_notifier/build_init_old.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_riverpod/legacy.dart'; 2 | 3 | /* SNIPPET START */ 4 | class CounterNotifier extends StateNotifier { 5 | CounterNotifier() : super(0); 6 | 7 | void increment() => state++; 8 | void decrement() => state--; 9 | } 10 | 11 | final counterNotifierProvider = 12 | StateNotifierProvider((ref) { 13 | return CounterNotifier(); 14 | }); 15 | -------------------------------------------------------------------------------- /website/docs/migration/from_state_notifier/family_and_dispose/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./family_and_dispose.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/migration/from_state_notifier/from_state_provider/from_state_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 2 | 3 | part 'from_state_provider.g.dart'; 4 | 5 | /* SNIPPET START */ 6 | @riverpod 7 | class CounterNotifier extends _$CounterNotifier { 8 | @override 9 | int build() => 0; 10 | 11 | @override 12 | set state(int newState) => super.state = newState; 13 | int update(int Function(int state) cb) => state = cb(state); 14 | } 15 | -------------------------------------------------------------------------------- /website/docs/migration/from_state_notifier/from_state_provider/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./from_state_provider.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/migration/from_state_notifier/from_state_provider/raw.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod/riverpod.dart'; 2 | 3 | /* SNIPPET START */ 4 | class CounterNotifier extends Notifier { 5 | @override 6 | int build() => 0; 7 | 8 | @override 9 | set state(int newState) => super.state = newState; 10 | int update(int Function(int state) cb) => state = cb(state); 11 | } 12 | 13 | final counterNotifierProvider = 14 | NotifierProvider(CounterNotifier.new); 15 | -------------------------------------------------------------------------------- /website/docs/migration/from_state_notifier/from_state_provider_old.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_riverpod/legacy.dart'; 2 | 3 | /* SNIPPET START */ 4 | final counterProvider = StateProvider((ref) { 5 | return 0; 6 | }); 7 | -------------------------------------------------------------------------------- /website/docs/migration/from_state_notifier/old_lifecycles/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./old_lifecycles.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/migration/from_state_notifier/old_lifecycles_final/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./old_lifecycles_final.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/providers/future_provider/config_consumer/codegen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:hooks_riverpod/hooks_riverpod.dart'; 3 | 4 | import '../config_provider/codegen.dart'; 5 | 6 | /* SNIPPET START */ 7 | 8 | Widget build(BuildContext context, WidgetRef ref) { 9 | final config = ref.watch(fetchConfigurationProvider); 10 | 11 | return switch (config) { 12 | AsyncError(:final error) => Text('Error: $error'), 13 | AsyncData(:final value) => Text(value.host), 14 | _ => const CircularProgressIndicator(), 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /website/docs/providers/future_provider/config_consumer/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./codegen.dart"; 3 | import hooks from "!!raw-loader!./hooks.dart"; 4 | import hooksCodegen from "!!raw-loader!./hooks_codegen.dart" 5 | 6 | export default { 7 | raw, 8 | hooks, 9 | codegen, 10 | hooksCodegen, 11 | }; 12 | -------------------------------------------------------------------------------- /website/docs/providers/future_provider/config_provider/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./codegen.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/providers/notifier_provider/remote_todos/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./codegen.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/providers/notifier_provider/todos/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./codegen.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/providers/provider/completed_todos/completed_todos.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 2 | 3 | import '../todo/todo.dart'; 4 | 5 | part 'completed_todos.g.dart'; 6 | 7 | /* SNIPPET START */ 8 | 9 | @riverpod 10 | List completedTodos(Ref ref) { 11 | final todos = ref.watch(todosProvider); 12 | 13 | // we return only the completed todos 14 | return todos.where((todo) => todo.isCompleted).toList(); 15 | } 16 | -------------------------------------------------------------------------------- /website/docs/providers/provider/completed_todos/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./completed_todos.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/providers/provider/completed_todos/raw.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 2 | 3 | import '../todo/raw.dart'; 4 | 5 | /* SNIPPET START */ 6 | 7 | final completedTodosProvider = Provider>((ref) { 8 | // We obtain the list of all todos from the todosProvider 9 | final todos = ref.watch(todosProvider); 10 | 11 | // we return only the completed todos 12 | return todos.where((todo) => todo.isCompleted).toList(); 13 | }); 14 | -------------------------------------------------------------------------------- /website/docs/providers/provider/optimized_previous_button/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./optimized_previous_button.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/providers/provider/todo/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./todo.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/providers/provider/todos_consumer.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: unused_local_variable 2 | 3 | import 'package:flutter/widgets.dart'; 4 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 5 | 6 | import 'completed_todos/completed_todos.dart'; 7 | 8 | Widget build() { 9 | return 10 | /* SNIPPET START */ 11 | Consumer(builder: (context, ref, child) { 12 | final completedTodos = ref.watch(completedTodosProvider); 13 | // TODO show the todos using a ListView/GridView/.../* SKIP */ 14 | return Container(); 15 | /* SKIP END */ 16 | },); 17 | /* SNIPPET END */ 18 | } 19 | -------------------------------------------------------------------------------- /website/docs/providers/provider/unoptimized_previous_button/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./unoptimized_previous_button.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/providers/state_provider/dartpad_metadata.yaml: -------------------------------------------------------------------------------- 1 | name: StateProvider example 2 | mode: flutter 3 | files: 4 | - name: full.dart 5 | -------------------------------------------------------------------------------- /website/docs/providers/state_provider/product.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod/riverpod.dart'; 2 | 3 | /* SNIPPET START */ 4 | 5 | class Product { 6 | Product({required this.name, required this.price}); 7 | 8 | final String name; 9 | final double price; 10 | } 11 | 12 | final _products = [ 13 | Product(name: 'iPhone', price: 999), 14 | Product(name: 'cookie', price: 2), 15 | Product(name: 'ps5', price: 500), 16 | ]; 17 | 18 | final productsProvider = Provider>((ref) { 19 | return _products; 20 | }); 21 | -------------------------------------------------------------------------------- /website/docs/providers/state_provider/sort_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_riverpod/legacy.dart'; 2 | 3 | import 'dropdown.dart'; 4 | 5 | /* SNIPPET START */ 6 | 7 | final productSortTypeProvider = StateProvider( 8 | // We return the default sort type, here name. 9 | (ref) => ProductSortType.name, 10 | ); 11 | -------------------------------------------------------------------------------- /website/docs/providers/stream_provider/live_stream_chat_provider/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./codegen.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/docs/whats_new/offline/raw.dart: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/website/docs/whats_new/offline/raw.dart -------------------------------------------------------------------------------- /website/i18n/bn/docusaurus-plugin-content-docs/current/concepts/reading_consumer_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 3 | import 'reading_counter.dart'; 4 | 5 | /* SNIPPET START */ 6 | 7 | class HomeView extends ConsumerWidget { 8 | const HomeView({super.key}); 9 | 10 | @override 11 | Widget build(BuildContext context, WidgetRef ref) { 12 | // use ref to listen to a provider 13 | final counter = ref.watch(counterProvider); 14 | return Text('$counter'); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /website/i18n/bn/docusaurus-plugin-content-docs/current/cookbooks/refresh.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Pull-to-refresh / Retry-on-error 3 | --- 4 | 5 | import Tabs from "@theme/Tabs"; 6 | import TabItem from "@theme/TabItem"; 7 | 8 | In this guide, we will see how Providers can be used to easily implement 9 | a pull-to-refresh or retry-on-error feature. 10 | 11 | -------------------------------------------------------------------------------- /website/i18n/bn/docusaurus-plugin-content-docs/current/providers/provider/completed_todos.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 2 | 3 | import 'todo.dart'; 4 | 5 | /* SNIPPET START */ 6 | 7 | final completedTodosProvider = Provider>((ref) { 8 | // আমরা todosProvider থেকে সব টুডু ধারণ করব 9 | final todos = ref.watch(todosProvider); 10 | 11 | // আর আমরা শুধু completed টুডু রিটার্ন করব 12 | return todos.where((todo) => todo.isCompleted).toList(); 13 | }); 14 | -------------------------------------------------------------------------------- /website/i18n/bn/docusaurus-plugin-content-docs/current/providers/state_provider/dartpad_metadata.yaml: -------------------------------------------------------------------------------- 1 | name: StateProvider example 2 | mode: flutter 3 | files: 4 | - name: full.dart 5 | -------------------------------------------------------------------------------- /website/i18n/bn/docusaurus-theme-classic/navbar.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": { 3 | "message": "Riverpod", 4 | "description": "The title in the navbar" 5 | }, 6 | "item.label.Docs": { 7 | "message": "ডকুমেন্টশন", 8 | "description": "Navbar item with label Docs" 9 | }, 10 | "item.label.GitHub": { 11 | "message": "Github", 12 | "description": "Navbar item with label GitHub" 13 | } 14 | } -------------------------------------------------------------------------------- /website/i18n/de/docusaurus-plugin-content-blog/options.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": { 3 | "message": "Blog", 4 | "description": "The title for the blog used in SEO" 5 | }, 6 | "description": { 7 | "message": "Blog", 8 | "description": "The description for the blog used in SEO" 9 | }, 10 | "sidebar.title": { 11 | "message": "Neueste Beiträge", 12 | "description": "The label for the left sidebar" 13 | } 14 | } -------------------------------------------------------------------------------- /website/i18n/de/docusaurus-plugin-content-docs/current/concepts/reading_consumer_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 3 | import 'reading_counter.dart'; 4 | 5 | /* SNIPPET START */ 6 | 7 | class HomeView extends ConsumerWidget { 8 | const HomeView({super.key}); 9 | 10 | @override 11 | Widget build(BuildContext context, WidgetRef ref) { 12 | // Benutze ref um auf Provider zu lauschen 13 | final counter = ref.watch(counterProvider); 14 | return Text('$counter'); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /website/i18n/de/docusaurus-plugin-content-docs/current/cookbooks/refresh.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Pull-to-refresh / Retry-on-error 3 | --- 4 | 5 | import Tabs from "@theme/Tabs"; 6 | import TabItem from "@theme/TabItem"; 7 | 8 | In diesem Leitfaden, werden wir sehen, wie Provider dazu genutzt werden um 9 | auf einfache Weiße eine pull-to-refresh oder retry-on-error Funktion zu implementieren. -------------------------------------------------------------------------------- /website/i18n/de/docusaurus-plugin-content-docs/current/providers/provider/completed_todos.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 2 | 3 | import 'todo.dart'; 4 | 5 | /* SNIPPET START */ 6 | 7 | final completedTodosProvider = Provider>((ref) { 8 | // Wir erhalten die Liste aller Todos vom todosProvider 9 | final todos = ref.watch(todosProvider); 10 | 11 | // wir geben nur die erledigten ToDos zurück 12 | return todos.where((todo) => todo.isCompleted).toList(); 13 | }); 14 | -------------------------------------------------------------------------------- /website/i18n/de/docusaurus-plugin-content-docs/current/providers/state_provider/dartpad_metadata.yaml: -------------------------------------------------------------------------------- 1 | name: StateProvider example 2 | mode: flutter 3 | files: 4 | - name: full.dart 5 | -------------------------------------------------------------------------------- /website/i18n/de/docusaurus-plugin-content-docs/current/providers/state_provider/product.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod/riverpod.dart'; 2 | 3 | /* SNIPPET START */ 4 | 5 | class Product { 6 | Product({required this.name, required this.price}); 7 | 8 | final String name; 9 | final double price; 10 | } 11 | 12 | final _products = [ 13 | Product(name: 'iPhone', price: 999), 14 | Product(name: 'cookie', price: 2), 15 | Product(name: 'ps5', price: 500), 16 | ]; 17 | 18 | final productsProvider = Provider>((ref) { 19 | return _products; 20 | }); 21 | -------------------------------------------------------------------------------- /website/i18n/de/docusaurus-plugin-content-docs/current/providers/state_provider/sort_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_riverpod/legacy.dart'; 2 | 3 | import 'dropdown.dart'; 4 | 5 | /* SNIPPET START */ 6 | 7 | final productSortTypeProvider = StateProvider( 8 | // Wir returnen die default Sortierart, in diesem Fall den Namen. 9 | (ref) => ProductSortType.name, 10 | ); 11 | -------------------------------------------------------------------------------- /website/i18n/de/docusaurus-theme-classic/navbar.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": { 3 | "message": "Riverpod", 4 | "description": "The title in the navbar" 5 | }, 6 | "item.label.Docs": { 7 | "message": "Docs", 8 | "description": "Navbar item with label Docs" 9 | }, 10 | "item.label.GitHub": { 11 | "message": "GitHub", 12 | "description": "Navbar item with label GitHub" 13 | } 14 | } -------------------------------------------------------------------------------- /website/i18n/es/docusaurus-plugin-content-docs/current/providers/provider/completed_todos.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 2 | 3 | import 'todo.dart'; 4 | 5 | /* SNIPPET START */ 6 | 7 | final completedTodosProvider = Provider>((ref) { 8 | // Obtenemos la lista de tareas (todos) del `todosProvider` 9 | final todos = ref.watch(todosProvider); 10 | 11 | // Devolvemos solo los `todos` completados 12 | return todos.where((todo) => todo.isCompleted).toList(); 13 | }); 14 | -------------------------------------------------------------------------------- /website/i18n/es/docusaurus-plugin-content-docs/current/providers/state_provider/dartpad_metadata.yaml: -------------------------------------------------------------------------------- 1 | name: StateProvider 2 | mode: flutter 3 | files: 4 | - name: full.dart 5 | -------------------------------------------------------------------------------- /website/i18n/es/docusaurus-plugin-content-docs/current/providers/state_provider/product.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod/riverpod.dart'; 2 | 3 | /* SNIPPET START */ 4 | 5 | class Product { 6 | Product({required this.name, required this.price}); 7 | 8 | final String name; 9 | final double price; 10 | } 11 | 12 | final _products = [ 13 | Product(name: 'iPhone', price: 999), 14 | Product(name: 'cookie', price: 2), 15 | Product(name: 'ps5', price: 500), 16 | ]; 17 | 18 | final productsProvider = Provider>((ref) { 19 | return _products; 20 | }); 21 | -------------------------------------------------------------------------------- /website/i18n/es/docusaurus-plugin-content-docs/current/providers/state_provider/sort_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_riverpod/legacy.dart'; 2 | 3 | import 'dropdown.dart'; 4 | 5 | /* SNIPPET START */ 6 | 7 | final productSortTypeProvider = StateProvider( 8 | // Devolvemos el tipo de clasificación predeterminado, aquí `name`. 9 | (ref) => ProductSortType.name, 10 | ); 11 | -------------------------------------------------------------------------------- /website/i18n/es/docusaurus-theme-classic/navbar.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": { 3 | "message": "Riverpod", 4 | "description": "The title in the navbar" 5 | }, 6 | "item.label.Docs": { 7 | "message": "Documentación", 8 | "description": "Navbar item with label Docs" 9 | }, 10 | "item.label.GitHub": { 11 | "message": "GitHub", 12 | "description": "Navbar item with label GitHub" 13 | } 14 | } -------------------------------------------------------------------------------- /website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/lifecycle_on_dispose.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: unused_local_variable, unnecessary_lambdas 2 | 3 | import 'dart:async'; 4 | 5 | import 'package:hooks_riverpod/hooks_riverpod.dart'; 6 | 7 | /* SNIPPET START */ 8 | final example = StreamProvider.autoDispose((ref) { 9 | final streamController = StreamController(); 10 | 11 | ref.onDispose(() { 12 | // Ferme le StreamController lorsque l'état de ce provider est détruit. 13 | streamController.close(); 14 | }); 15 | 16 | return streamController.stream; 17 | }); 18 | -------------------------------------------------------------------------------- /website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/reading_consumer_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 3 | import 'reading_counter.dart'; 4 | 5 | /* SNIPPET START */ 6 | 7 | class HomeView extends ConsumerWidget { 8 | const HomeView({super.key}); 9 | 10 | @override 11 | Widget build(BuildContext context, WidgetRef ref) { 12 | // utiliser ref pour écouter un provider 13 | final counter = ref.watch(counterProvider); 14 | return Text('$counter'); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /website/i18n/fr/docusaurus-plugin-content-docs/current/cookbooks/refresh.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Pull-to-refresh / Retry-on-error 3 | --- 4 | 5 | import Tabs from "@theme/Tabs"; 6 | import TabItem from "@theme/TabItem"; 7 | 8 | Dans ce guide, nous verrons comment les Providers peuvent être utilisés pour mettre 9 | en œuvre facilement une fonction de "pull-to-refresh" ou de "retry-on-error" 10 | (tentative de réessai en cas d'erreur). -------------------------------------------------------------------------------- /website/i18n/fr/docusaurus-plugin-content-docs/current/getting_started/dart_hello_world/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./main.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/i18n/fr/docusaurus-plugin-content-docs/current/getting_started/dart_pubspec/codegen.yaml: -------------------------------------------------------------------------------- 1 | name: my_app_name 2 | environment: 3 | sdk: ^3.6.0 4 | 5 | dependencies: 6 | riverpod: ^3.0.0-dev.12 7 | riverpod_annotation: ^1.0.6 8 | 9 | dev_dependencies: 10 | build_runner: 11 | riverpod_generator: ^1.0.6 -------------------------------------------------------------------------------- /website/i18n/fr/docusaurus-plugin-content-docs/current/getting_started/dart_pubspec/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.yaml"; 2 | import codegen from "!!raw-loader!./codegen.yaml"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/i18n/fr/docusaurus-plugin-content-docs/current/getting_started/dart_pubspec/raw.yaml: -------------------------------------------------------------------------------- 1 | name: my_app_name 2 | environment: 3 | sdk: ^3.6.0 4 | 5 | dependencies: 6 | riverpod: ^3.0.0-dev.12 -------------------------------------------------------------------------------- /website/i18n/fr/docusaurus-plugin-content-docs/current/getting_started/hello_world/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./main.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/i18n/fr/docusaurus-plugin-content-docs/current/getting_started/pubspec/codegen.yaml: -------------------------------------------------------------------------------- 1 | name: my_app_name 2 | environment: 3 | sdk: ^3.6.0 4 | flutter: ">=3.0.0" 5 | 6 | dependencies: 7 | flutter: 8 | sdk: flutter 9 | flutter_riverpod: ^3.0.0-dev.12 10 | riverpod_annotation: ^1.0.6 11 | 12 | dev_dependencies: 13 | build_runner: 14 | riverpod_generator: ^1.0.6 -------------------------------------------------------------------------------- /website/i18n/fr/docusaurus-plugin-content-docs/current/getting_started/pubspec/hooks.yaml: -------------------------------------------------------------------------------- 1 | name: my_app_name 2 | environment: 3 | sdk: ^3.6.0 4 | flutter: ">=3.0.0" 5 | 6 | dependencies: 7 | flutter: 8 | sdk: flutter 9 | flutter_hooks: 10 | hooks_riverpod: ^3.0.0-dev.12 -------------------------------------------------------------------------------- /website/i18n/fr/docusaurus-plugin-content-docs/current/getting_started/pubspec/hooks_codegen.yaml: -------------------------------------------------------------------------------- 1 | name: my_app_name 2 | environment: 3 | sdk: ^3.6.0 4 | flutter: ">=3.0.0" 5 | 6 | dependencies: 7 | flutter: 8 | sdk: flutter 9 | flutter_hooks: 10 | hooks_riverpod: ^3.0.0-dev.12 11 | riverpod_annotation: ^1.0.6 12 | 13 | dev_dependencies: 14 | build_runner: 15 | riverpod_generator: ^1.0.6 -------------------------------------------------------------------------------- /website/i18n/fr/docusaurus-plugin-content-docs/current/getting_started/pubspec/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.yaml"; 2 | import hooks from "!!raw-loader!./hooks.yaml"; 3 | import codegen from "!!raw-loader!./codegen.yaml"; 4 | import hooksCodegen from "!!raw-loader!./hooks_codegen.yaml"; 5 | 6 | export default { 7 | raw, 8 | hooks, 9 | codegen, 10 | hooksCodegen, 11 | }; 12 | -------------------------------------------------------------------------------- /website/i18n/fr/docusaurus-plugin-content-docs/current/getting_started/pubspec/raw.yaml: -------------------------------------------------------------------------------- 1 | name: my_app_name 2 | environment: 3 | sdk: ^3.6.0 4 | flutter: ">=3.0.0" 5 | 6 | dependencies: 7 | flutter: 8 | sdk: flutter 9 | flutter_riverpod: ^3.0.0-dev.12 -------------------------------------------------------------------------------- /website/i18n/fr/docusaurus-plugin-content-docs/current/providers/provider/completed_todos.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 2 | 3 | import 'todo.dart'; 4 | 5 | /* SNIPPET START */ 6 | 7 | final completedTodosProvider = Provider>((ref) { 8 | // On obtient la liste de tous les todos à partir du todosProvider. 9 | final todos = ref.watch(todosProvider); 10 | 11 | // on retourne seulement les todos complétés 12 | return todos.where((todo) => todo.isCompleted).toList(); 13 | }); 14 | -------------------------------------------------------------------------------- /website/i18n/fr/docusaurus-plugin-content-docs/current/providers/state_provider/dartpad_metadata.yaml: -------------------------------------------------------------------------------- 1 | name: StateProvider example 2 | mode: flutter 3 | files: 4 | - name: full.dart 5 | -------------------------------------------------------------------------------- /website/i18n/fr/docusaurus-plugin-content-docs/current/providers/state_provider/product.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod/riverpod.dart'; 2 | 3 | /* SNIPPET START */ 4 | 5 | class Product { 6 | Product({required this.name, required this.price}); 7 | 8 | final String name; 9 | final double price; 10 | } 11 | 12 | final _products = [ 13 | Product(name: 'iPhone', price: 999), 14 | Product(name: 'cookie', price: 2), 15 | Product(name: 'ps5', price: 500), 16 | ]; 17 | 18 | final productsProvider = Provider>((ref) { 19 | return _products; 20 | }); 21 | -------------------------------------------------------------------------------- /website/i18n/fr/docusaurus-plugin-content-docs/current/providers/state_provider/sort_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_riverpod/legacy.dart'; 2 | 3 | import 'dropdown.dart'; 4 | 5 | /* SNIPPET START */ 6 | 7 | final productSortTypeProvider = StateProvider( 8 | // On retourne le type de tri par défaut, ici nom. 9 | (ref) => ProductSortType.name, 10 | ); 11 | -------------------------------------------------------------------------------- /website/i18n/fr/docusaurus-theme-classic/navbar.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": { 3 | "message": "Riverpod", 4 | "description": "The title in the navbar" 5 | }, 6 | "item.label.Docs": { 7 | "message": "Documentation", 8 | "description": "Navbar item with label Docs" 9 | }, 10 | "item.label.GitHub": { 11 | "message": "GitHub", 12 | "description": "Navbar item with label GitHub" 13 | } 14 | } -------------------------------------------------------------------------------- /website/i18n/it/docusaurus-plugin-content-docs/current/essentials/first_request/activity.ts: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw/activity.dart"; 2 | import codegen from "!!raw-loader!./codegen/activity.dart"; 3 | 4 | export default { 5 | raw: raw, 6 | hooks: undefined, 7 | codegen: codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/i18n/it/docusaurus-plugin-content-docs/current/essentials/first_request/consumer.ts: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw/consumer.dart"; 2 | 3 | export default { 4 | raw: raw, 5 | hooks: undefined, 6 | codegen: undefined, 7 | hooksCodegen: undefined, 8 | }; 9 | -------------------------------------------------------------------------------- /website/i18n/it/docusaurus-plugin-content-docs/current/essentials/first_request/consumer_stateful_widget.ts: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw/consumer_stateful_widget.dart"; 2 | 3 | export default { 4 | raw: raw, 5 | hooks: undefined, 6 | codegen: undefined, 7 | hooksCodegen: undefined, 8 | }; 9 | -------------------------------------------------------------------------------- /website/i18n/it/docusaurus-plugin-content-docs/current/essentials/first_request/consumer_widget.ts: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw/consumer_widget.dart"; 2 | 3 | export default { 4 | raw: raw, 5 | hooks: undefined, 6 | codegen: undefined, 7 | hooksCodegen: undefined, 8 | }; 9 | -------------------------------------------------------------------------------- /website/i18n/it/docusaurus-plugin-content-docs/current/essentials/first_request/hook_consumer_widget.ts: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw/hook_consumer_widget.dart"; 2 | 3 | export default { 4 | raw: raw, 5 | hooks: undefined, 6 | codegen: undefined, 7 | hooksCodegen: undefined, 8 | }; 9 | -------------------------------------------------------------------------------- /website/i18n/it/docusaurus-plugin-content-docs/current/essentials/first_request/legend/DocuCode.scss: -------------------------------------------------------------------------------- 1 | .legend { 2 | table, 3 | td, 4 | tr { 5 | background: none !important; 6 | border: none; 7 | 8 | vertical-align: top; 9 | } 10 | 11 | td:first-child { 12 | text-align: end; 13 | } 14 | 15 | tr + tr { 16 | border-top: solid 0.5px; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /website/i18n/it/docusaurus-plugin-content-docs/current/essentials/first_request/provider.ts: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw/provider.dart"; 2 | import codegen from "!!raw-loader!./codegen/provider.dart"; 3 | 4 | export default { 5 | raw: raw, 6 | hooks: undefined, 7 | codegen: codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/i18n/it/docusaurus-plugin-content-docs/current/essentials/passing_args/no_arg_provider.ts: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw/provider.dart"; 2 | import codegen from "!!raw-loader!./codegen/provider.dart"; 3 | 4 | export default { 5 | raw: raw, 6 | hooks: undefined, 7 | codegen: codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/i18n/it/docusaurus-plugin-content-docs/current/essentials/side_effects/render_add_todo.ts: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw/render_add_todo.dart"; 2 | import hooks from "!!raw-loader!./raw/render_add_todo_hooks.dart"; 3 | 4 | export default { 5 | raw: raw, 6 | hooks: hooks, 7 | codegen: undefined, 8 | hooksCodegen: undefined, 9 | }; -------------------------------------------------------------------------------- /website/i18n/it/docusaurus-plugin-content-docs/current/essentials/side_effects/todo_list_notifier.ts: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw/todo_list_notifier.dart"; 2 | import codegen from "!!raw-loader!./codegen/todo_list_notifier.dart"; 3 | 4 | export default { 5 | raw: raw, 6 | hooks: undefined, 7 | codegen: codegen, 8 | hooksCodegen: undefined, 9 | }; -------------------------------------------------------------------------------- /website/i18n/it/docusaurus-plugin-content-docs/current/essentials/side_effects/todo_list_notifier_add_todo.ts: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw/todo_list_notifier_add_todo.dart"; 2 | import codegen from "!!raw-loader!./codegen/todo_list_notifier_add_todo.dart"; 3 | 4 | export default { 5 | raw: raw, 6 | hooks: undefined, 7 | codegen: codegen, 8 | hooksCodegen: undefined, 9 | }; -------------------------------------------------------------------------------- /website/i18n/it/docusaurus-plugin-content-docs/current/essentials/side_effects/todo_list_provider.ts: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw/todo_list_provider.dart"; 2 | import codegen from "!!raw-loader!./codegen/todo_list_provider.dart"; 3 | 4 | export default { 5 | raw: raw, 6 | codegen: codegen, 7 | }; 8 | -------------------------------------------------------------------------------- /website/i18n/it/docusaurus-plugin-content-docs/current/from_provider/helpers/item.dart: -------------------------------------------------------------------------------- 1 | import 'package:freezed_annotation/freezed_annotation.dart'; 2 | 3 | import 'json.dart'; 4 | 5 | part 'item.freezed.dart'; 6 | part 'item.g.dart'; 7 | 8 | @freezed 9 | sealed class Item with _$Item { 10 | const factory Item({required int id}) = _Item; 11 | factory Item.fromJson(Json json) => _$ItemFromJson(json); 12 | } 13 | -------------------------------------------------------------------------------- /website/i18n/it/docusaurus-plugin-content-docs/current/from_provider/helpers/json.dart: -------------------------------------------------------------------------------- 1 | typedef Json = Map; 2 | -------------------------------------------------------------------------------- /website/i18n/it/docusaurus-plugin-content-docs/current/providers/state_provider/dartpad_metadata.yaml: -------------------------------------------------------------------------------- 1 | name: StateProvider example 2 | mode: flutter 3 | files: 4 | - name: full.dart 5 | -------------------------------------------------------------------------------- /website/i18n/it/docusaurus-plugin-content-docs/current/providers/state_provider/product.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod/riverpod.dart'; 2 | 3 | /* SNIPPET START */ 4 | 5 | class Product { 6 | Product({required this.name, required this.price}); 7 | 8 | final String name; 9 | final double price; 10 | } 11 | 12 | final _products = [ 13 | Product(name: 'iPhone', price: 999), 14 | Product(name: 'cookie', price: 2), 15 | Product(name: 'ps5', price: 500), 16 | ]; 17 | 18 | final productsProvider = Provider>((ref) { 19 | return _products; 20 | }); 21 | -------------------------------------------------------------------------------- /website/i18n/it/docusaurus-plugin-content-docs/current/providers/state_provider/sort_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_riverpod/legacy.dart'; 2 | 3 | import 'dropdown.dart'; 4 | 5 | /* SNIPPET START */ 6 | 7 | final productSortTypeProvider = StateProvider( 8 | // We return the default sort type, here name. 9 | (ref) => ProductSortType.name, 10 | ); 11 | -------------------------------------------------------------------------------- /website/i18n/it/docusaurus-theme-classic/navbar.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": { 3 | "message": "Riverpod", 4 | "description": "The title in the navbar" 5 | }, 6 | "item.label.Docs": { 7 | "message": "Documentazione", 8 | "description": "Navbar item with label Docs" 9 | }, 10 | "item.label.GitHub": { 11 | "message": "GitHub", 12 | "description": "Navbar item with label GitHub" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/reading_consumer_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 3 | import 'reading_counter.dart'; 4 | 5 | /* SNIPPET START */ 6 | 7 | class HomeView extends ConsumerWidget { 8 | const HomeView({super.key}); 9 | 10 | @override 11 | Widget build(BuildContext context, WidgetRef ref) { 12 | // `ref` を使ってプロバイダーを監視する 13 | final counter = ref.watch(counterProvider); 14 | return Text('$counter'); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /website/i18n/ja/docusaurus-plugin-content-docs/current/getting_started/dart_hello_world/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./main.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/i18n/ja/docusaurus-plugin-content-docs/current/getting_started/dart_pubspec/codegen.yaml: -------------------------------------------------------------------------------- 1 | name: my_app_name 2 | environment: 3 | sdk: ^3.6.0 4 | 5 | dependencies: 6 | riverpod: ^3.0.0-dev.12 7 | riverpod: ^3.0.0-dev.12 8 | 9 | dev_dependencies: 10 | build_runner: 11 | riverpod_generator: ^1.1.1 -------------------------------------------------------------------------------- /website/i18n/ja/docusaurus-plugin-content-docs/current/getting_started/dart_pubspec/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.yaml"; 2 | import codegen from "!!raw-loader!./codegen.yaml"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/i18n/ja/docusaurus-plugin-content-docs/current/getting_started/dart_pubspec/raw.yaml: -------------------------------------------------------------------------------- 1 | name: my_app_name 2 | environment: 3 | sdk: ^3.6.0 4 | 5 | dependencies: 6 | riverpod: ^3.0.0-dev.12 -------------------------------------------------------------------------------- /website/i18n/ja/docusaurus-plugin-content-docs/current/getting_started/hello_world/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.dart"; 2 | import codegen from "!!raw-loader!./main.dart"; 3 | 4 | export default { 5 | raw, 6 | hooks: undefined, 7 | codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/i18n/ja/docusaurus-plugin-content-docs/current/getting_started/pubspec/codegen.yaml: -------------------------------------------------------------------------------- 1 | name: my_app_name 2 | environment: 3 | sdk: ^3.6.0 4 | flutter: ">=3.0.0" 5 | 6 | dependencies: 7 | flutter: 8 | sdk: flutter 9 | flutter_riverpod: ^3.0.0-dev.12 10 | riverpod: ^3.0.0-dev.12 11 | 12 | dev_dependencies: 13 | build_runner: 14 | riverpod_generator: ^1.1.1 -------------------------------------------------------------------------------- /website/i18n/ja/docusaurus-plugin-content-docs/current/getting_started/pubspec/hooks.yaml: -------------------------------------------------------------------------------- 1 | name: my_app_name 2 | environment: 3 | sdk: ^3.6.0 4 | flutter: ">=3.0.0" 5 | 6 | dependencies: 7 | flutter: 8 | sdk: flutter 9 | flutter_hooks: 10 | hooks_riverpod: ^3.0.0-dev.12 -------------------------------------------------------------------------------- /website/i18n/ja/docusaurus-plugin-content-docs/current/getting_started/pubspec/hooks_codegen.yaml: -------------------------------------------------------------------------------- 1 | name: my_app_name 2 | environment: 3 | sdk: ^3.6.0 4 | flutter: ">=3.0.0" 5 | 6 | dependencies: 7 | flutter: 8 | sdk: flutter 9 | flutter_hooks: 10 | hooks_riverpod: ^3.0.0-dev.12 11 | riverpod: ^3.0.0-dev.12 12 | 13 | dev_dependencies: 14 | build_runner: 15 | riverpod_generator: ^1.1.1 -------------------------------------------------------------------------------- /website/i18n/ja/docusaurus-plugin-content-docs/current/getting_started/pubspec/index.tsx: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw.yaml"; 2 | import hooks from "!!raw-loader!./hooks.yaml"; 3 | import codegen from "!!raw-loader!./codegen.yaml"; 4 | import hooksCodegen from "!!raw-loader!./hooks_codegen.yaml"; 5 | 6 | export default { 7 | raw, 8 | hooks, 9 | codegen, 10 | hooksCodegen, 11 | }; 12 | -------------------------------------------------------------------------------- /website/i18n/ja/docusaurus-plugin-content-docs/current/getting_started/pubspec/raw.yaml: -------------------------------------------------------------------------------- 1 | name: my_app_name 2 | environment: 3 | sdk: ^3.6.0 4 | flutter: ">=3.0.0" 5 | 6 | dependencies: 7 | flutter: 8 | sdk: flutter 9 | flutter_riverpod: ^3.0.0-dev.12 -------------------------------------------------------------------------------- /website/i18n/ja/docusaurus-plugin-content-docs/current/providers/provider/completed_todos.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 2 | 3 | import 'todo.dart'; 4 | 5 | /* SNIPPET START */ 6 | 7 | final completedTodosProvider = Provider>((ref) { 8 | // todosProvider から Todo リストの内容をすべて取得 9 | final todos = ref.watch(todosProvider); 10 | 11 | // 完了タスクのみをリストにして値として返す 12 | return todos.where((todo) => todo.isCompleted).toList(); 13 | }); 14 | -------------------------------------------------------------------------------- /website/i18n/ja/docusaurus-plugin-content-docs/current/providers/provider/todos_consumer.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: unused_local_variable 2 | 3 | import 'package:flutter/widgets.dart'; 4 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 5 | 6 | import 'completed_todos.dart'; 7 | 8 | Widget build() { 9 | return 10 | /* SNIPPET START */ 11 | Consumer(builder: (context, ref, child) { 12 | final completedTodos = ref.watch(completedTodosProvider); 13 | // TODO ListView/GridView/... を使って Todo リストを表示する /* SKIP */ 14 | return Container(); 15 | /* SKIP END */ 16 | },); 17 | /* SNIPPET END */ 18 | } 19 | -------------------------------------------------------------------------------- /website/i18n/ja/docusaurus-plugin-content-docs/current/providers/state_provider/dartpad_metadata.yaml: -------------------------------------------------------------------------------- 1 | name: StateProvider の使用例 2 | mode: flutter 3 | files: 4 | - name: full.dart 5 | -------------------------------------------------------------------------------- /website/i18n/ja/docusaurus-plugin-content-docs/current/providers/state_provider/product.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod/riverpod.dart'; 2 | 3 | /* SNIPPET START */ 4 | 5 | class Product { 6 | Product({required this.name, required this.price}); 7 | 8 | final String name; 9 | final double price; 10 | } 11 | 12 | final _products = [ 13 | Product(name: 'iPhone', price: 999), 14 | Product(name: 'cookie', price: 2), 15 | Product(name: 'ps5', price: 500), 16 | ]; 17 | 18 | final productsProvider = Provider>((ref) { 19 | return _products; 20 | }); 21 | -------------------------------------------------------------------------------- /website/i18n/ja/docusaurus-plugin-content-docs/current/providers/state_provider/sort_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_riverpod/legacy.dart'; 2 | 3 | import 'dropdown.dart'; 4 | 5 | /* SNIPPET START */ 6 | 7 | final productSortTypeProvider = StateProvider( 8 | // ソートの種類 name を返します。これがデフォルトのステートとなります。 9 | (ref) => ProductSortType.name, 10 | ); 11 | -------------------------------------------------------------------------------- /website/i18n/ja/docusaurus-theme-classic/navbar.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": { 3 | "message": "Riverpod", 4 | "description": "The title in the navbar" 5 | }, 6 | "item.label.Docs": { 7 | "message": "ドキュメント", 8 | "description": "Navbar item with label Docs" 9 | }, 10 | "item.label.GitHub": { 11 | "message": "GitHub", 12 | "description": "Navbar item with label GitHub" 13 | } 14 | } -------------------------------------------------------------------------------- /website/i18n/ko/NOTE.md: -------------------------------------------------------------------------------- 1 | # 한국어 번역작업 (Korean Translation) 2 | 3 | ## 작업하기 4 | 5 | - [Initialize the i18n folder](https://docusaurus.io/docs/i18n/git#initialize-the-i18n-folder) 6 | 7 | ```shell 8 | # 처음에 한국어 i18n 생성하기 (docusaurus) 9 | yarn run write-translations --locale ko 10 | 11 | # website/i18n/ko/ 폴더에서 문서수정 12 | # 한국어 문서 실행하고, 최초실행시 import 폴더 구조가 안맞는 것 맞추기 13 | yarn run dev --locale ko 14 | 15 | # 빌드 16 | yarn run build --locale ko 17 | # 빌드된 파일 확인 18 | yarn run serve 19 | 20 | # 작업후 문서의 생성코드 업데이트 21 | dart run build_runner watch --delete-conflicting-outputs 22 | ``` 23 | -------------------------------------------------------------------------------- /website/i18n/ko/docusaurus-plugin-content-blog/options.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": { 3 | "message": "Blog", 4 | "description": "The title for the blog used in SEO" 5 | }, 6 | "description": { 7 | "message": "Blog", 8 | "description": "The description for the blog used in SEO" 9 | }, 10 | "sidebar.title": { 11 | "message": "Recent posts", 12 | "description": "The label for the left sidebar" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /website/i18n/ko/docusaurus-plugin-content-docs/current/providers/state_provider/dartpad_metadata.yaml: -------------------------------------------------------------------------------- 1 | name: StateProvider example 2 | mode: flutter 3 | files: 4 | - name: full.dart 5 | -------------------------------------------------------------------------------- /website/i18n/ko/docusaurus-plugin-content-docs/current/providers/state_provider/product.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod/riverpod.dart'; 2 | 3 | /* SNIPPET START */ 4 | 5 | class Product { 6 | Product({required this.name, required this.price}); 7 | 8 | final String name; 9 | final double price; 10 | } 11 | 12 | final _products = [ 13 | Product(name: 'iPhone', price: 999), 14 | Product(name: 'cookie', price: 2), 15 | Product(name: 'ps5', price: 500), 16 | ]; 17 | 18 | final productsProvider = Provider>((ref) { 19 | return _products; 20 | }); 21 | -------------------------------------------------------------------------------- /website/i18n/ko/docusaurus-plugin-content-docs/current/providers/state_provider/sort_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_riverpod/legacy.dart'; 2 | 3 | import 'dropdown.dart'; 4 | 5 | /* SNIPPET START */ 6 | 7 | final productSortTypeProvider = StateProvider( 8 | // We return the default sort type, here name. 9 | (ref) => ProductSortType.name, 10 | ); 11 | -------------------------------------------------------------------------------- /website/i18n/ko/docusaurus-theme-classic/navbar.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": { 3 | "message": "Riverpod", 4 | "description": "The title in the navbar" 5 | }, 6 | "logo.alt": { 7 | "message": "Riverpod", 8 | "description": "The alt text of navbar logo" 9 | }, 10 | "item.label.Docs": { 11 | "message": "문서", 12 | "description": "Navbar item with label Docs" 13 | }, 14 | "item.label.GitHub": { 15 | "message": "GitHub", 16 | "description": "Navbar item with label GitHub" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /website/i18n/ru/docusaurus-plugin-content-blog/options.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": { 3 | "message": "Блог", 4 | "description": "The title for the blog used in SEO" 5 | }, 6 | "description": { 7 | "message": "Блог", 8 | "description": "The description for the blog used in SEO" 9 | }, 10 | "sidebar.title": { 11 | "message": "Последние посты", 12 | "description": "The label for the left sidebar" 13 | } 14 | } -------------------------------------------------------------------------------- /website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/reading_consumer_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 3 | import 'reading_counter.dart'; 4 | 5 | /* SNIPPET START */ 6 | 7 | class HomeView extends ConsumerWidget { 8 | const HomeView({super.key}); 9 | 10 | @override 11 | Widget build(BuildContext context, WidgetRef ref) { 12 | // использование ref для прослушивания провайдера 13 | final counter = ref.watch(counterProvider); 14 | return Text('$counter'); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /website/i18n/ru/docusaurus-plugin-content-docs/current/cookbooks/refresh.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Pull-to-refresh / Retry-on-error 3 | --- 4 | 5 | import Tabs from "@theme/Tabs"; 6 | import TabItem from "@theme/TabItem"; 7 | 8 | В этом гайде мы рассмотрим, как можно использовать провайдеры для 9 | реализации pull-to-refresh или retry-on-error. 10 | 11 | -------------------------------------------------------------------------------- /website/i18n/ru/docusaurus-plugin-content-docs/current/providers/provider/completed_todos.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 2 | 3 | import 'todo.dart'; 4 | 5 | /* SNIPPET START */ 6 | 7 | final completedTodosProvider = Provider>((ref) { 8 | // Получаем список всех задач из todosProvider 9 | final todos = ref.watch(todosProvider); 10 | 11 | // Возвращаем только выполненные задачи 12 | return todos.where((todo) => todo.isCompleted).toList(); 13 | }); 14 | -------------------------------------------------------------------------------- /website/i18n/ru/docusaurus-plugin-content-docs/current/providers/state_provider/dartpad_metadata.yaml: -------------------------------------------------------------------------------- 1 | name: StateProvider example 2 | mode: flutter 3 | files: 4 | - name: full.dart 5 | -------------------------------------------------------------------------------- /website/i18n/ru/docusaurus-theme-classic/navbar.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": { 3 | "message": "Riverpod", 4 | "description": "The title in the navbar" 5 | }, 6 | "item.label.Docs": { 7 | "message": "Документация", 8 | "description": "Navbar item with label Docs" 9 | }, 10 | "item.label.GitHub": { 11 | "message": "GitHub", 12 | "description": "Navbar item with label GitHub" 13 | } 14 | } -------------------------------------------------------------------------------- /website/i18n/tr/docusaurus-plugin-content-docs/current/providers/provider/completed_todos.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 2 | 3 | import 'todo.dart'; 4 | 5 | /* SNIPPET START */ 6 | 7 | final completedTodosProvider = Provider>((ref) { 8 | // Görevlerin (yapılacaklar) listesini `todosProvider`dan alıyoruz 9 | final todos = ref.watch(todosProvider); 10 | 11 | // Yalnızca tamamlanan "tümü"nü döndürürüz 12 | return todos.where((todo) => todo.isCompleted).toList(); 13 | }); 14 | -------------------------------------------------------------------------------- /website/i18n/tr/docusaurus-plugin-content-docs/current/providers/state_provider/dartpad_metadata.yaml: -------------------------------------------------------------------------------- 1 | name: StateProvider 2 | mode: flutter 3 | files: 4 | - name: full.dart 5 | -------------------------------------------------------------------------------- /website/i18n/tr/docusaurus-plugin-content-docs/current/providers/state_provider/product.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod/riverpod.dart'; 2 | 3 | /* SNIPPET START */ 4 | 5 | class Product { 6 | Product({required this.name, required this.price}); 7 | 8 | final String name; 9 | final double price; 10 | } 11 | 12 | final _products = [ 13 | Product(name: 'iPhone', price: 999), 14 | Product(name: 'cookie', price: 2), 15 | Product(name: 'ps5', price: 500), 16 | ]; 17 | 18 | final productsProvider = Provider>((ref) { 19 | return _products; 20 | }); 21 | -------------------------------------------------------------------------------- /website/i18n/tr/docusaurus-plugin-content-docs/current/providers/state_provider/sort_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 2 | 3 | import 'dropdown.dart'; 4 | 5 | /* SNIPPET START */ 6 | 7 | final productSortTypeProvider = StateProvider( 8 | // Varsayılan sıralama tipini döndürüyoruz, buraya `isim'. 9 | (ref) => ProductSortType.name, 10 | ); 11 | -------------------------------------------------------------------------------- /website/i18n/tr/docusaurus-theme-classic/navbar.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": { 3 | "message": "Riverpod", 4 | "description": "The title in the navbar" 5 | }, 6 | "item.label.Docs": { 7 | "message": "Dokümanlar", 8 | "description": "Navbar item with label Docs" 9 | }, 10 | "item.label.GitHub": { 11 | "message": "GitHub", 12 | "description": "Navbar item with label GitHub" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /website/i18n/zh-Hans/docusaurus-plugin-content-blog/options.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": { 3 | "message": "博客", 4 | "description": "The title for the blog used in SEO" 5 | }, 6 | "description": { 7 | "message": "博客", 8 | "description": "The description for the blog used in SEO" 9 | }, 10 | "sidebar.title": { 11 | "message": "最近的文章", 12 | "description": "The label for the left sidebar" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/essentials/first_request/activity.ts: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw/activity.dart"; 2 | import codegen from "!!raw-loader!./codegen/activity.dart"; 3 | 4 | export default { 5 | raw: raw, 6 | hooks: undefined, 7 | codegen: codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/essentials/first_request/consumer.ts: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw/consumer.dart"; 2 | 3 | export default { 4 | raw: raw, 5 | hooks: undefined, 6 | codegen: undefined, 7 | hooksCodegen: undefined, 8 | }; 9 | -------------------------------------------------------------------------------- /website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/essentials/first_request/consumer_stateful_widget.ts: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw/consumer_stateful_widget.dart"; 2 | 3 | export default { 4 | raw: raw, 5 | hooks: undefined, 6 | codegen: undefined, 7 | hooksCodegen: undefined, 8 | }; 9 | -------------------------------------------------------------------------------- /website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/essentials/first_request/consumer_widget.ts: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw/consumer_widget.dart"; 2 | 3 | export default { 4 | raw: raw, 5 | hooks: undefined, 6 | codegen: undefined, 7 | hooksCodegen: undefined, 8 | }; 9 | -------------------------------------------------------------------------------- /website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/essentials/first_request/hook_consumer_widget.ts: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw/hook_consumer_widget.dart"; 2 | 3 | export default { 4 | raw: raw, 5 | hooks: undefined, 6 | codegen: undefined, 7 | hooksCodegen: undefined, 8 | }; 9 | -------------------------------------------------------------------------------- /website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/essentials/first_request/legend/DocuCode.scss: -------------------------------------------------------------------------------- 1 | .legend { 2 | table, 3 | td, 4 | tr { 5 | background: none !important; 6 | border: none; 7 | 8 | vertical-align: top; 9 | } 10 | 11 | td:first-child { 12 | text-align: end; 13 | } 14 | 15 | tr + tr { 16 | border-top: solid 0.5px; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/essentials/first_request/provider.ts: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw/provider.dart"; 2 | import codegen from "!!raw-loader!./codegen/provider.dart"; 3 | 4 | export default { 5 | raw: raw, 6 | hooks: undefined, 7 | codegen: codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/essentials/passing_args/no_arg_provider.ts: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw/provider.dart"; 2 | import codegen from "!!raw-loader!./codegen/provider.dart"; 3 | 4 | export default { 5 | raw: raw, 6 | hooks: undefined, 7 | codegen: codegen, 8 | hooksCodegen: undefined, 9 | }; 10 | -------------------------------------------------------------------------------- /website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/essentials/side_effects/render_add_todo.ts: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw/render_add_todo.dart"; 2 | import hooks from "!!raw-loader!./raw/render_add_todo_hooks.dart"; 3 | 4 | export default { 5 | raw: raw, 6 | hooks: hooks, 7 | codegen: undefined, 8 | hooksCodegen: undefined, 9 | }; -------------------------------------------------------------------------------- /website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/essentials/side_effects/todo_list_notifier.ts: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw/todo_list_notifier.dart"; 2 | import codegen from "!!raw-loader!./codegen/todo_list_notifier.dart"; 3 | 4 | export default { 5 | raw: raw, 6 | hooks: undefined, 7 | codegen: codegen, 8 | hooksCodegen: undefined, 9 | }; -------------------------------------------------------------------------------- /website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/essentials/side_effects/todo_list_notifier_add_todo.ts: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw/todo_list_notifier_add_todo.dart"; 2 | import codegen from "!!raw-loader!./codegen/todo_list_notifier_add_todo.dart"; 3 | 4 | export default { 5 | raw: raw, 6 | hooks: undefined, 7 | codegen: codegen, 8 | hooksCodegen: undefined, 9 | }; -------------------------------------------------------------------------------- /website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/essentials/side_effects/todo_list_provider.ts: -------------------------------------------------------------------------------- 1 | import raw from "!!raw-loader!./raw/todo_list_provider.dart"; 2 | import codegen from "!!raw-loader!./codegen/todo_list_provider.dart"; 3 | 4 | export default { 5 | raw: raw, 6 | codegen: codegen, 7 | }; 8 | -------------------------------------------------------------------------------- /website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/from_provider/helpers/item.dart: -------------------------------------------------------------------------------- 1 | import 'package:freezed_annotation/freezed_annotation.dart'; 2 | 3 | import 'json.dart'; 4 | 5 | part 'item.freezed.dart'; 6 | part 'item.g.dart'; 7 | 8 | @freezed 9 | sealed class Item with _$Item { 10 | const factory Item({required int id}) = _Item; 11 | factory Item.fromJson(Json json) => _$ItemFromJson(json); 12 | } 13 | -------------------------------------------------------------------------------- /website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/from_provider/helpers/json.dart: -------------------------------------------------------------------------------- 1 | typedef Json = Map; 2 | -------------------------------------------------------------------------------- /website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/providers/state_provider/dartpad_metadata.yaml: -------------------------------------------------------------------------------- 1 | name: StateProvider example 2 | mode: flutter 3 | files: 4 | - name: full.dart 5 | -------------------------------------------------------------------------------- /website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/providers/state_provider/product.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod/riverpod.dart'; 2 | 3 | /* SNIPPET START */ 4 | 5 | class Product { 6 | Product({required this.name, required this.price}); 7 | 8 | final String name; 9 | final double price; 10 | } 11 | 12 | final _products = [ 13 | Product(name: 'iPhone', price: 999), 14 | Product(name: 'cookie', price: 2), 15 | Product(name: 'ps5', price: 500), 16 | ]; 17 | 18 | final productsProvider = Provider>((ref) { 19 | return _products; 20 | }); 21 | -------------------------------------------------------------------------------- /website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/providers/state_provider/sort_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_riverpod/legacy.dart'; 2 | 3 | import 'dropdown.dart'; 4 | 5 | /* SNIPPET START */ 6 | 7 | final productSortTypeProvider = StateProvider( 8 | // We return the default sort type, here name. 9 | (ref) => ProductSortType.name, 10 | ); 11 | -------------------------------------------------------------------------------- /website/i18n/zh-Hans/docusaurus-theme-classic/navbar.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": { 3 | "message": "Riverpod", 4 | "description": "The title in the navbar" 5 | }, 6 | "logo.alt": { 7 | "message": "Riverpod", 8 | "description": "The alt text of navbar logo" 9 | }, 10 | "item.label.Docs": { 11 | "message": "文档", 12 | "description": "Navbar item with label Docs" 13 | }, 14 | "item.label.GitHub": { 15 | "message": "GitHub", 16 | "description": "Navbar item with label GitHub" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /website/src/scss/abstracts/_mixins.scss: -------------------------------------------------------------------------------- 1 | @mixin min-width($breakpoint) { 2 | @media screen and (min-width: map-get($breakpoints, $breakpoint)) { 3 | @content; 4 | } 5 | } 6 | 7 | @mixin themed($property, $light-value, $dark-value) { 8 | [data-theme="light"] & { 9 | #{$property}: $light-value; 10 | } 11 | 12 | [data-theme="dark"] & { 13 | #{$property}: $dark-value; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /website/src/scss/abstracts/_variables.scss: -------------------------------------------------------------------------------- 1 | $max-width: 1860px; 2 | 3 | $breakpoints: ( 4 | xs: 0, 5 | sm: 576px, 6 | md: 768px, 7 | lg: 992px, 8 | xl: 1200px, 9 | ); 10 | -------------------------------------------------------------------------------- /website/src/scss/base/_typography.scss: -------------------------------------------------------------------------------- 1 | @import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&display=swap"); 2 | 3 | :root { 4 | --ifm-code-font-size: 95%; 5 | --ifm-heading-font-family: "Inter", sans-serif; 6 | --ifm-font-family-base: "Inter", sans-serif; 7 | } 8 | -------------------------------------------------------------------------------- /website/src/scss/main.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | @import "abstracts/variables"; 4 | @import "abstracts/mixins"; 5 | 6 | @import "base/reset"; 7 | @import "base/typography"; 8 | 9 | @import "../components/Banner/style"; 10 | @import "../components/CodeSnippet/style"; 11 | @import "../components/Feature/style"; 12 | @import "../components/Highlight/style"; 13 | 14 | @import "sidebar" -------------------------------------------------------------------------------- /website/src/theme/DocItem/Layout/styles.module.css: -------------------------------------------------------------------------------- 1 | .docItemContainer header + *, 2 | .docItemContainer article > *:first-child { 3 | margin-top: 0; 4 | } 5 | 6 | @media (min-width: 997px) { 7 | .docItemCol { 8 | max-width: 75% !important; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /website/src/theme/DocItem/Metadata/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {PageMetadata} from '@docusaurus/theme-common'; 3 | import {useDoc} from '@docusaurus/theme-common/internal'; 4 | export default function DocItemMetadata() { 5 | const {metadata, frontMatter, assets} = useDoc(); 6 | return ( 7 | 13 | ); 14 | } 15 | -------------------------------------------------------------------------------- /website/static/img/case_studies/cancel/app.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/website/static/img/case_studies/cancel/app.gif -------------------------------------------------------------------------------- /website/static/img/case_studies/pull_to_refresh/app.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/website/static/img/case_studies/pull_to_refresh/app.gif -------------------------------------------------------------------------------- /website/static/img/cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/website/static/img/cover.png -------------------------------------------------------------------------------- /website/static/img/essentials/side_effects/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/website/static/img/essentials/side_effects/spinner.gif -------------------------------------------------------------------------------- /website/static/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/website/static/img/favicon.ico -------------------------------------------------------------------------------- /website/static/img/intro/convert_to_class_provider.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/website/static/img/intro/convert_to_class_provider.gif -------------------------------------------------------------------------------- /website/static/img/intro/devtool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/website/static/img/intro/devtool.png -------------------------------------------------------------------------------- /website/static/img/intro/devtool_code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/website/static/img/intro/devtool_code.png -------------------------------------------------------------------------------- /website/static/img/intro/fr/async.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/website/static/img/intro/fr/async.png -------------------------------------------------------------------------------- /website/static/img/intro/fr/declare_anywhere.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/website/static/img/intro/fr/declare_anywhere.png -------------------------------------------------------------------------------- /website/static/img/intro/lint.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/website/static/img/intro/lint.gif -------------------------------------------------------------------------------- /website/static/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/website/static/img/logo.png -------------------------------------------------------------------------------- /website/static/img/snippets/greetingProvider.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrousselGit/riverpod/4eecf80511b387589aadfe137c8d21671ebdb42e/website/static/img/snippets/greetingProvider.gif -------------------------------------------------------------------------------- /website/static/snippets/create.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: use_key_in_widget_constructors 2 | 3 | import 'dart:convert'; 4 | 5 | import 'package:http/http.dart' as http; 6 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 7 | 8 | part 'create.g.dart'; 9 | 10 | /* SNIPPET START */ 11 | 12 | @riverpod 13 | Future boredSuggestion(Ref ref) async { 14 | final response = await http.get( 15 | Uri.https('boredapi.com', '/api/activity'), 16 | ); 17 | final json = jsonDecode(response.body) as Map; 18 | return json['activity']! as String; 19 | } 20 | -------------------------------------------------------------------------------- /website/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@tsconfig/docusaurus/tsconfig.json", 3 | "include": ["src/"] 4 | } --------------------------------------------------------------------------------