diff --git a/packages/flutter_riverpod/CHANGELOG.md b/packages/flutter_riverpod/CHANGELOG.md index f60cf7551..13461aeaa 100644 --- a/packages/flutter_riverpod/CHANGELOG.md +++ b/packages/flutter_riverpod/CHANGELOG.md @@ -307,7 +307,7 @@ Riverpod is now stable! - **Breaking** The return value when reading a `StateProvider` changed. Before, doing `ref.read(someStateProvider)` would return the `StateController` instance. Now, this will only return the state of the `StateController`. - This new behaviour matches `StateNotifierProvider`. + This new behavior matches `StateNotifierProvider`. For a simple migration, the old behavior is available by writing `ref.read(someStateProvider.state)`. @@ -635,7 +635,7 @@ Fix an issue where `*Provider.autoDispose` were not able to specify the ### Bug-fixes - fixed a bug where providers were rebuilding even when not listened to -- fixed `ref.listen` now working when downcasting the value of a provider. +- fixed `ref.listen` now working when downcasing the value of a provider. - fixed a bug where disposing a scoped `ProviderContainer` could cause other `ProviderContainer`s to stop working. - fixed an issue where conditionally depending on an "autoDispose" provider @@ -821,7 +821,7 @@ Removed an assert that could cause issues when an application is partially migra ## 0.14.0+1 -- Re-added `StateProvider.overrideWithValue`/`StateProvider.overrideWithProvider` that were unvoluntarily removed. +- Re-added `StateProvider.overrideWithValue`/`StateProvider.overrideWithProvider` that were involuntarily removed. ## 0.14.0 @@ -1240,3 +1240,5 @@ The behavior is the same. Only the syntax changed. ## 0.1.0 Initial release + + diff --git a/packages/hooks_riverpod/CHANGELOG.md b/packages/hooks_riverpod/CHANGELOG.md index 12e2dc218..56452cb67 100644 --- a/packages/hooks_riverpod/CHANGELOG.md +++ b/packages/hooks_riverpod/CHANGELOG.md @@ -786,7 +786,7 @@ Fix an issue where `*Provider.autoDispose` were not able to specify the ### Bug-fixes - fixed a bug where providers were rebuilding even when not listened to -- fixed `ref.listen` now working when downcasting the value of a provider. +- fixed `ref.listen` now working when downcasing the value of a provider. - fixed a bug where disposing a scoped `ProviderContainer` could cause other `ProviderContainer`s to stop working. - fixed an issue where conditionally depending on an "autoDispose" provider @@ -1435,3 +1435,5 @@ The behavior is the same. Only the syntax changed. ## 0.1.0 Initial release + + diff --git a/packages/riverpod/CHANGELOG.md b/packages/riverpod/CHANGELOG.md index ff15ab0e8..6ead85749 100644 --- a/packages/riverpod/CHANGELOG.md +++ b/packages/riverpod/CHANGELOG.md @@ -404,7 +404,7 @@ Riverpod is now stable! - **Breaking** The return value when reading a `StateProvider` changed. Before, doing `ref.read(someStateProvider)` would return the `StateController` instance. Now, this will only return the state of the `StateController`. - This new behaviour matches `StateNotifierProvider`. + This new behavior matches `StateNotifierProvider`. For a simple migration, the old behavior is available by writing `ref.read(someStateProvider.state)`. @@ -682,7 +682,7 @@ Fix an issue where `*Provider.autoDispose` were not able to specify the ### Bug-fixes - fixed a bug where providers were rebuilding even when not being listened to -- fixed `ref.listen` now working when downcasting the value of a provider. +- fixed `ref.listen` now working when downcasing the value of a provider. - fixed a bug where disposing a scoped `ProviderContainer` could cause other `ProviderContainer`s to stop working. - fixed an issue where conditionally depending on an "autoDispose" provider @@ -821,7 +821,7 @@ Removed an assert that could cause issues when an application is partially migra ## 0.14.0+1 -- Re-added `StateProvider.overrideWithValue`/`StateProvider.overrideWithProvider` that were unvoluntarily removed. +- Re-added `StateProvider.overrideWithValue`/`StateProvider.overrideWithProvider` that were involuntarily removed. ## 0.14.0 @@ -1158,3 +1158,5 @@ The behavior is the same. Only the syntax changed. ## 0.1.0 Initial release + + diff --git a/packages/riverpod_generator/CHANGELOG.md b/packages/riverpod_generator/CHANGELOG.md index 0291c1b0d..80743c3a7 100644 --- a/packages/riverpod_generator/CHANGELOG.md +++ b/packages/riverpod_generator/CHANGELOG.md @@ -194,7 +194,7 @@ Upgrade Riverpod to latest ## 1.1.0 -- The generated hash function of providers is now correctluy private (thanks to @westito) +- The generated hash function of providers is now correctly private (thanks to @westito) - Allow customizing the name of the generated providers (thanks to @trejdych) - Update dependencies. @@ -225,3 +225,5 @@ Fix version conflict with Riverpod ## 1.0.0 Initial release + + diff --git a/packages/riverpod_lint/CHANGELOG.md b/packages/riverpod_lint/CHANGELOG.md index 9a6d39709..686aad4e6 100644 --- a/packages/riverpod_lint/CHANGELOG.md +++ b/packages/riverpod_lint/CHANGELOG.md @@ -9,7 +9,7 @@ ## 2.3.4 - 2023-11-13 -- Updated `scoped_providers_should_specify_dependencies` to ignore instances of using pumpWidget in tests (thanks to [lockieRichter](https://github.com/lockieRichter)) +- Updated `scoped_providers_should_specify_dependencies` to ignore instances of using pumpWidget in tests (thanks to @lockieRichter) ## 2.3.3 - 2023-10-28 @@ -26,7 +26,7 @@ ## 2.3.0 - 2023-10-06 -- Added `async_value_nullable_patttern` lint, to warn against using `AsyncValue(:final value?)` in pattern match when `value` is possibly nullable. +- Added `async_value_nullable_pattern` lint, to warn against using `AsyncValue(:final value?)` in pattern match when `value` is possibly nullable. - Added `protected_notifier_state` lint, which warns against using the `Notifier.state` property of a notifier different than the current one. Aka a Notifier "A" should not directly access the `state` if a Notifier "B". @@ -185,3 +185,5 @@ Fix quick-fix for provider_dependencies ## 1.0.0 Initial release + + diff --git a/website/docs/case_studies/cancel/detail_screen/codegen.g.dart b/website/docs/case_studies/cancel/detail_screen/codegen.g.dart index 69ee1d982..4d688e552 100644 --- a/website/docs/case_studies/cancel/detail_screen/codegen.g.dart +++ b/website/docs/case_studies/cancel/detail_screen/codegen.g.dart @@ -43,4 +43,4 @@ final activityProvider = AutoDisposeFutureProvider.internal( typedef ActivityRef = AutoDisposeFutureProviderRef; // ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member +// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package diff --git a/website/docs/case_studies/cancel/detail_screen_cancel/codegen.g.dart b/website/docs/case_studies/cancel/detail_screen_cancel/codegen.g.dart index d8ec45ada..67a5099bf 100644 --- a/website/docs/case_studies/cancel/detail_screen_cancel/codegen.g.dart +++ b/website/docs/case_studies/cancel/detail_screen_cancel/codegen.g.dart @@ -23,4 +23,4 @@ final activityProvider = AutoDisposeFutureProvider.internal( typedef ActivityRef = AutoDisposeFutureProviderRef; // ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member +// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package diff --git a/website/docs/case_studies/cancel/detail_screen_debounce/codegen.g.dart b/website/docs/case_studies/cancel/detail_screen_debounce/codegen.g.dart index 6d0d3104b..2f62270bc 100644 --- a/website/docs/case_studies/cancel/detail_screen_debounce/codegen.g.dart +++ b/website/docs/case_studies/cancel/detail_screen_debounce/codegen.g.dart @@ -23,4 +23,4 @@ final activityProvider = AutoDisposeFutureProvider.internal( typedef ActivityRef = AutoDisposeFutureProviderRef; // ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member +// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package diff --git a/website/docs/case_studies/cancel/provider_with_extension/codegen.g.dart b/website/docs/case_studies/cancel/provider_with_extension/codegen.g.dart index b3407fc98..7c8195c7b 100644 --- a/website/docs/case_studies/cancel/provider_with_extension/codegen.g.dart +++ b/website/docs/case_studies/cancel/provider_with_extension/codegen.g.dart @@ -23,4 +23,4 @@ final activityProvider = AutoDisposeFutureProvider.internal( typedef ActivityRef = AutoDisposeFutureProviderRef; // ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member +// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package diff --git a/website/docs/essentials/passing_args/codegen/provider.g.dart b/website/docs/essentials/passing_args/codegen/provider.g.dart index 3225b55ea..7b8a4fd90 100644 --- a/website/docs/essentials/passing_args/codegen/provider.g.dart +++ b/website/docs/essentials/passing_args/codegen/provider.g.dart @@ -59,10 +59,24 @@ abstract class _$ActivityNotifier2 const activityNotifier2Provider = ActivityNotifier2Family(); /// See also [ActivityNotifier2]. -class ActivityNotifier2Family extends Family> { +class ActivityNotifier2Family extends Family { /// See also [ActivityNotifier2]. const ActivityNotifier2Family(); + static const Iterable? _dependencies = null; + + static const Iterable? _allTransitiveDependencies = null; + + @override + Iterable? get dependencies => _dependencies; + + @override + Iterable? get allTransitiveDependencies => + _allTransitiveDependencies; + + @override + String? get name => r'activityNotifier2Provider'; + /// See also [ActivityNotifier2]. ActivityNotifier2Provider call( String activityType, @@ -72,6 +86,7 @@ class ActivityNotifier2Family extends Family> { ); } + @visibleForOverriding @override ActivityNotifier2Provider getProviderOverride( covariant ActivityNotifier2Provider provider, @@ -81,19 +96,26 @@ class ActivityNotifier2Family extends Family> { ); } - static const Iterable? _dependencies = null; + /// Enables overriding the behavior of this provider, no matter the parameters. + Override overrideWith(ActivityNotifier2 Function() create) { + return _$ActivityNotifier2FamilyOverride(this, create); + } +} - @override - Iterable? get dependencies => _dependencies; +class _$ActivityNotifier2FamilyOverride implements FamilyOverride { + _$ActivityNotifier2FamilyOverride(this.overriddenFamily, this.create); - static const Iterable? _allTransitiveDependencies = null; + final ActivityNotifier2 Function() create; @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; + final ActivityNotifier2Family overriddenFamily; @override - String? get name => r'activityNotifier2Provider'; + ActivityNotifier2Provider getProviderOverride( + covariant ActivityNotifier2Provider provider, + ) { + return provider._copyWith(create); + } } /// See also [ActivityNotifier2]. @@ -117,7 +139,7 @@ class ActivityNotifier2Provider ); ActivityNotifier2Provider._internal( - super._createNotifier, { + super.create, { required super.name, required super.dependencies, required super.allTransitiveDependencies, @@ -153,12 +175,31 @@ class ActivityNotifier2Provider ); } + @override + (String,) get argument { + return (activityType,); + } + @override AutoDisposeAsyncNotifierProviderElement createElement() { return _ActivityNotifier2ProviderElement(this); } + ActivityNotifier2Provider _copyWith( + ActivityNotifier2 Function() create, + ) { + return ActivityNotifier2Provider._internal( + () => create()..activityType = activityType, + name: name, + dependencies: dependencies, + allTransitiveDependencies: allTransitiveDependencies, + debugGetCreateSourceHash: debugGetCreateSourceHash, + from: from, + activityType: activityType, + ); + } + @override bool operator ==(Object other) { return other is ActivityNotifier2Provider &&