From bd4e1d845f354ef34dd99cb8b67881a246e7b579 Mon Sep 17 00:00:00 2001 From: Remi Rousselet Date: Sat, 30 Sep 2023 16:59:40 +0200 Subject: [PATCH] Support generated types / type aliases / typedefs in riverpod_generator (#2934) --- .github/workflows/check_generation.yml | 38 + examples/counter/lib/main.g.dart | 2 +- examples/counter/pubspec.yaml | 1 - examples/marvel/pubspec.yaml | 1 - examples/marvel/test/ensuire_build_test.dart | 10 - examples/pub/lib/detail.g.dart | 2 +- examples/pub/lib/pub_repository.freezed.dart | 392 +++--- examples/pub/lib/pub_repository.g.dart | 65 +- examples/pub/lib/search.g.dart | 2 +- examples/pub/pubspec.yaml | 1 - examples/pub/test/ensuire_build_test.dart | 10 - examples/random_number/pubspec.yaml | 1 - .../test/ensuire_build_test.dart | 10 - .../stackoverflow/lib/question.freezed.dart | 120 +- examples/stackoverflow/lib/question.g.dart | 14 +- examples/stackoverflow/lib/tag.freezed.dart | 35 +- examples/stackoverflow/lib/user.freezed.dart | 80 +- examples/stackoverflow/lib/user.g.dart | 11 +- examples/stackoverflow/pubspec.yaml | 1 - .../test/ensuire_build_test.dart | 10 - examples/todos/pubspec.yaml | 1 - examples/todos/test/ensuire_build_test.dart | 10 - packages/riverpod/example/build.yaml | 2 +- .../riverpod/example/lib/models.freezed.dart | 168 +-- packages/riverpod/example/lib/models.g.dart | 26 +- packages/riverpod/example/pubspec.yaml | 1 - .../example/test/ensure_build_test.dart | 10 - .../generator_provider_declaration.dart | 144 ++- .../generator_provider_declaration_test.dart | 47 +- packages/riverpod_generator/CHANGELOG.md | 19 + .../integration/build_yaml/lib/main.g.dart | 2 +- .../integration/build_yaml/pubspec.yaml | 1 - .../build_yaml/test/build_yaml_test.dart | 38 - .../lib/src/parse_generator.dart | 5 +- .../lib/src/riverpod_generator.dart | 2 +- .../src/templates/class_based_provider.dart | 8 +- .../lib/src/templates/family.dart | 52 +- .../src/templates/functional_provider.dart | 8 +- .../lib/src/templates/parameters.dart | 42 +- packages/riverpod_generator/pubspec.yaml | 7 +- .../test/ensuire_build_test.dart | 10 - .../test/integration/async.g.dart | 2 +- .../test/integration/auto_dispose.g.dart | 2 +- .../test/integration/dependencies.g.dart | 2 +- .../test/integration/dependencies2.g.dart | 2 +- .../test/integration/generated.dart | 83 ++ .../test/integration/generated.freezed.dart | 74 ++ .../test/integration/generated.g.dart | 1064 +++++++++++++++++ .../test/integration/hash/hash1.g.dart | 2 +- .../test/integration/scopes.g.dart | 2 +- .../test/integration/split.g.dart | 2 +- .../test/integration/stream.g.dart | 2 +- .../test/integration/sync.g.dart | 76 +- .../generated/golden/lib/sync.g.dart | 2 +- .../integration/generated/golden/pubspec.yaml | 1 - .../golden/test/ensuire_build_test.dart | 11 - .../src/lints/unsupported_provider_value.dart | 17 +- packages/riverpod_lint/pubspec.yaml | 2 +- .../riverpod_lint_flutter_test/pubspec.yaml | 4 +- ..._class_based_provider_to_functional.g.dart | 2 +- ..._functional_provider_to_class_based.g.dart | 2 +- .../test/ensuire_build_test.dart | 10 - .../avoid_build_context_in_providers.g.dart | 2 +- .../test/lints/dependencies.g.dart | 2 +- .../test/lints/functional_ref.g.dart | 2 +- .../notifier_extends/notifier_extends.g.dart | 2 +- .../provider_dependencies.g.dart | 2 +- .../test/lints/provider_parameters.g.dart | 2 +- ...oviders_should_specify_dependencies.g.dart | 2 +- .../lints/unsupported_provider_value.g.dart | 26 +- .../concepts/provider_observer_logger.dart | 2 +- .../docs/concepts/reading_consumer_hook.dart | 2 +- .../reading_consumer_hook_widget.dart | 2 +- .../reading_consumer_stateful_widget.dart | 2 +- .../concepts/reading_consumer_widget.dart | 2 +- website/docs/concepts/reading_listen.dart | 2 +- .../docs/concepts/reading_listen_build.dart | 4 +- website/docs/concepts/reading_read.dart | 4 +- ...reading_stateful_hook_consumer_widget.dart | 2 +- .../docs/concepts/reading_watch_build.dart | 2 +- website/docs/cookbooks/testing_flutter.dart | 2 +- website/docs/cookbooks/testing_full.dart | 2 +- .../docs/cookbooks/testing_override_info.dart | 2 +- .../todos_consumer.dart | 2 +- .../provider/optimized_previous_button.dart | 2 +- .../provider/unoptimized_previous_button.dart | 2 +- .../todos_consumer.dart | 2 +- .../docs/providers/state_provider/full.dart | 4 +- .../state_provider/update_read_once.dart | 2 +- .../state_provider/update_read_twice.dart | 2 +- .../concepts/provider_observer_logger.dart | 2 +- .../concepts/reading_consumer_hook.dart | 2 +- .../reading_consumer_hook_widget.dart | 2 +- .../reading_consumer_stateful_widget.dart | 2 +- .../concepts/reading_consumer_widget.dart | 2 +- .../current/concepts/reading_listen.dart | 2 +- .../concepts/reading_listen_build.dart | 4 +- .../current/concepts/reading_read.dart | 4 +- .../current/concepts/reading_watch_build.dart | 2 +- .../current/cookbooks/testing_flutter.dart | 2 +- .../current/cookbooks/testing_full.dart | 2 +- .../cookbooks/testing_override_info.dart | 2 +- .../provider/optimized_previous_button.dart | 2 +- .../provider/unoptimized_previous_button.dart | 2 +- .../todos_consumer.dart | 2 +- .../providers/state_provider/full.dart | 4 +- .../state_provider/update_read_once.dart | 2 +- .../state_provider/update_read_twice.dart | 2 +- .../concepts/provider_observer_logger.dart | 2 +- .../concepts/reading_consumer_hook.dart | 2 +- .../reading_consumer_hook_widget.dart | 2 +- .../reading_consumer_stateful_widget.dart | 2 +- .../concepts/reading_consumer_widget.dart | 2 +- .../current/concepts/reading_listen.dart | 2 +- .../concepts/reading_listen_build.dart | 4 +- .../current/concepts/reading_read.dart | 4 +- .../current/concepts/reading_watch_build.dart | 2 +- .../current/cookbooks/testing_flutter.dart | 2 +- .../current/cookbooks/testing_full.dart | 2 +- .../cookbooks/testing_override_info.dart | 2 +- .../provider/optimized_previous_button.dart | 2 +- .../provider/unoptimized_previous_button.dart | 2 +- .../todos_consumer.dart | 2 +- .../providers/state_provider/full.dart | 4 +- .../state_provider/update_read_once.dart | 2 +- .../state_provider/update_read_twice.dart | 2 +- .../provider/optimized_previous_button.dart | 2 +- .../provider/unoptimized_previous_button.dart | 2 +- .../todos_consumer.dart | 2 +- .../providers/state_provider/full.dart | 4 +- .../state_provider/update_read_once.dart | 2 +- .../state_provider/update_read_twice.dart | 2 +- .../concepts/provider_observer_logger.dart | 2 +- .../concepts/reading_consumer_hook.dart | 2 +- .../reading_consumer_hook_widget.dart | 2 +- .../reading_consumer_stateful_widget.dart | 2 +- .../concepts/reading_consumer_widget.dart | 2 +- .../current/concepts/reading_listen.dart | 2 +- .../concepts/reading_listen_build.dart | 4 +- .../current/concepts/reading_read.dart | 4 +- .../current/concepts/reading_watch_build.dart | 2 +- .../todos_consumer.dart | 2 +- .../provider/optimized_previous_button.dart | 2 +- .../provider/unoptimized_previous_button.dart | 2 +- .../todos_consumer.dart | 2 +- .../providers/state_provider/full.dart | 4 +- .../state_provider/update_read_once.dart | 2 +- .../state_provider/update_read_twice.dart | 2 +- .../concepts/provider_observer_logger.dart | 2 +- .../concepts/reading_consumer_hook.dart | 2 +- .../reading_consumer_hook_widget.dart | 2 +- .../reading_consumer_stateful_widget.dart | 2 +- .../concepts/reading_consumer_widget.dart | 2 +- .../current/concepts/reading_read.dart | 4 +- ...reading_stateful_hook_consumer_widget.dart | 2 +- .../current/concepts/reading_watch_build.dart | 2 +- .../current/cookbooks/testing_flutter.dart | 2 +- .../current/cookbooks/testing_full.dart | 2 +- .../cookbooks/testing_override_info.dart | 2 +- .../provider/optimized_previous_button.dart | 2 +- .../provider/unoptimized_previous_button.dart | 2 +- .../todos_consumer.dart | 2 +- .../providers/state_provider/full.dart | 4 +- .../state_provider/update_read_twice.dart | 2 +- .../concepts/provider_observer_logger.dart | 2 +- .../concepts/reading_consumer_hook.dart | 2 +- .../reading_consumer_hook_widget.dart | 2 +- .../reading_consumer_stateful_widget.dart | 2 +- .../concepts/reading_consumer_widget.dart | 2 +- .../current/concepts/reading_listen.dart | 2 +- .../concepts/reading_listen_build.dart | 4 +- .../current/concepts/reading_read.dart | 4 +- ...reading_stateful_hook_consumer_widget.dart | 2 +- .../current/concepts/reading_watch_build.dart | 2 +- .../current/cookbooks/testing_flutter.dart | 2 +- .../current/cookbooks/testing_full.dart | 2 +- .../cookbooks/testing_override_info.dart | 2 +- .../todos_consumer.dart | 2 +- .../provider/optimized_previous_button.dart | 2 +- .../provider/unoptimized_previous_button.dart | 2 +- .../todos_consumer.dart | 2 +- .../providers/state_provider/full.dart | 4 +- .../state_provider/update_read_once.dart | 2 +- .../state_provider/update_read_twice.dart | 2 +- .../concepts/provider_observer_logger.dart | 2 +- .../concepts/reading_consumer_hook.dart | 2 +- .../reading_consumer_hook_widget.dart | 2 +- .../reading_consumer_stateful_widget.dart | 2 +- .../concepts/reading_consumer_widget.dart | 2 +- .../current/concepts/reading_listen.dart | 2 +- .../concepts/reading_listen_build.dart | 4 +- .../current/concepts/reading_read.dart | 4 +- .../current/concepts/reading_watch_build.dart | 2 +- .../current/cookbooks/testing_flutter.dart | 2 +- .../current/cookbooks/testing_full.dart | 2 +- .../cookbooks/testing_override_info.dart | 2 +- .../provider/optimized_previous_button.dart | 2 +- .../provider/unoptimized_previous_button.dart | 2 +- .../todos_consumer.dart | 2 +- .../providers/state_provider/full.dart | 4 +- .../state_provider/update_read_once.dart | 2 +- .../state_provider/update_read_twice.dart | 2 +- .../concepts/provider_observer_logger.dart | 2 +- .../concepts/reading_consumer_hook.dart | 2 +- .../reading_consumer_hook_widget.dart | 2 +- .../reading_consumer_stateful_widget.dart | 2 +- .../concepts/reading_consumer_widget.dart | 2 +- .../current/concepts/reading_listen.dart | 2 +- .../concepts/reading_listen_build.dart | 4 +- .../current/concepts/reading_read.dart | 4 +- ...reading_stateful_hook_consumer_widget.dart | 2 +- .../current/concepts/reading_watch_build.dart | 2 +- .../current/cookbooks/testing_flutter.dart | 2 +- .../current/cookbooks/testing_full.dart | 2 +- .../cookbooks/testing_override_info.dart | 2 +- .../todos_consumer.dart | 2 +- .../provider/optimized_previous_button.dart | 2 +- .../provider/unoptimized_previous_button.dart | 2 +- .../todos_consumer.dart | 2 +- .../providers/state_provider/full.dart | 4 +- .../state_provider/update_read_once.dart | 2 +- .../state_provider/update_read_twice.dart | 2 +- website/pubspec.yaml | 3 +- website/test/ensuire_build_test.dart | 10 - 224 files changed, 2215 insertions(+), 963 deletions(-) create mode 100644 .github/workflows/check_generation.yml delete mode 100644 examples/marvel/test/ensuire_build_test.dart delete mode 100644 examples/pub/test/ensuire_build_test.dart delete mode 100644 examples/random_number/test/ensuire_build_test.dart delete mode 100644 examples/stackoverflow/test/ensuire_build_test.dart delete mode 100644 examples/todos/test/ensuire_build_test.dart delete mode 100644 packages/riverpod/example/test/ensure_build_test.dart delete mode 100644 packages/riverpod_generator/integration/build_yaml/test/build_yaml_test.dart delete mode 100644 packages/riverpod_generator/test/ensuire_build_test.dart create mode 100644 packages/riverpod_generator/test/integration/generated.dart create mode 100644 packages/riverpod_generator/test/integration/generated.freezed.dart create mode 100644 packages/riverpod_generator/test/integration/generated.g.dart delete mode 100644 packages/riverpod_graph/test/integration/generated/golden/test/ensuire_build_test.dart delete mode 100644 packages/riverpod_lint_flutter_test/test/ensuire_build_test.dart delete mode 100644 website/test/ensuire_build_test.dart diff --git a/.github/workflows/check_generation.yml b/.github/workflows/check_generation.yml new file mode 100644 index 000000000..2c6679327 --- /dev/null +++ b/.github/workflows/check_generation.yml @@ -0,0 +1,38 @@ +name: Check code-generation + +on: + pull_request: + paths-ignore: + - "**.md" + push: + branches: + - master + paths-ignore: + - "**.md" + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3.1.0 + with: + fetch-depth: 2 + - uses: subosito/flutter-action@v2.7.1 + with: + channel: master + + - name: Add pub cache bin to PATH + run: echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH + - name: Add pub cache to PATH + run: echo "PUB_CACHE="$HOME/.pub-cache"" >> $GITHUB_ENV + - name: Install dependencies + run: flutter pub get + + - run: dart pub global activate melos + + - run: dart pub run melos bootstrap + - run: dart pub run melos run generate + + - name: check there are no uncommitted changes + run: git diff --exit-code diff --git a/examples/counter/lib/main.g.dart b/examples/counter/lib/main.g.dart index 9450b6ad2..3d987a67f 100644 --- a/examples/counter/lib/main.g.dart +++ b/examples/counter/lib/main.g.dart @@ -26,4 +26,4 @@ final counterProvider = AutoDisposeNotifierProvider.internal( typedef _$Counter = AutoDisposeNotifier; // 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 diff --git a/examples/counter/pubspec.yaml b/examples/counter/pubspec.yaml index 5623143ba..0689f1bde 100644 --- a/examples/counter/pubspec.yaml +++ b/examples/counter/pubspec.yaml @@ -24,7 +24,6 @@ dependencies: dev_dependencies: build_runner: ^2.3.3 - build_verify: ^3.0.0 custom_lint: ^0.5.2 flutter_test: sdk: flutter diff --git a/examples/marvel/pubspec.yaml b/examples/marvel/pubspec.yaml index 103c7c65f..761d1ade0 100644 --- a/examples/marvel/pubspec.yaml +++ b/examples/marvel/pubspec.yaml @@ -22,7 +22,6 @@ dependencies: dev_dependencies: build_runner: ^2.0.0 - build_verify: ^3.0.0 flutter_test: sdk: flutter freezed: ^2.1.0 diff --git a/examples/marvel/test/ensuire_build_test.dart b/examples/marvel/test/ensuire_build_test.dart deleted file mode 100644 index 93248074a..000000000 --- a/examples/marvel/test/ensuire_build_test.dart +++ /dev/null @@ -1,10 +0,0 @@ -import 'package:build_verify/build_verify.dart'; -import 'package:flutter_test/flutter_test.dart'; - -void main() { - test('ensure_build', () { - expectBuildClean( - packageRelativeDirectory: 'examples/marvel', - ); - }); -} diff --git a/examples/pub/lib/detail.g.dart b/examples/pub/lib/detail.g.dart index 751e95783..d114c07c9 100644 --- a/examples/pub/lib/detail.g.dart +++ b/examples/pub/lib/detail.g.dart @@ -371,4 +371,4 @@ class _PackageMetricsProviderElement String get packageName => (origin as PackageMetricsProvider).packageName; } // 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 diff --git a/examples/pub/lib/pub_repository.freezed.dart b/examples/pub/lib/pub_repository.freezed.dart index cff8a08db..526229bc9 100644 --- a/examples/pub/lib/pub_repository.freezed.dart +++ b/examples/pub/lib/pub_repository.freezed.dart @@ -91,11 +91,11 @@ class _$PackageMetricsScoreCopyWithImpl<$Res, $Val extends PackageMetricsScore> } /// @nodoc -abstract class _$$_PackageMetricsScoreCopyWith<$Res> +abstract class _$$PackageMetricsScoreImplCopyWith<$Res> implements $PackageMetricsScoreCopyWith<$Res> { - factory _$$_PackageMetricsScoreCopyWith(_$_PackageMetricsScore value, - $Res Function(_$_PackageMetricsScore) then) = - __$$_PackageMetricsScoreCopyWithImpl<$Res>; + factory _$$PackageMetricsScoreImplCopyWith(_$PackageMetricsScoreImpl value, + $Res Function(_$PackageMetricsScoreImpl) then) = + __$$PackageMetricsScoreImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -107,11 +107,11 @@ abstract class _$$_PackageMetricsScoreCopyWith<$Res> } /// @nodoc -class __$$_PackageMetricsScoreCopyWithImpl<$Res> - extends _$PackageMetricsScoreCopyWithImpl<$Res, _$_PackageMetricsScore> - implements _$$_PackageMetricsScoreCopyWith<$Res> { - __$$_PackageMetricsScoreCopyWithImpl(_$_PackageMetricsScore _value, - $Res Function(_$_PackageMetricsScore) _then) +class __$$PackageMetricsScoreImplCopyWithImpl<$Res> + extends _$PackageMetricsScoreCopyWithImpl<$Res, _$PackageMetricsScoreImpl> + implements _$$PackageMetricsScoreImplCopyWith<$Res> { + __$$PackageMetricsScoreImplCopyWithImpl(_$PackageMetricsScoreImpl _value, + $Res Function(_$PackageMetricsScoreImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -123,7 +123,7 @@ class __$$_PackageMetricsScoreCopyWithImpl<$Res> Object? popularityScore = null, Object? tags = null, }) { - return _then(_$_PackageMetricsScore( + return _then(_$PackageMetricsScoreImpl( grantedPoints: null == grantedPoints ? _value.grantedPoints : grantedPoints // ignore: cast_nullable_to_non_nullable @@ -150,10 +150,10 @@ class __$$_PackageMetricsScoreCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$_PackageMetricsScore +class _$PackageMetricsScoreImpl with DiagnosticableTreeMixin implements _PackageMetricsScore { - _$_PackageMetricsScore( + _$PackageMetricsScoreImpl( {required this.grantedPoints, required this.maxPoints, required this.likeCount, @@ -161,8 +161,8 @@ class _$_PackageMetricsScore required final List tags}) : _tags = tags; - factory _$_PackageMetricsScore.fromJson(Map json) => - _$$_PackageMetricsScoreFromJson(json); + factory _$PackageMetricsScoreImpl.fromJson(Map json) => + _$$PackageMetricsScoreImplFromJson(json); @override final int grantedPoints; @@ -201,7 +201,7 @@ class _$_PackageMetricsScore bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_PackageMetricsScore && + other is _$PackageMetricsScoreImpl && (identical(other.grantedPoints, grantedPoints) || other.grantedPoints == grantedPoints) && (identical(other.maxPoints, maxPoints) || @@ -221,13 +221,13 @@ class _$_PackageMetricsScore @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_PackageMetricsScoreCopyWith<_$_PackageMetricsScore> get copyWith => - __$$_PackageMetricsScoreCopyWithImpl<_$_PackageMetricsScore>( + _$$PackageMetricsScoreImplCopyWith<_$PackageMetricsScoreImpl> get copyWith => + __$$PackageMetricsScoreImplCopyWithImpl<_$PackageMetricsScoreImpl>( this, _$identity); @override Map toJson() { - return _$$_PackageMetricsScoreToJson( + return _$$PackageMetricsScoreImplToJson( this, ); } @@ -239,10 +239,10 @@ abstract class _PackageMetricsScore implements PackageMetricsScore { required final int maxPoints, required final int likeCount, required final double popularityScore, - required final List tags}) = _$_PackageMetricsScore; + required final List tags}) = _$PackageMetricsScoreImpl; factory _PackageMetricsScore.fromJson(Map json) = - _$_PackageMetricsScore.fromJson; + _$PackageMetricsScoreImpl.fromJson; @override int get grantedPoints; @@ -256,7 +256,7 @@ abstract class _PackageMetricsScore implements PackageMetricsScore { List get tags; @override @JsonKey(ignore: true) - _$$_PackageMetricsScoreCopyWith<_$_PackageMetricsScore> get copyWith => + _$$PackageMetricsScoreImplCopyWith<_$PackageMetricsScoreImpl> get copyWith => throw _privateConstructorUsedError; } @@ -320,11 +320,12 @@ class _$PackageMetricsResponseCopyWithImpl<$Res, } /// @nodoc -abstract class _$$_PackageMetricsResponseCopyWith<$Res> +abstract class _$$PackageMetricsResponseImplCopyWith<$Res> implements $PackageMetricsResponseCopyWith<$Res> { - factory _$$_PackageMetricsResponseCopyWith(_$_PackageMetricsResponse value, - $Res Function(_$_PackageMetricsResponse) then) = - __$$_PackageMetricsResponseCopyWithImpl<$Res>; + factory _$$PackageMetricsResponseImplCopyWith( + _$PackageMetricsResponseImpl value, + $Res Function(_$PackageMetricsResponseImpl) then) = + __$$PackageMetricsResponseImplCopyWithImpl<$Res>; @override @useResult $Res call({PackageMetricsScore score}); @@ -334,12 +335,13 @@ abstract class _$$_PackageMetricsResponseCopyWith<$Res> } /// @nodoc -class __$$_PackageMetricsResponseCopyWithImpl<$Res> +class __$$PackageMetricsResponseImplCopyWithImpl<$Res> extends _$PackageMetricsResponseCopyWithImpl<$Res, - _$_PackageMetricsResponse> - implements _$$_PackageMetricsResponseCopyWith<$Res> { - __$$_PackageMetricsResponseCopyWithImpl(_$_PackageMetricsResponse _value, - $Res Function(_$_PackageMetricsResponse) _then) + _$PackageMetricsResponseImpl> + implements _$$PackageMetricsResponseImplCopyWith<$Res> { + __$$PackageMetricsResponseImplCopyWithImpl( + _$PackageMetricsResponseImpl _value, + $Res Function(_$PackageMetricsResponseImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -347,7 +349,7 @@ class __$$_PackageMetricsResponseCopyWithImpl<$Res> $Res call({ Object? score = null, }) { - return _then(_$_PackageMetricsResponse( + return _then(_$PackageMetricsResponseImpl( score: null == score ? _value.score : score // ignore: cast_nullable_to_non_nullable @@ -358,13 +360,13 @@ class __$$_PackageMetricsResponseCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$_PackageMetricsResponse +class _$PackageMetricsResponseImpl with DiagnosticableTreeMixin implements _PackageMetricsResponse { - _$_PackageMetricsResponse({required this.score}); + _$PackageMetricsResponseImpl({required this.score}); - factory _$_PackageMetricsResponse.fromJson(Map json) => - _$$_PackageMetricsResponseFromJson(json); + factory _$PackageMetricsResponseImpl.fromJson(Map json) => + _$$PackageMetricsResponseImplFromJson(json); @override final PackageMetricsScore score; @@ -386,7 +388,7 @@ class _$_PackageMetricsResponse bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_PackageMetricsResponse && + other is _$PackageMetricsResponseImpl && (identical(other.score, score) || other.score == score)); } @@ -397,13 +399,13 @@ class _$_PackageMetricsResponse @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_PackageMetricsResponseCopyWith<_$_PackageMetricsResponse> get copyWith => - __$$_PackageMetricsResponseCopyWithImpl<_$_PackageMetricsResponse>( - this, _$identity); + _$$PackageMetricsResponseImplCopyWith<_$PackageMetricsResponseImpl> + get copyWith => __$$PackageMetricsResponseImplCopyWithImpl< + _$PackageMetricsResponseImpl>(this, _$identity); @override Map toJson() { - return _$$_PackageMetricsResponseToJson( + return _$$PackageMetricsResponseImplToJson( this, ); } @@ -411,17 +413,17 @@ class _$_PackageMetricsResponse abstract class _PackageMetricsResponse implements PackageMetricsResponse { factory _PackageMetricsResponse({required final PackageMetricsScore score}) = - _$_PackageMetricsResponse; + _$PackageMetricsResponseImpl; factory _PackageMetricsResponse.fromJson(Map json) = - _$_PackageMetricsResponse.fromJson; + _$PackageMetricsResponseImpl.fromJson; @override PackageMetricsScore get score; @override @JsonKey(ignore: true) - _$$_PackageMetricsResponseCopyWith<_$_PackageMetricsResponse> get copyWith => - throw _privateConstructorUsedError; + _$$PackageMetricsResponseImplCopyWith<_$PackageMetricsResponseImpl> + get copyWith => throw _privateConstructorUsedError; } PackageDetails _$PackageDetailsFromJson(Map json) { @@ -478,22 +480,22 @@ class _$PackageDetailsCopyWithImpl<$Res, $Val extends PackageDetails> } /// @nodoc -abstract class _$$_PackageDetailsCopyWith<$Res> +abstract class _$$PackageDetailsImplCopyWith<$Res> implements $PackageDetailsCopyWith<$Res> { - factory _$$_PackageDetailsCopyWith( - _$_PackageDetails value, $Res Function(_$_PackageDetails) then) = - __$$_PackageDetailsCopyWithImpl<$Res>; + factory _$$PackageDetailsImplCopyWith(_$PackageDetailsImpl value, + $Res Function(_$PackageDetailsImpl) then) = + __$$PackageDetailsImplCopyWithImpl<$Res>; @override @useResult $Res call({String version, Pubspec pubspec}); } /// @nodoc -class __$$_PackageDetailsCopyWithImpl<$Res> - extends _$PackageDetailsCopyWithImpl<$Res, _$_PackageDetails> - implements _$$_PackageDetailsCopyWith<$Res> { - __$$_PackageDetailsCopyWithImpl( - _$_PackageDetails _value, $Res Function(_$_PackageDetails) _then) +class __$$PackageDetailsImplCopyWithImpl<$Res> + extends _$PackageDetailsCopyWithImpl<$Res, _$PackageDetailsImpl> + implements _$$PackageDetailsImplCopyWith<$Res> { + __$$PackageDetailsImplCopyWithImpl( + _$PackageDetailsImpl _value, $Res Function(_$PackageDetailsImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -502,7 +504,7 @@ class __$$_PackageDetailsCopyWithImpl<$Res> Object? version = null, Object? pubspec = null, }) { - return _then(_$_PackageDetails( + return _then(_$PackageDetailsImpl( version: null == version ? _value.version : version // ignore: cast_nullable_to_non_nullable @@ -517,13 +519,13 @@ class __$$_PackageDetailsCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$_PackageDetails +class _$PackageDetailsImpl with DiagnosticableTreeMixin implements _PackageDetails { - _$_PackageDetails({required this.version, required this.pubspec}); + _$PackageDetailsImpl({required this.version, required this.pubspec}); - factory _$_PackageDetails.fromJson(Map json) => - _$$_PackageDetailsFromJson(json); + factory _$PackageDetailsImpl.fromJson(Map json) => + _$$PackageDetailsImplFromJson(json); @override final String version; @@ -548,7 +550,7 @@ class _$_PackageDetails bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_PackageDetails && + other is _$PackageDetailsImpl && (identical(other.version, version) || other.version == version) && (identical(other.pubspec, pubspec) || other.pubspec == pubspec)); } @@ -560,12 +562,13 @@ class _$_PackageDetails @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_PackageDetailsCopyWith<_$_PackageDetails> get copyWith => - __$$_PackageDetailsCopyWithImpl<_$_PackageDetails>(this, _$identity); + _$$PackageDetailsImplCopyWith<_$PackageDetailsImpl> get copyWith => + __$$PackageDetailsImplCopyWithImpl<_$PackageDetailsImpl>( + this, _$identity); @override Map toJson() { - return _$$_PackageDetailsToJson( + return _$$PackageDetailsImplToJson( this, ); } @@ -574,10 +577,10 @@ class _$_PackageDetails abstract class _PackageDetails implements PackageDetails { factory _PackageDetails( {required final String version, - required final Pubspec pubspec}) = _$_PackageDetails; + required final Pubspec pubspec}) = _$PackageDetailsImpl; factory _PackageDetails.fromJson(Map json) = - _$_PackageDetails.fromJson; + _$PackageDetailsImpl.fromJson; @override String get version; @@ -585,7 +588,7 @@ abstract class _PackageDetails implements PackageDetails { Pubspec get pubspec; @override @JsonKey(ignore: true) - _$$_PackageDetailsCopyWith<_$_PackageDetails> get copyWith => + _$$PackageDetailsImplCopyWith<_$PackageDetailsImpl> get copyWith => throw _privateConstructorUsedError; } @@ -651,10 +654,10 @@ class _$PackageCopyWithImpl<$Res, $Val extends Package> } /// @nodoc -abstract class _$$_PackageCopyWith<$Res> implements $PackageCopyWith<$Res> { - factory _$$_PackageCopyWith( - _$_Package value, $Res Function(_$_Package) then) = - __$$_PackageCopyWithImpl<$Res>; +abstract class _$$PackageImplCopyWith<$Res> implements $PackageCopyWith<$Res> { + factory _$$PackageImplCopyWith( + _$PackageImpl value, $Res Function(_$PackageImpl) then) = + __$$PackageImplCopyWithImpl<$Res>; @override @useResult $Res call({String name, PackageDetails latest}); @@ -664,10 +667,11 @@ abstract class _$$_PackageCopyWith<$Res> implements $PackageCopyWith<$Res> { } /// @nodoc -class __$$_PackageCopyWithImpl<$Res> - extends _$PackageCopyWithImpl<$Res, _$_Package> - implements _$$_PackageCopyWith<$Res> { - __$$_PackageCopyWithImpl(_$_Package _value, $Res Function(_$_Package) _then) +class __$$PackageImplCopyWithImpl<$Res> + extends _$PackageCopyWithImpl<$Res, _$PackageImpl> + implements _$$PackageImplCopyWith<$Res> { + __$$PackageImplCopyWithImpl( + _$PackageImpl _value, $Res Function(_$PackageImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -676,7 +680,7 @@ class __$$_PackageCopyWithImpl<$Res> Object? name = null, Object? latest = null, }) { - return _then(_$_Package( + return _then(_$PackageImpl( name: null == name ? _value.name : name // ignore: cast_nullable_to_non_nullable @@ -691,11 +695,11 @@ class __$$_PackageCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$_Package with DiagnosticableTreeMixin implements _Package { - _$_Package({required this.name, required this.latest}); +class _$PackageImpl with DiagnosticableTreeMixin implements _Package { + _$PackageImpl({required this.name, required this.latest}); - factory _$_Package.fromJson(Map json) => - _$$_PackageFromJson(json); + factory _$PackageImpl.fromJson(Map json) => + _$$PackageImplFromJson(json); @override final String name; @@ -720,7 +724,7 @@ class _$_Package with DiagnosticableTreeMixin implements _Package { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_Package && + other is _$PackageImpl && (identical(other.name, name) || other.name == name) && (identical(other.latest, latest) || other.latest == latest)); } @@ -732,12 +736,12 @@ class _$_Package with DiagnosticableTreeMixin implements _Package { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_PackageCopyWith<_$_Package> get copyWith => - __$$_PackageCopyWithImpl<_$_Package>(this, _$identity); + _$$PackageImplCopyWith<_$PackageImpl> get copyWith => + __$$PackageImplCopyWithImpl<_$PackageImpl>(this, _$identity); @override Map toJson() { - return _$$_PackageToJson( + return _$$PackageImplToJson( this, ); } @@ -746,9 +750,9 @@ class _$_Package with DiagnosticableTreeMixin implements _Package { abstract class _Package implements Package { factory _Package( {required final String name, - required final PackageDetails latest}) = _$_Package; + required final PackageDetails latest}) = _$PackageImpl; - factory _Package.fromJson(Map json) = _$_Package.fromJson; + factory _Package.fromJson(Map json) = _$PackageImpl.fromJson; @override String get name; @@ -756,7 +760,7 @@ abstract class _Package implements Package { PackageDetails get latest; @override @JsonKey(ignore: true) - _$$_PackageCopyWith<_$_Package> get copyWith => + _$$PackageImplCopyWith<_$PackageImpl> get copyWith => throw _privateConstructorUsedError; } @@ -814,22 +818,22 @@ class _$LikedPackageCopyWithImpl<$Res, $Val extends LikedPackage> } /// @nodoc -abstract class _$$_LikedPackageCopyWith<$Res> +abstract class _$$LikedPackageImplCopyWith<$Res> implements $LikedPackageCopyWith<$Res> { - factory _$$_LikedPackageCopyWith( - _$_LikedPackage value, $Res Function(_$_LikedPackage) then) = - __$$_LikedPackageCopyWithImpl<$Res>; + factory _$$LikedPackageImplCopyWith( + _$LikedPackageImpl value, $Res Function(_$LikedPackageImpl) then) = + __$$LikedPackageImplCopyWithImpl<$Res>; @override @useResult $Res call({String package, bool liked}); } /// @nodoc -class __$$_LikedPackageCopyWithImpl<$Res> - extends _$LikedPackageCopyWithImpl<$Res, _$_LikedPackage> - implements _$$_LikedPackageCopyWith<$Res> { - __$$_LikedPackageCopyWithImpl( - _$_LikedPackage _value, $Res Function(_$_LikedPackage) _then) +class __$$LikedPackageImplCopyWithImpl<$Res> + extends _$LikedPackageCopyWithImpl<$Res, _$LikedPackageImpl> + implements _$$LikedPackageImplCopyWith<$Res> { + __$$LikedPackageImplCopyWithImpl( + _$LikedPackageImpl _value, $Res Function(_$LikedPackageImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -838,7 +842,7 @@ class __$$_LikedPackageCopyWithImpl<$Res> Object? package = null, Object? liked = null, }) { - return _then(_$_LikedPackage( + return _then(_$LikedPackageImpl( package: null == package ? _value.package : package // ignore: cast_nullable_to_non_nullable @@ -853,11 +857,11 @@ class __$$_LikedPackageCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$_LikedPackage with DiagnosticableTreeMixin implements _LikedPackage { - _$_LikedPackage({required this.package, required this.liked}); +class _$LikedPackageImpl with DiagnosticableTreeMixin implements _LikedPackage { + _$LikedPackageImpl({required this.package, required this.liked}); - factory _$_LikedPackage.fromJson(Map json) => - _$$_LikedPackageFromJson(json); + factory _$LikedPackageImpl.fromJson(Map json) => + _$$LikedPackageImplFromJson(json); @override final String package; @@ -882,7 +886,7 @@ class _$_LikedPackage with DiagnosticableTreeMixin implements _LikedPackage { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_LikedPackage && + other is _$LikedPackageImpl && (identical(other.package, package) || other.package == package) && (identical(other.liked, liked) || other.liked == liked)); } @@ -894,12 +898,12 @@ class _$_LikedPackage with DiagnosticableTreeMixin implements _LikedPackage { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_LikedPackageCopyWith<_$_LikedPackage> get copyWith => - __$$_LikedPackageCopyWithImpl<_$_LikedPackage>(this, _$identity); + _$$LikedPackageImplCopyWith<_$LikedPackageImpl> get copyWith => + __$$LikedPackageImplCopyWithImpl<_$LikedPackageImpl>(this, _$identity); @override Map toJson() { - return _$$_LikedPackageToJson( + return _$$LikedPackageImplToJson( this, ); } @@ -908,10 +912,10 @@ class _$_LikedPackage with DiagnosticableTreeMixin implements _LikedPackage { abstract class _LikedPackage implements LikedPackage { factory _LikedPackage( {required final String package, - required final bool liked}) = _$_LikedPackage; + required final bool liked}) = _$LikedPackageImpl; factory _LikedPackage.fromJson(Map json) = - _$_LikedPackage.fromJson; + _$LikedPackageImpl.fromJson; @override String get package; @@ -919,7 +923,7 @@ abstract class _LikedPackage implements LikedPackage { bool get liked; @override @JsonKey(ignore: true) - _$$_LikedPackageCopyWith<_$_LikedPackage> get copyWith => + _$$LikedPackageImplCopyWith<_$LikedPackageImpl> get copyWith => throw _privateConstructorUsedError; } @@ -973,22 +977,24 @@ class _$LikedPackagesResponseCopyWithImpl<$Res, } /// @nodoc -abstract class _$$_LikesPackagesResponseCopyWith<$Res> +abstract class _$$LikesPackagesResponseImplCopyWith<$Res> implements $LikedPackagesResponseCopyWith<$Res> { - factory _$$_LikesPackagesResponseCopyWith(_$_LikesPackagesResponse value, - $Res Function(_$_LikesPackagesResponse) then) = - __$$_LikesPackagesResponseCopyWithImpl<$Res>; + factory _$$LikesPackagesResponseImplCopyWith( + _$LikesPackagesResponseImpl value, + $Res Function(_$LikesPackagesResponseImpl) then) = + __$$LikesPackagesResponseImplCopyWithImpl<$Res>; @override @useResult $Res call({List likedPackages}); } /// @nodoc -class __$$_LikesPackagesResponseCopyWithImpl<$Res> - extends _$LikedPackagesResponseCopyWithImpl<$Res, _$_LikesPackagesResponse> - implements _$$_LikesPackagesResponseCopyWith<$Res> { - __$$_LikesPackagesResponseCopyWithImpl(_$_LikesPackagesResponse _value, - $Res Function(_$_LikesPackagesResponse) _then) +class __$$LikesPackagesResponseImplCopyWithImpl<$Res> + extends _$LikedPackagesResponseCopyWithImpl<$Res, + _$LikesPackagesResponseImpl> + implements _$$LikesPackagesResponseImplCopyWith<$Res> { + __$$LikesPackagesResponseImplCopyWithImpl(_$LikesPackagesResponseImpl _value, + $Res Function(_$LikesPackagesResponseImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -996,7 +1002,7 @@ class __$$_LikesPackagesResponseCopyWithImpl<$Res> $Res call({ Object? likedPackages = null, }) { - return _then(_$_LikesPackagesResponse( + return _then(_$LikesPackagesResponseImpl( likedPackages: null == likedPackages ? _value._likedPackages : likedPackages // ignore: cast_nullable_to_non_nullable @@ -1007,14 +1013,14 @@ class __$$_LikesPackagesResponseCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$_LikesPackagesResponse +class _$LikesPackagesResponseImpl with DiagnosticableTreeMixin implements _LikesPackagesResponse { - _$_LikesPackagesResponse({required final List likedPackages}) + _$LikesPackagesResponseImpl({required final List likedPackages}) : _likedPackages = likedPackages; - factory _$_LikesPackagesResponse.fromJson(Map json) => - _$$_LikesPackagesResponseFromJson(json); + factory _$LikesPackagesResponseImpl.fromJson(Map json) => + _$$LikesPackagesResponseImplFromJson(json); final List _likedPackages; @override @@ -1041,7 +1047,7 @@ class _$_LikesPackagesResponse bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_LikesPackagesResponse && + other is _$LikesPackagesResponseImpl && const DeepCollectionEquality() .equals(other._likedPackages, _likedPackages)); } @@ -1054,13 +1060,13 @@ class _$_LikesPackagesResponse @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_LikesPackagesResponseCopyWith<_$_LikesPackagesResponse> get copyWith => - __$$_LikesPackagesResponseCopyWithImpl<_$_LikesPackagesResponse>( - this, _$identity); + _$$LikesPackagesResponseImplCopyWith<_$LikesPackagesResponseImpl> + get copyWith => __$$LikesPackagesResponseImplCopyWithImpl< + _$LikesPackagesResponseImpl>(this, _$identity); @override Map toJson() { - return _$$_LikesPackagesResponseToJson( + return _$$LikesPackagesResponseImplToJson( this, ); } @@ -1069,17 +1075,17 @@ class _$_LikesPackagesResponse abstract class _LikesPackagesResponse implements LikedPackagesResponse { factory _LikesPackagesResponse( {required final List likedPackages}) = - _$_LikesPackagesResponse; + _$LikesPackagesResponseImpl; factory _LikesPackagesResponse.fromJson(Map json) = - _$_LikesPackagesResponse.fromJson; + _$LikesPackagesResponseImpl.fromJson; @override List get likedPackages; @override @JsonKey(ignore: true) - _$$_LikesPackagesResponseCopyWith<_$_LikesPackagesResponse> get copyWith => - throw _privateConstructorUsedError; + _$$LikesPackagesResponseImplCopyWith<_$LikesPackagesResponseImpl> + get copyWith => throw _privateConstructorUsedError; } PubPackagesResponse _$PubPackagesResponseFromJson(Map json) { @@ -1130,22 +1136,22 @@ class _$PubPackagesResponseCopyWithImpl<$Res, $Val extends PubPackagesResponse> } /// @nodoc -abstract class _$$_PubPackagesResponseCopyWith<$Res> +abstract class _$$PubPackagesResponseImplCopyWith<$Res> implements $PubPackagesResponseCopyWith<$Res> { - factory _$$_PubPackagesResponseCopyWith(_$_PubPackagesResponse value, - $Res Function(_$_PubPackagesResponse) then) = - __$$_PubPackagesResponseCopyWithImpl<$Res>; + factory _$$PubPackagesResponseImplCopyWith(_$PubPackagesResponseImpl value, + $Res Function(_$PubPackagesResponseImpl) then) = + __$$PubPackagesResponseImplCopyWithImpl<$Res>; @override @useResult $Res call({List packages}); } /// @nodoc -class __$$_PubPackagesResponseCopyWithImpl<$Res> - extends _$PubPackagesResponseCopyWithImpl<$Res, _$_PubPackagesResponse> - implements _$$_PubPackagesResponseCopyWith<$Res> { - __$$_PubPackagesResponseCopyWithImpl(_$_PubPackagesResponse _value, - $Res Function(_$_PubPackagesResponse) _then) +class __$$PubPackagesResponseImplCopyWithImpl<$Res> + extends _$PubPackagesResponseCopyWithImpl<$Res, _$PubPackagesResponseImpl> + implements _$$PubPackagesResponseImplCopyWith<$Res> { + __$$PubPackagesResponseImplCopyWithImpl(_$PubPackagesResponseImpl _value, + $Res Function(_$PubPackagesResponseImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -1153,7 +1159,7 @@ class __$$_PubPackagesResponseCopyWithImpl<$Res> $Res call({ Object? packages = null, }) { - return _then(_$_PubPackagesResponse( + return _then(_$PubPackagesResponseImpl( packages: null == packages ? _value._packages : packages // ignore: cast_nullable_to_non_nullable @@ -1164,14 +1170,14 @@ class __$$_PubPackagesResponseCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$_PubPackagesResponse +class _$PubPackagesResponseImpl with DiagnosticableTreeMixin implements _PubPackagesResponse { - _$_PubPackagesResponse({required final List packages}) + _$PubPackagesResponseImpl({required final List packages}) : _packages = packages; - factory _$_PubPackagesResponse.fromJson(Map json) => - _$$_PubPackagesResponseFromJson(json); + factory _$PubPackagesResponseImpl.fromJson(Map json) => + _$$PubPackagesResponseImplFromJson(json); final List _packages; @override @@ -1198,7 +1204,7 @@ class _$_PubPackagesResponse bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_PubPackagesResponse && + other is _$PubPackagesResponseImpl && const DeepCollectionEquality().equals(other._packages, _packages)); } @@ -1210,13 +1216,13 @@ class _$_PubPackagesResponse @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_PubPackagesResponseCopyWith<_$_PubPackagesResponse> get copyWith => - __$$_PubPackagesResponseCopyWithImpl<_$_PubPackagesResponse>( + _$$PubPackagesResponseImplCopyWith<_$PubPackagesResponseImpl> get copyWith => + __$$PubPackagesResponseImplCopyWithImpl<_$PubPackagesResponseImpl>( this, _$identity); @override Map toJson() { - return _$$_PubPackagesResponseToJson( + return _$$PubPackagesResponseImplToJson( this, ); } @@ -1224,16 +1230,16 @@ class _$_PubPackagesResponse abstract class _PubPackagesResponse implements PubPackagesResponse { factory _PubPackagesResponse({required final List packages}) = - _$_PubPackagesResponse; + _$PubPackagesResponseImpl; factory _PubPackagesResponse.fromJson(Map json) = - _$_PubPackagesResponse.fromJson; + _$PubPackagesResponseImpl.fromJson; @override List get packages; @override @JsonKey(ignore: true) - _$$_PubPackagesResponseCopyWith<_$_PubPackagesResponse> get copyWith => + _$$PubPackagesResponseImplCopyWith<_$PubPackagesResponseImpl> get copyWith => throw _privateConstructorUsedError; } @@ -1285,22 +1291,22 @@ class _$SearchPackageCopyWithImpl<$Res, $Val extends SearchPackage> } /// @nodoc -abstract class _$$_SearchPackageCopyWith<$Res> +abstract class _$$SearchPackageImplCopyWith<$Res> implements $SearchPackageCopyWith<$Res> { - factory _$$_SearchPackageCopyWith( - _$_SearchPackage value, $Res Function(_$_SearchPackage) then) = - __$$_SearchPackageCopyWithImpl<$Res>; + factory _$$SearchPackageImplCopyWith( + _$SearchPackageImpl value, $Res Function(_$SearchPackageImpl) then) = + __$$SearchPackageImplCopyWithImpl<$Res>; @override @useResult $Res call({String package}); } /// @nodoc -class __$$_SearchPackageCopyWithImpl<$Res> - extends _$SearchPackageCopyWithImpl<$Res, _$_SearchPackage> - implements _$$_SearchPackageCopyWith<$Res> { - __$$_SearchPackageCopyWithImpl( - _$_SearchPackage _value, $Res Function(_$_SearchPackage) _then) +class __$$SearchPackageImplCopyWithImpl<$Res> + extends _$SearchPackageCopyWithImpl<$Res, _$SearchPackageImpl> + implements _$$SearchPackageImplCopyWith<$Res> { + __$$SearchPackageImplCopyWithImpl( + _$SearchPackageImpl _value, $Res Function(_$SearchPackageImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -1308,7 +1314,7 @@ class __$$_SearchPackageCopyWithImpl<$Res> $Res call({ Object? package = null, }) { - return _then(_$_SearchPackage( + return _then(_$SearchPackageImpl( package: null == package ? _value.package : package // ignore: cast_nullable_to_non_nullable @@ -1319,11 +1325,13 @@ class __$$_SearchPackageCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$_SearchPackage with DiagnosticableTreeMixin implements _SearchPackage { - _$_SearchPackage({required this.package}); +class _$SearchPackageImpl + with DiagnosticableTreeMixin + implements _SearchPackage { + _$SearchPackageImpl({required this.package}); - factory _$_SearchPackage.fromJson(Map json) => - _$$_SearchPackageFromJson(json); + factory _$SearchPackageImpl.fromJson(Map json) => + _$$SearchPackageImplFromJson(json); @override final String package; @@ -1345,7 +1353,7 @@ class _$_SearchPackage with DiagnosticableTreeMixin implements _SearchPackage { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_SearchPackage && + other is _$SearchPackageImpl && (identical(other.package, package) || other.package == package)); } @@ -1356,28 +1364,28 @@ class _$_SearchPackage with DiagnosticableTreeMixin implements _SearchPackage { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_SearchPackageCopyWith<_$_SearchPackage> get copyWith => - __$$_SearchPackageCopyWithImpl<_$_SearchPackage>(this, _$identity); + _$$SearchPackageImplCopyWith<_$SearchPackageImpl> get copyWith => + __$$SearchPackageImplCopyWithImpl<_$SearchPackageImpl>(this, _$identity); @override Map toJson() { - return _$$_SearchPackageToJson( + return _$$SearchPackageImplToJson( this, ); } } abstract class _SearchPackage implements SearchPackage { - factory _SearchPackage({required final String package}) = _$_SearchPackage; + factory _SearchPackage({required final String package}) = _$SearchPackageImpl; factory _SearchPackage.fromJson(Map json) = - _$_SearchPackage.fromJson; + _$SearchPackageImpl.fromJson; @override String get package; @override @JsonKey(ignore: true) - _$$_SearchPackageCopyWith<_$_SearchPackage> get copyWith => + _$$SearchPackageImplCopyWith<_$SearchPackageImpl> get copyWith => throw _privateConstructorUsedError; } @@ -1429,22 +1437,22 @@ class _$PubSearchResponseCopyWithImpl<$Res, $Val extends PubSearchResponse> } /// @nodoc -abstract class _$$_PubSearchResponseCopyWith<$Res> +abstract class _$$PubSearchResponseImplCopyWith<$Res> implements $PubSearchResponseCopyWith<$Res> { - factory _$$_PubSearchResponseCopyWith(_$_PubSearchResponse value, - $Res Function(_$_PubSearchResponse) then) = - __$$_PubSearchResponseCopyWithImpl<$Res>; + factory _$$PubSearchResponseImplCopyWith(_$PubSearchResponseImpl value, + $Res Function(_$PubSearchResponseImpl) then) = + __$$PubSearchResponseImplCopyWithImpl<$Res>; @override @useResult $Res call({List packages}); } /// @nodoc -class __$$_PubSearchResponseCopyWithImpl<$Res> - extends _$PubSearchResponseCopyWithImpl<$Res, _$_PubSearchResponse> - implements _$$_PubSearchResponseCopyWith<$Res> { - __$$_PubSearchResponseCopyWithImpl( - _$_PubSearchResponse _value, $Res Function(_$_PubSearchResponse) _then) +class __$$PubSearchResponseImplCopyWithImpl<$Res> + extends _$PubSearchResponseCopyWithImpl<$Res, _$PubSearchResponseImpl> + implements _$$PubSearchResponseImplCopyWith<$Res> { + __$$PubSearchResponseImplCopyWithImpl(_$PubSearchResponseImpl _value, + $Res Function(_$PubSearchResponseImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -1452,7 +1460,7 @@ class __$$_PubSearchResponseCopyWithImpl<$Res> $Res call({ Object? packages = null, }) { - return _then(_$_PubSearchResponse( + return _then(_$PubSearchResponseImpl( packages: null == packages ? _value._packages : packages // ignore: cast_nullable_to_non_nullable @@ -1463,14 +1471,14 @@ class __$$_PubSearchResponseCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$_PubSearchResponse +class _$PubSearchResponseImpl with DiagnosticableTreeMixin implements _PubSearchResponse { - _$_PubSearchResponse({required final List packages}) + _$PubSearchResponseImpl({required final List packages}) : _packages = packages; - factory _$_PubSearchResponse.fromJson(Map json) => - _$$_PubSearchResponseFromJson(json); + factory _$PubSearchResponseImpl.fromJson(Map json) => + _$$PubSearchResponseImplFromJson(json); final List _packages; @override @@ -1497,7 +1505,7 @@ class _$_PubSearchResponse bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_PubSearchResponse && + other is _$PubSearchResponseImpl && const DeepCollectionEquality().equals(other._packages, _packages)); } @@ -1509,13 +1517,13 @@ class _$_PubSearchResponse @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_PubSearchResponseCopyWith<_$_PubSearchResponse> get copyWith => - __$$_PubSearchResponseCopyWithImpl<_$_PubSearchResponse>( + _$$PubSearchResponseImplCopyWith<_$PubSearchResponseImpl> get copyWith => + __$$PubSearchResponseImplCopyWithImpl<_$PubSearchResponseImpl>( this, _$identity); @override Map toJson() { - return _$$_PubSearchResponseToJson( + return _$$PubSearchResponseImplToJson( this, ); } @@ -1523,15 +1531,15 @@ class _$_PubSearchResponse abstract class _PubSearchResponse implements PubSearchResponse { factory _PubSearchResponse({required final List packages}) = - _$_PubSearchResponse; + _$PubSearchResponseImpl; factory _PubSearchResponse.fromJson(Map json) = - _$_PubSearchResponse.fromJson; + _$PubSearchResponseImpl.fromJson; @override List get packages; @override @JsonKey(ignore: true) - _$$_PubSearchResponseCopyWith<_$_PubSearchResponse> get copyWith => + _$$PubSearchResponseImplCopyWith<_$PubSearchResponseImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/examples/pub/lib/pub_repository.g.dart b/examples/pub/lib/pub_repository.g.dart index 6d7519d40..d58e4e823 100644 --- a/examples/pub/lib/pub_repository.g.dart +++ b/examples/pub/lib/pub_repository.g.dart @@ -8,9 +8,9 @@ part of 'pub_repository.dart'; // JsonSerializableGenerator // ************************************************************************** -_$_PackageMetricsScore _$$_PackageMetricsScoreFromJson( +_$PackageMetricsScoreImpl _$$PackageMetricsScoreImplFromJson( Map json) => - _$_PackageMetricsScore( + _$PackageMetricsScoreImpl( grantedPoints: json['grantedPoints'] as int, maxPoints: json['maxPoints'] as int, likeCount: json['likeCount'] as int, @@ -18,8 +18,8 @@ _$_PackageMetricsScore _$$_PackageMetricsScoreFromJson( tags: (json['tags'] as List).map((e) => e as String).toList(), ); -Map _$$_PackageMetricsScoreToJson( - _$_PackageMetricsScore instance) => +Map _$$PackageMetricsScoreImplToJson( + _$PackageMetricsScoreImpl instance) => { 'grantedPoints': instance.grantedPoints, 'maxPoints': instance.maxPoints, @@ -28,101 +28,104 @@ Map _$$_PackageMetricsScoreToJson( 'tags': instance.tags, }; -_$_PackageMetricsResponse _$$_PackageMetricsResponseFromJson( +_$PackageMetricsResponseImpl _$$PackageMetricsResponseImplFromJson( Map json) => - _$_PackageMetricsResponse( + _$PackageMetricsResponseImpl( score: PackageMetricsScore.fromJson(json['score'] as Map), ); -Map _$$_PackageMetricsResponseToJson( - _$_PackageMetricsResponse instance) => +Map _$$PackageMetricsResponseImplToJson( + _$PackageMetricsResponseImpl instance) => { 'score': instance.score, }; -_$_PackageDetails _$$_PackageDetailsFromJson(Map json) => - _$_PackageDetails( +_$PackageDetailsImpl _$$PackageDetailsImplFromJson(Map json) => + _$PackageDetailsImpl( version: json['version'] as String, pubspec: Pubspec.fromJson(json['pubspec'] as Map), ); -Map _$$_PackageDetailsToJson(_$_PackageDetails instance) => +Map _$$PackageDetailsImplToJson( + _$PackageDetailsImpl instance) => { 'version': instance.version, 'pubspec': instance.pubspec, }; -_$_Package _$$_PackageFromJson(Map json) => _$_Package( +_$PackageImpl _$$PackageImplFromJson(Map json) => + _$PackageImpl( name: json['name'] as String, latest: PackageDetails.fromJson(json['latest'] as Map), ); -Map _$$_PackageToJson(_$_Package instance) => +Map _$$PackageImplToJson(_$PackageImpl instance) => { 'name': instance.name, 'latest': instance.latest, }; -_$_LikedPackage _$$_LikedPackageFromJson(Map json) => - _$_LikedPackage( +_$LikedPackageImpl _$$LikedPackageImplFromJson(Map json) => + _$LikedPackageImpl( package: json['package'] as String, liked: json['liked'] as bool, ); -Map _$$_LikedPackageToJson(_$_LikedPackage instance) => +Map _$$LikedPackageImplToJson(_$LikedPackageImpl instance) => { 'package': instance.package, 'liked': instance.liked, }; -_$_LikesPackagesResponse _$$_LikesPackagesResponseFromJson( +_$LikesPackagesResponseImpl _$$LikesPackagesResponseImplFromJson( Map json) => - _$_LikesPackagesResponse( + _$LikesPackagesResponseImpl( likedPackages: (json['likedPackages'] as List) .map((e) => LikedPackage.fromJson(e as Map)) .toList(), ); -Map _$$_LikesPackagesResponseToJson( - _$_LikesPackagesResponse instance) => +Map _$$LikesPackagesResponseImplToJson( + _$LikesPackagesResponseImpl instance) => { 'likedPackages': instance.likedPackages, }; -_$_PubPackagesResponse _$$_PubPackagesResponseFromJson( +_$PubPackagesResponseImpl _$$PubPackagesResponseImplFromJson( Map json) => - _$_PubPackagesResponse( + _$PubPackagesResponseImpl( packages: (json['packages'] as List) .map((e) => Package.fromJson(e as Map)) .toList(), ); -Map _$$_PubPackagesResponseToJson( - _$_PubPackagesResponse instance) => +Map _$$PubPackagesResponseImplToJson( + _$PubPackagesResponseImpl instance) => { 'packages': instance.packages, }; -_$_SearchPackage _$$_SearchPackageFromJson(Map json) => - _$_SearchPackage( +_$SearchPackageImpl _$$SearchPackageImplFromJson(Map json) => + _$SearchPackageImpl( package: json['package'] as String, ); -Map _$$_SearchPackageToJson(_$_SearchPackage instance) => +Map _$$SearchPackageImplToJson(_$SearchPackageImpl instance) => { 'package': instance.package, }; -_$_PubSearchResponse _$$_PubSearchResponseFromJson(Map json) => - _$_PubSearchResponse( +_$PubSearchResponseImpl _$$PubSearchResponseImplFromJson( + Map json) => + _$PubSearchResponseImpl( packages: (json['packages'] as List) .map((e) => SearchPackage.fromJson(e as Map)) .toList(), ); -Map _$$_PubSearchResponseToJson( - _$_PubSearchResponse instance) => +Map _$$PubSearchResponseImplToJson( + _$PubSearchResponseImpl instance) => { 'packages': instance.packages, }; diff --git a/examples/pub/lib/search.g.dart b/examples/pub/lib/search.g.dart index 96fa04c94..fd8dfcdd8 100644 --- a/examples/pub/lib/search.g.dart +++ b/examples/pub/lib/search.g.dart @@ -175,4 +175,4 @@ class _FetchPackagesProviderElement String get search => (origin as FetchPackagesProvider).search; } // 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 diff --git a/examples/pub/pubspec.yaml b/examples/pub/pubspec.yaml index 292f1f192..cb20132a5 100644 --- a/examples/pub/pubspec.yaml +++ b/examples/pub/pubspec.yaml @@ -23,7 +23,6 @@ dependencies: dev_dependencies: build_runner: ^2.0.0 - build_verify: ^3.0.0 flutter_test: sdk: flutter freezed: ^2.1.0 diff --git a/examples/pub/test/ensuire_build_test.dart b/examples/pub/test/ensuire_build_test.dart deleted file mode 100644 index 7f2700dc3..000000000 --- a/examples/pub/test/ensuire_build_test.dart +++ /dev/null @@ -1,10 +0,0 @@ -import 'package:build_verify/build_verify.dart'; -import 'package:flutter_test/flutter_test.dart'; - -void main() { - test('ensure_build', () { - expectBuildClean( - packageRelativeDirectory: 'examples/pub', - ); - }); -} diff --git a/examples/random_number/pubspec.yaml b/examples/random_number/pubspec.yaml index c221d87ac..a7a85a4fd 100644 --- a/examples/random_number/pubspec.yaml +++ b/examples/random_number/pubspec.yaml @@ -14,7 +14,6 @@ dependencies: build_runner: ^2.0.6 dev_dependencies: - build_verify: ^3.0.0 flutter_test: sdk: flutter flutter_lints: ^1.0.0 diff --git a/examples/random_number/test/ensuire_build_test.dart b/examples/random_number/test/ensuire_build_test.dart deleted file mode 100644 index 35331d3a0..000000000 --- a/examples/random_number/test/ensuire_build_test.dart +++ /dev/null @@ -1,10 +0,0 @@ -import 'package:build_verify/build_verify.dart'; -import 'package:flutter_test/flutter_test.dart'; - -void main() { - test('ensure_build', () { - expectBuildClean( - packageRelativeDirectory: 'examples/random_number', - ); - }); -} diff --git a/examples/stackoverflow/lib/question.freezed.dart b/examples/stackoverflow/lib/question.freezed.dart index c21323767..16fca8a77 100644 --- a/examples/stackoverflow/lib/question.freezed.dart +++ b/examples/stackoverflow/lib/question.freezed.dart @@ -68,22 +68,22 @@ class _$QuestionsResponseCopyWithImpl<$Res, $Val extends QuestionsResponse> } /// @nodoc -abstract class _$$_QuestionsResponseCopyWith<$Res> +abstract class _$$QuestionsResponseImplCopyWith<$Res> implements $QuestionsResponseCopyWith<$Res> { - factory _$$_QuestionsResponseCopyWith(_$_QuestionsResponse value, - $Res Function(_$_QuestionsResponse) then) = - __$$_QuestionsResponseCopyWithImpl<$Res>; + factory _$$QuestionsResponseImplCopyWith(_$QuestionsResponseImpl value, + $Res Function(_$QuestionsResponseImpl) then) = + __$$QuestionsResponseImplCopyWithImpl<$Res>; @override @useResult $Res call({List items, int total}); } /// @nodoc -class __$$_QuestionsResponseCopyWithImpl<$Res> - extends _$QuestionsResponseCopyWithImpl<$Res, _$_QuestionsResponse> - implements _$$_QuestionsResponseCopyWith<$Res> { - __$$_QuestionsResponseCopyWithImpl( - _$_QuestionsResponse _value, $Res Function(_$_QuestionsResponse) _then) +class __$$QuestionsResponseImplCopyWithImpl<$Res> + extends _$QuestionsResponseCopyWithImpl<$Res, _$QuestionsResponseImpl> + implements _$$QuestionsResponseImplCopyWith<$Res> { + __$$QuestionsResponseImplCopyWithImpl(_$QuestionsResponseImpl _value, + $Res Function(_$QuestionsResponseImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -92,7 +92,7 @@ class __$$_QuestionsResponseCopyWithImpl<$Res> Object? items = null, Object? total = null, }) { - return _then(_$_QuestionsResponse( + return _then(_$QuestionsResponseImpl( items: null == items ? _value._items : items // ignore: cast_nullable_to_non_nullable @@ -107,13 +107,13 @@ class __$$_QuestionsResponseCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$_QuestionsResponse implements _QuestionsResponse { - _$_QuestionsResponse( +class _$QuestionsResponseImpl implements _QuestionsResponse { + _$QuestionsResponseImpl( {required final List items, required this.total}) : _items = items; - factory _$_QuestionsResponse.fromJson(Map json) => - _$$_QuestionsResponseFromJson(json); + factory _$QuestionsResponseImpl.fromJson(Map json) => + _$$QuestionsResponseImplFromJson(json); final List _items; @override @@ -135,7 +135,7 @@ class _$_QuestionsResponse implements _QuestionsResponse { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_QuestionsResponse && + other is _$QuestionsResponseImpl && const DeepCollectionEquality().equals(other._items, _items) && (identical(other.total, total) || other.total == total)); } @@ -148,13 +148,13 @@ class _$_QuestionsResponse implements _QuestionsResponse { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_QuestionsResponseCopyWith<_$_QuestionsResponse> get copyWith => - __$$_QuestionsResponseCopyWithImpl<_$_QuestionsResponse>( + _$$QuestionsResponseImplCopyWith<_$QuestionsResponseImpl> get copyWith => + __$$QuestionsResponseImplCopyWithImpl<_$QuestionsResponseImpl>( this, _$identity); @override Map toJson() { - return _$$_QuestionsResponseToJson( + return _$$QuestionsResponseImplToJson( this, ); } @@ -163,10 +163,10 @@ class _$_QuestionsResponse implements _QuestionsResponse { abstract class _QuestionsResponse implements QuestionsResponse { factory _QuestionsResponse( {required final List items, - required final int total}) = _$_QuestionsResponse; + required final int total}) = _$QuestionsResponseImpl; factory _QuestionsResponse.fromJson(Map json) = - _$_QuestionsResponse.fromJson; + _$QuestionsResponseImpl.fromJson; @override List get items; @@ -174,7 +174,7 @@ abstract class _QuestionsResponse implements QuestionsResponse { int get total; @override @JsonKey(ignore: true) - _$$_QuestionsResponseCopyWith<_$_QuestionsResponse> get copyWith => + _$$QuestionsResponseImplCopyWith<_$QuestionsResponseImpl> get copyWith => throw _privateConstructorUsedError; } @@ -314,10 +314,11 @@ class _$QuestionCopyWithImpl<$Res, $Val extends Question> } /// @nodoc -abstract class _$$_QuestionCopyWith<$Res> implements $QuestionCopyWith<$Res> { - factory _$$_QuestionCopyWith( - _$_Question value, $Res Function(_$_Question) then) = - __$$_QuestionCopyWithImpl<$Res>; +abstract class _$$QuestionImplCopyWith<$Res> + implements $QuestionCopyWith<$Res> { + factory _$$QuestionImplCopyWith( + _$QuestionImpl value, $Res Function(_$QuestionImpl) then) = + __$$QuestionImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -339,11 +340,11 @@ abstract class _$$_QuestionCopyWith<$Res> implements $QuestionCopyWith<$Res> { } /// @nodoc -class __$$_QuestionCopyWithImpl<$Res> - extends _$QuestionCopyWithImpl<$Res, _$_Question> - implements _$$_QuestionCopyWith<$Res> { - __$$_QuestionCopyWithImpl( - _$_Question _value, $Res Function(_$_Question) _then) +class __$$QuestionImplCopyWithImpl<$Res> + extends _$QuestionCopyWithImpl<$Res, _$QuestionImpl> + implements _$$QuestionImplCopyWith<$Res> { + __$$QuestionImplCopyWithImpl( + _$QuestionImpl _value, $Res Function(_$QuestionImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -362,7 +363,7 @@ class __$$_QuestionCopyWithImpl<$Res> Object? title = null, Object? body = null, }) { - return _then(_$_Question( + return _then(_$QuestionImpl( tags: null == tags ? _value._tags : tags // ignore: cast_nullable_to_non_nullable @@ -418,8 +419,8 @@ class __$$_QuestionCopyWithImpl<$Res> /// @nodoc @JsonSerializable(fieldRename: FieldRename.snake) -class _$_Question implements _Question { - _$_Question( +class _$QuestionImpl implements _Question { + _$QuestionImpl( {required final List tags, required this.viewCount, required this.score, @@ -434,8 +435,8 @@ class _$_Question implements _Question { required this.body}) : _tags = tags; - factory _$_Question.fromJson(Map json) => - _$$_QuestionFromJson(json); + factory _$QuestionImpl.fromJson(Map json) => + _$$QuestionImplFromJson(json); final List _tags; @override @@ -478,7 +479,7 @@ class _$_Question implements _Question { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_Question && + other is _$QuestionImpl && const DeepCollectionEquality().equals(other._tags, _tags) && (identical(other.viewCount, viewCount) || other.viewCount == viewCount) && @@ -519,12 +520,12 @@ class _$_Question implements _Question { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_QuestionCopyWith<_$_Question> get copyWith => - __$$_QuestionCopyWithImpl<_$_Question>(this, _$identity); + _$$QuestionImplCopyWith<_$QuestionImpl> get copyWith => + __$$QuestionImplCopyWithImpl<_$QuestionImpl>(this, _$identity); @override Map toJson() { - return _$$_QuestionToJson( + return _$$QuestionImplToJson( this, ); } @@ -543,9 +544,10 @@ abstract class _Question implements Question { required final int questionId, required final String link, required final String title, - required final String body}) = _$_Question; + required final String body}) = _$QuestionImpl; - factory _Question.fromJson(Map json) = _$_Question.fromJson; + factory _Question.fromJson(Map json) = + _$QuestionImpl.fromJson; @override List get tags; @@ -574,7 +576,7 @@ abstract class _Question implements Question { String get body; @override @JsonKey(ignore: true) - _$$_QuestionCopyWith<_$_Question> get copyWith => + _$$QuestionImplCopyWith<_$QuestionImpl> get copyWith => throw _privateConstructorUsedError; } @@ -627,22 +629,22 @@ class _$QuestionThemeCopyWithImpl<$Res, $Val extends QuestionTheme> } /// @nodoc -abstract class _$$_QuestionThemeCopyWith<$Res> +abstract class _$$QuestionThemeImplCopyWith<$Res> implements $QuestionThemeCopyWith<$Res> { - factory _$$_QuestionThemeCopyWith( - _$_QuestionTheme value, $Res Function(_$_QuestionTheme) then) = - __$$_QuestionThemeCopyWithImpl<$Res>; + factory _$$QuestionThemeImplCopyWith( + _$QuestionThemeImpl value, $Res Function(_$QuestionThemeImpl) then) = + __$$QuestionThemeImplCopyWithImpl<$Res>; @override @useResult $Res call({TextStyle titleStyle, TextStyle descriptionStyle}); } /// @nodoc -class __$$_QuestionThemeCopyWithImpl<$Res> - extends _$QuestionThemeCopyWithImpl<$Res, _$_QuestionTheme> - implements _$$_QuestionThemeCopyWith<$Res> { - __$$_QuestionThemeCopyWithImpl( - _$_QuestionTheme _value, $Res Function(_$_QuestionTheme) _then) +class __$$QuestionThemeImplCopyWithImpl<$Res> + extends _$QuestionThemeCopyWithImpl<$Res, _$QuestionThemeImpl> + implements _$$QuestionThemeImplCopyWith<$Res> { + __$$QuestionThemeImplCopyWithImpl( + _$QuestionThemeImpl _value, $Res Function(_$QuestionThemeImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -651,7 +653,7 @@ class __$$_QuestionThemeCopyWithImpl<$Res> Object? titleStyle = null, Object? descriptionStyle = null, }) { - return _then(_$_QuestionTheme( + return _then(_$QuestionThemeImpl( titleStyle: null == titleStyle ? _value.titleStyle : titleStyle // ignore: cast_nullable_to_non_nullable @@ -666,8 +668,8 @@ class __$$_QuestionThemeCopyWithImpl<$Res> /// @nodoc -class _$_QuestionTheme implements _QuestionTheme { - const _$_QuestionTheme( +class _$QuestionThemeImpl implements _QuestionTheme { + const _$QuestionThemeImpl( {required this.titleStyle, required this.descriptionStyle}); @override @@ -684,7 +686,7 @@ class _$_QuestionTheme implements _QuestionTheme { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_QuestionTheme && + other is _$QuestionThemeImpl && (identical(other.titleStyle, titleStyle) || other.titleStyle == titleStyle) && (identical(other.descriptionStyle, descriptionStyle) || @@ -697,14 +699,14 @@ class _$_QuestionTheme implements _QuestionTheme { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_QuestionThemeCopyWith<_$_QuestionTheme> get copyWith => - __$$_QuestionThemeCopyWithImpl<_$_QuestionTheme>(this, _$identity); + _$$QuestionThemeImplCopyWith<_$QuestionThemeImpl> get copyWith => + __$$QuestionThemeImplCopyWithImpl<_$QuestionThemeImpl>(this, _$identity); } abstract class _QuestionTheme implements QuestionTheme { const factory _QuestionTheme( {required final TextStyle titleStyle, - required final TextStyle descriptionStyle}) = _$_QuestionTheme; + required final TextStyle descriptionStyle}) = _$QuestionThemeImpl; @override TextStyle get titleStyle; @@ -712,6 +714,6 @@ abstract class _QuestionTheme implements QuestionTheme { TextStyle get descriptionStyle; @override @JsonKey(ignore: true) - _$$_QuestionThemeCopyWith<_$_QuestionTheme> get copyWith => + _$$QuestionThemeImplCopyWith<_$QuestionThemeImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/examples/stackoverflow/lib/question.g.dart b/examples/stackoverflow/lib/question.g.dart index 70c223a0f..2f15b3978 100644 --- a/examples/stackoverflow/lib/question.g.dart +++ b/examples/stackoverflow/lib/question.g.dart @@ -8,22 +8,24 @@ part of 'question.dart'; // JsonSerializableGenerator // ************************************************************************** -_$_QuestionsResponse _$$_QuestionsResponseFromJson(Map json) => - _$_QuestionsResponse( +_$QuestionsResponseImpl _$$QuestionsResponseImplFromJson( + Map json) => + _$QuestionsResponseImpl( items: (json['items'] as List) .map((e) => Question.fromJson(e as Map)) .toList(), total: json['total'] as int, ); -Map _$$_QuestionsResponseToJson( - _$_QuestionsResponse instance) => +Map _$$QuestionsResponseImplToJson( + _$QuestionsResponseImpl instance) => { 'items': instance.items, 'total': instance.total, }; -_$_Question _$$_QuestionFromJson(Map json) => _$_Question( +_$QuestionImpl _$$QuestionImplFromJson(Map json) => + _$QuestionImpl( tags: (json['tags'] as List).map((e) => e as String).toList(), viewCount: json['view_count'] as int, score: json['score'] as int, @@ -41,7 +43,7 @@ _$_Question _$$_QuestionFromJson(Map json) => _$_Question( body: json['body'] as String, ); -Map _$$_QuestionToJson(_$_Question instance) => +Map _$$QuestionImplToJson(_$QuestionImpl instance) => { 'tags': instance.tags, 'view_count': instance.viewCount, diff --git a/examples/stackoverflow/lib/tag.freezed.dart b/examples/stackoverflow/lib/tag.freezed.dart index 8eb6cf424..77c51997b 100644 --- a/examples/stackoverflow/lib/tag.freezed.dart +++ b/examples/stackoverflow/lib/tag.freezed.dart @@ -78,10 +78,11 @@ class _$TagThemeCopyWithImpl<$Res, $Val extends TagTheme> } /// @nodoc -abstract class _$$_TagThemeCopyWith<$Res> implements $TagThemeCopyWith<$Res> { - factory _$$_TagThemeCopyWith( - _$_TagTheme value, $Res Function(_$_TagTheme) then) = - __$$_TagThemeCopyWithImpl<$Res>; +abstract class _$$TagThemeImplCopyWith<$Res> + implements $TagThemeCopyWith<$Res> { + factory _$$TagThemeImplCopyWith( + _$TagThemeImpl value, $Res Function(_$TagThemeImpl) then) = + __$$TagThemeImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -92,11 +93,11 @@ abstract class _$$_TagThemeCopyWith<$Res> implements $TagThemeCopyWith<$Res> { } /// @nodoc -class __$$_TagThemeCopyWithImpl<$Res> - extends _$TagThemeCopyWithImpl<$Res, _$_TagTheme> - implements _$$_TagThemeCopyWith<$Res> { - __$$_TagThemeCopyWithImpl( - _$_TagTheme _value, $Res Function(_$_TagTheme) _then) +class __$$TagThemeImplCopyWithImpl<$Res> + extends _$TagThemeCopyWithImpl<$Res, _$TagThemeImpl> + implements _$$TagThemeImplCopyWith<$Res> { + __$$TagThemeImplCopyWithImpl( + _$TagThemeImpl _value, $Res Function(_$TagThemeImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -107,7 +108,7 @@ class __$$_TagThemeCopyWithImpl<$Res> Object? backgroundColor = null, Object? borderRadius = null, }) { - return _then(_$_TagTheme( + return _then(_$TagThemeImpl( style: null == style ? _value.style : style // ignore: cast_nullable_to_non_nullable @@ -130,8 +131,8 @@ class __$$_TagThemeCopyWithImpl<$Res> /// @nodoc -class _$_TagTheme implements _TagTheme { - const _$_TagTheme( +class _$TagThemeImpl implements _TagTheme { + const _$TagThemeImpl( {required this.style, required this.padding, required this.backgroundColor, @@ -155,7 +156,7 @@ class _$_TagTheme implements _TagTheme { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_TagTheme && + other is _$TagThemeImpl && (identical(other.style, style) || other.style == style) && (identical(other.padding, padding) || other.padding == padding) && (identical(other.backgroundColor, backgroundColor) || @@ -171,8 +172,8 @@ class _$_TagTheme implements _TagTheme { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_TagThemeCopyWith<_$_TagTheme> get copyWith => - __$$_TagThemeCopyWithImpl<_$_TagTheme>(this, _$identity); + _$$TagThemeImplCopyWith<_$TagThemeImpl> get copyWith => + __$$TagThemeImplCopyWithImpl<_$TagThemeImpl>(this, _$identity); } abstract class _TagTheme implements TagTheme { @@ -180,7 +181,7 @@ abstract class _TagTheme implements TagTheme { {required final TextStyle style, required final EdgeInsets padding, required final Color backgroundColor, - required final BorderRadius borderRadius}) = _$_TagTheme; + required final BorderRadius borderRadius}) = _$TagThemeImpl; @override TextStyle get style; @@ -192,6 +193,6 @@ abstract class _TagTheme implements TagTheme { BorderRadius get borderRadius; @override @JsonKey(ignore: true) - _$$_TagThemeCopyWith<_$_TagTheme> get copyWith => + _$$TagThemeImplCopyWith<_$TagThemeImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/examples/stackoverflow/lib/user.freezed.dart b/examples/stackoverflow/lib/user.freezed.dart index ca57f6dc4..efc55d2ad 100644 --- a/examples/stackoverflow/lib/user.freezed.dart +++ b/examples/stackoverflow/lib/user.freezed.dart @@ -110,9 +110,10 @@ class _$UserCopyWithImpl<$Res, $Val extends User> } /// @nodoc -abstract class _$$_UserCopyWith<$Res> implements $UserCopyWith<$Res> { - factory _$$_UserCopyWith(_$_User value, $Res Function(_$_User) then) = - __$$_UserCopyWithImpl<$Res>; +abstract class _$$UserImplCopyWith<$Res> implements $UserCopyWith<$Res> { + factory _$$UserImplCopyWith( + _$UserImpl value, $Res Function(_$UserImpl) then) = + __$$UserImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -128,9 +129,10 @@ abstract class _$$_UserCopyWith<$Res> implements $UserCopyWith<$Res> { } /// @nodoc -class __$$_UserCopyWithImpl<$Res> extends _$UserCopyWithImpl<$Res, _$_User> - implements _$$_UserCopyWith<$Res> { - __$$_UserCopyWithImpl(_$_User _value, $Res Function(_$_User) _then) +class __$$UserImplCopyWithImpl<$Res> + extends _$UserCopyWithImpl<$Res, _$UserImpl> + implements _$$UserImplCopyWith<$Res> { + __$$UserImplCopyWithImpl(_$UserImpl _value, $Res Function(_$UserImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -143,7 +145,7 @@ class __$$_UserCopyWithImpl<$Res> extends _$UserCopyWithImpl<$Res, _$_User> Object? profileImage = null, Object? link = null, }) { - return _then(_$_User( + return _then(_$UserImpl( reputation: null == reputation ? _value.reputation : reputation // ignore: cast_nullable_to_non_nullable @@ -175,8 +177,8 @@ class __$$_UserCopyWithImpl<$Res> extends _$UserCopyWithImpl<$Res, _$_User> /// @nodoc @JsonSerializable(fieldRename: FieldRename.snake) -class _$_User implements _User { - _$_User( +class _$UserImpl implements _User { + _$UserImpl( {required this.reputation, required this.userId, this.badgeCounts, @@ -184,7 +186,8 @@ class _$_User implements _User { required this.profileImage, required this.link}); - factory _$_User.fromJson(Map json) => _$$_UserFromJson(json); + factory _$UserImpl.fromJson(Map json) => + _$$UserImplFromJson(json); @override final int reputation; @@ -208,7 +211,7 @@ class _$_User implements _User { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_User && + other is _$UserImpl && (identical(other.reputation, reputation) || other.reputation == reputation) && (identical(other.userId, userId) || other.userId == userId) && @@ -229,12 +232,12 @@ class _$_User implements _User { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_UserCopyWith<_$_User> get copyWith => - __$$_UserCopyWithImpl<_$_User>(this, _$identity); + _$$UserImplCopyWith<_$UserImpl> get copyWith => + __$$UserImplCopyWithImpl<_$UserImpl>(this, _$identity); @override Map toJson() { - return _$$_UserToJson( + return _$$UserImplToJson( this, ); } @@ -247,9 +250,9 @@ abstract class _User implements User { final BadgeCount? badgeCounts, required final String displayName, required final String profileImage, - required final String link}) = _$_User; + required final String link}) = _$UserImpl; - factory _User.fromJson(Map json) = _$_User.fromJson; + factory _User.fromJson(Map json) = _$UserImpl.fromJson; @override int get reputation; @@ -265,7 +268,8 @@ abstract class _User implements User { String get link; @override @JsonKey(ignore: true) - _$$_UserCopyWith<_$_User> get copyWith => throw _privateConstructorUsedError; + _$$UserImplCopyWith<_$UserImpl> get copyWith => + throw _privateConstructorUsedError; } BadgeCount _$BadgeCountFromJson(Map json) { @@ -328,22 +332,22 @@ class _$BadgeCountCopyWithImpl<$Res, $Val extends BadgeCount> } /// @nodoc -abstract class _$$_BadgeCountCopyWith<$Res> +abstract class _$$BadgeCountImplCopyWith<$Res> implements $BadgeCountCopyWith<$Res> { - factory _$$_BadgeCountCopyWith( - _$_BadgeCount value, $Res Function(_$_BadgeCount) then) = - __$$_BadgeCountCopyWithImpl<$Res>; + factory _$$BadgeCountImplCopyWith( + _$BadgeCountImpl value, $Res Function(_$BadgeCountImpl) then) = + __$$BadgeCountImplCopyWithImpl<$Res>; @override @useResult $Res call({int bronze, int silver, int gold}); } /// @nodoc -class __$$_BadgeCountCopyWithImpl<$Res> - extends _$BadgeCountCopyWithImpl<$Res, _$_BadgeCount> - implements _$$_BadgeCountCopyWith<$Res> { - __$$_BadgeCountCopyWithImpl( - _$_BadgeCount _value, $Res Function(_$_BadgeCount) _then) +class __$$BadgeCountImplCopyWithImpl<$Res> + extends _$BadgeCountCopyWithImpl<$Res, _$BadgeCountImpl> + implements _$$BadgeCountImplCopyWith<$Res> { + __$$BadgeCountImplCopyWithImpl( + _$BadgeCountImpl _value, $Res Function(_$BadgeCountImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -353,7 +357,7 @@ class __$$_BadgeCountCopyWithImpl<$Res> Object? silver = null, Object? gold = null, }) { - return _then(_$_BadgeCount( + return _then(_$BadgeCountImpl( bronze: null == bronze ? _value.bronze : bronze // ignore: cast_nullable_to_non_nullable @@ -372,12 +376,12 @@ class __$$_BadgeCountCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$_BadgeCount implements _BadgeCount { - _$_BadgeCount( +class _$BadgeCountImpl implements _BadgeCount { + _$BadgeCountImpl( {required this.bronze, required this.silver, required this.gold}); - factory _$_BadgeCount.fromJson(Map json) => - _$$_BadgeCountFromJson(json); + factory _$BadgeCountImpl.fromJson(Map json) => + _$$BadgeCountImplFromJson(json); @override final int bronze; @@ -395,7 +399,7 @@ class _$_BadgeCount implements _BadgeCount { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_BadgeCount && + other is _$BadgeCountImpl && (identical(other.bronze, bronze) || other.bronze == bronze) && (identical(other.silver, silver) || other.silver == silver) && (identical(other.gold, gold) || other.gold == gold)); @@ -408,12 +412,12 @@ class _$_BadgeCount implements _BadgeCount { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_BadgeCountCopyWith<_$_BadgeCount> get copyWith => - __$$_BadgeCountCopyWithImpl<_$_BadgeCount>(this, _$identity); + _$$BadgeCountImplCopyWith<_$BadgeCountImpl> get copyWith => + __$$BadgeCountImplCopyWithImpl<_$BadgeCountImpl>(this, _$identity); @override Map toJson() { - return _$$_BadgeCountToJson( + return _$$BadgeCountImplToJson( this, ); } @@ -423,10 +427,10 @@ abstract class _BadgeCount implements BadgeCount { factory _BadgeCount( {required final int bronze, required final int silver, - required final int gold}) = _$_BadgeCount; + required final int gold}) = _$BadgeCountImpl; factory _BadgeCount.fromJson(Map json) = - _$_BadgeCount.fromJson; + _$BadgeCountImpl.fromJson; @override int get bronze; @@ -436,6 +440,6 @@ abstract class _BadgeCount implements BadgeCount { int get gold; @override @JsonKey(ignore: true) - _$$_BadgeCountCopyWith<_$_BadgeCount> get copyWith => + _$$BadgeCountImplCopyWith<_$BadgeCountImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/examples/stackoverflow/lib/user.g.dart b/examples/stackoverflow/lib/user.g.dart index 65e110eec..50fcbf23f 100644 --- a/examples/stackoverflow/lib/user.g.dart +++ b/examples/stackoverflow/lib/user.g.dart @@ -8,7 +8,7 @@ part of 'user.dart'; // JsonSerializableGenerator // ************************************************************************** -_$_User _$$_UserFromJson(Map json) => _$_User( +_$UserImpl _$$UserImplFromJson(Map json) => _$UserImpl( reputation: json['reputation'] as int, userId: json['user_id'] as int, badgeCounts: json['badge_counts'] == null @@ -22,7 +22,8 @@ _$_User _$$_UserFromJson(Map json) => _$_User( link: json['link'] as String, ); -Map _$$_UserToJson(_$_User instance) => { +Map _$$UserImplToJson(_$UserImpl instance) => + { 'reputation': instance.reputation, 'user_id': instance.userId, 'badge_counts': instance.badgeCounts, @@ -31,14 +32,14 @@ Map _$$_UserToJson(_$_User instance) => { 'link': instance.link, }; -_$_BadgeCount _$$_BadgeCountFromJson(Map json) => - _$_BadgeCount( +_$BadgeCountImpl _$$BadgeCountImplFromJson(Map json) => + _$BadgeCountImpl( bronze: json['bronze'] as int, silver: json['silver'] as int, gold: json['gold'] as int, ); -Map _$$_BadgeCountToJson(_$_BadgeCount instance) => +Map _$$BadgeCountImplToJson(_$BadgeCountImpl instance) => { 'bronze': instance.bronze, 'silver': instance.silver, diff --git a/examples/stackoverflow/pubspec.yaml b/examples/stackoverflow/pubspec.yaml index 1b02c8874..7377a5480 100644 --- a/examples/stackoverflow/pubspec.yaml +++ b/examples/stackoverflow/pubspec.yaml @@ -19,7 +19,6 @@ dependencies: dev_dependencies: build_runner: ^2.0.0 - build_verify: ^3.0.0 flutter_test: sdk: flutter freezed: ^2.1.0 diff --git a/examples/stackoverflow/test/ensuire_build_test.dart b/examples/stackoverflow/test/ensuire_build_test.dart deleted file mode 100644 index 2d2ea93f7..000000000 --- a/examples/stackoverflow/test/ensuire_build_test.dart +++ /dev/null @@ -1,10 +0,0 @@ -import 'package:build_verify/build_verify.dart'; -import 'package:flutter_test/flutter_test.dart'; - -void main() { - test('ensure_build', () { - expectBuildClean( - packageRelativeDirectory: 'examples/stackoverflow', - ); - }); -} diff --git a/examples/todos/pubspec.yaml b/examples/todos/pubspec.yaml index d29e09725..dee5a60e5 100644 --- a/examples/todos/pubspec.yaml +++ b/examples/todos/pubspec.yaml @@ -18,7 +18,6 @@ dependencies: dev_dependencies: build_runner: ^2.0.0 - build_verify: ^3.0.0 flutter_test: sdk: flutter diff --git a/examples/todos/test/ensuire_build_test.dart b/examples/todos/test/ensuire_build_test.dart deleted file mode 100644 index 67f4b7b0c..000000000 --- a/examples/todos/test/ensuire_build_test.dart +++ /dev/null @@ -1,10 +0,0 @@ -import 'package:build_verify/build_verify.dart'; -import 'package:flutter_test/flutter_test.dart'; - -void main() { - test('ensure_build', () { - expectBuildClean( - packageRelativeDirectory: 'examples/todos', - ); - }); -} diff --git a/packages/riverpod/example/build.yaml b/packages/riverpod/example/build.yaml index 550fb2e77..4724276d5 100644 --- a/packages/riverpod/example/build.yaml +++ b/packages/riverpod/example/build.yaml @@ -4,4 +4,4 @@ targets: source_gen:combining_builder: options: ignore_for_file: - - non_constant_identifier_names \ No newline at end of file + - type=lint \ No newline at end of file diff --git a/packages/riverpod/example/lib/models.freezed.dart b/packages/riverpod/example/lib/models.freezed.dart index 813a93317..dcea04b78 100644 --- a/packages/riverpod/example/lib/models.freezed.dart +++ b/packages/riverpod/example/lib/models.freezed.dart @@ -68,22 +68,22 @@ class _$ConfigurationCopyWithImpl<$Res, $Val extends Configuration> } /// @nodoc -abstract class _$$_ConfigurationCopyWith<$Res> +abstract class _$$ConfigurationImplCopyWith<$Res> implements $ConfigurationCopyWith<$Res> { - factory _$$_ConfigurationCopyWith( - _$_Configuration value, $Res Function(_$_Configuration) then) = - __$$_ConfigurationCopyWithImpl<$Res>; + factory _$$ConfigurationImplCopyWith( + _$ConfigurationImpl value, $Res Function(_$ConfigurationImpl) then) = + __$$ConfigurationImplCopyWithImpl<$Res>; @override @useResult $Res call({String publicKey, String privateKey}); } /// @nodoc -class __$$_ConfigurationCopyWithImpl<$Res> - extends _$ConfigurationCopyWithImpl<$Res, _$_Configuration> - implements _$$_ConfigurationCopyWith<$Res> { - __$$_ConfigurationCopyWithImpl( - _$_Configuration _value, $Res Function(_$_Configuration) _then) +class __$$ConfigurationImplCopyWithImpl<$Res> + extends _$ConfigurationCopyWithImpl<$Res, _$ConfigurationImpl> + implements _$$ConfigurationImplCopyWith<$Res> { + __$$ConfigurationImplCopyWithImpl( + _$ConfigurationImpl _value, $Res Function(_$ConfigurationImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -92,7 +92,7 @@ class __$$_ConfigurationCopyWithImpl<$Res> Object? publicKey = null, Object? privateKey = null, }) { - return _then(_$_Configuration( + return _then(_$ConfigurationImpl( publicKey: null == publicKey ? _value.publicKey : publicKey // ignore: cast_nullable_to_non_nullable @@ -108,11 +108,11 @@ class __$$_ConfigurationCopyWithImpl<$Res> /// @nodoc @JsonSerializable(fieldRename: FieldRename.snake) -class _$_Configuration implements _Configuration { - _$_Configuration({required this.publicKey, required this.privateKey}); +class _$ConfigurationImpl implements _Configuration { + _$ConfigurationImpl({required this.publicKey, required this.privateKey}); - factory _$_Configuration.fromJson(Map json) => - _$$_ConfigurationFromJson(json); + factory _$ConfigurationImpl.fromJson(Map json) => + _$$ConfigurationImplFromJson(json); @override final String publicKey; @@ -128,7 +128,7 @@ class _$_Configuration implements _Configuration { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_Configuration && + other is _$ConfigurationImpl && (identical(other.publicKey, publicKey) || other.publicKey == publicKey) && (identical(other.privateKey, privateKey) || @@ -142,12 +142,12 @@ class _$_Configuration implements _Configuration { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_ConfigurationCopyWith<_$_Configuration> get copyWith => - __$$_ConfigurationCopyWithImpl<_$_Configuration>(this, _$identity); + _$$ConfigurationImplCopyWith<_$ConfigurationImpl> get copyWith => + __$$ConfigurationImplCopyWithImpl<_$ConfigurationImpl>(this, _$identity); @override Map toJson() { - return _$$_ConfigurationToJson( + return _$$ConfigurationImplToJson( this, ); } @@ -156,10 +156,10 @@ class _$_Configuration implements _Configuration { abstract class _Configuration implements Configuration { factory _Configuration( {required final String publicKey, - required final String privateKey}) = _$_Configuration; + required final String privateKey}) = _$ConfigurationImpl; factory _Configuration.fromJson(Map json) = - _$_Configuration.fromJson; + _$ConfigurationImpl.fromJson; @override String get publicKey; @@ -167,7 +167,7 @@ abstract class _Configuration implements Configuration { String get privateKey; @override @JsonKey(ignore: true) - _$$_ConfigurationCopyWith<_$_Configuration> get copyWith => + _$$ConfigurationImplCopyWith<_$ConfigurationImpl> get copyWith => throw _privateConstructorUsedError; } @@ -229,11 +229,11 @@ class _$MarvelResponseCopyWithImpl<$Res, $Val extends MarvelResponse> } /// @nodoc -abstract class _$$_MarvelResponseCopyWith<$Res> +abstract class _$$MarvelResponseImplCopyWith<$Res> implements $MarvelResponseCopyWith<$Res> { - factory _$$_MarvelResponseCopyWith( - _$_MarvelResponse value, $Res Function(_$_MarvelResponse) then) = - __$$_MarvelResponseCopyWithImpl<$Res>; + factory _$$MarvelResponseImplCopyWith(_$MarvelResponseImpl value, + $Res Function(_$MarvelResponseImpl) then) = + __$$MarvelResponseImplCopyWithImpl<$Res>; @override @useResult $Res call({MarvelData data}); @@ -243,11 +243,11 @@ abstract class _$$_MarvelResponseCopyWith<$Res> } /// @nodoc -class __$$_MarvelResponseCopyWithImpl<$Res> - extends _$MarvelResponseCopyWithImpl<$Res, _$_MarvelResponse> - implements _$$_MarvelResponseCopyWith<$Res> { - __$$_MarvelResponseCopyWithImpl( - _$_MarvelResponse _value, $Res Function(_$_MarvelResponse) _then) +class __$$MarvelResponseImplCopyWithImpl<$Res> + extends _$MarvelResponseCopyWithImpl<$Res, _$MarvelResponseImpl> + implements _$$MarvelResponseImplCopyWith<$Res> { + __$$MarvelResponseImplCopyWithImpl( + _$MarvelResponseImpl _value, $Res Function(_$MarvelResponseImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -255,7 +255,7 @@ class __$$_MarvelResponseCopyWithImpl<$Res> $Res call({ Object? data = null, }) { - return _then(_$_MarvelResponse( + return _then(_$MarvelResponseImpl( null == data ? _value.data : data // ignore: cast_nullable_to_non_nullable @@ -266,11 +266,11 @@ class __$$_MarvelResponseCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$_MarvelResponse implements _MarvelResponse { - _$_MarvelResponse(this.data); +class _$MarvelResponseImpl implements _MarvelResponse { + _$MarvelResponseImpl(this.data); - factory _$_MarvelResponse.fromJson(Map json) => - _$$_MarvelResponseFromJson(json); + factory _$MarvelResponseImpl.fromJson(Map json) => + _$$MarvelResponseImplFromJson(json); @override final MarvelData data; @@ -284,7 +284,7 @@ class _$_MarvelResponse implements _MarvelResponse { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_MarvelResponse && + other is _$MarvelResponseImpl && (identical(other.data, data) || other.data == data)); } @@ -295,28 +295,29 @@ class _$_MarvelResponse implements _MarvelResponse { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_MarvelResponseCopyWith<_$_MarvelResponse> get copyWith => - __$$_MarvelResponseCopyWithImpl<_$_MarvelResponse>(this, _$identity); + _$$MarvelResponseImplCopyWith<_$MarvelResponseImpl> get copyWith => + __$$MarvelResponseImplCopyWithImpl<_$MarvelResponseImpl>( + this, _$identity); @override Map toJson() { - return _$$_MarvelResponseToJson( + return _$$MarvelResponseImplToJson( this, ); } } abstract class _MarvelResponse implements MarvelResponse { - factory _MarvelResponse(final MarvelData data) = _$_MarvelResponse; + factory _MarvelResponse(final MarvelData data) = _$MarvelResponseImpl; factory _MarvelResponse.fromJson(Map json) = - _$_MarvelResponse.fromJson; + _$MarvelResponseImpl.fromJson; @override MarvelData get data; @override @JsonKey(ignore: true) - _$$_MarvelResponseCopyWith<_$_MarvelResponse> get copyWith => + _$$MarvelResponseImplCopyWith<_$MarvelResponseImpl> get copyWith => throw _privateConstructorUsedError; } @@ -368,22 +369,22 @@ class _$MarvelDataCopyWithImpl<$Res, $Val extends MarvelData> } /// @nodoc -abstract class _$$_MarvelDataCopyWith<$Res> +abstract class _$$MarvelDataImplCopyWith<$Res> implements $MarvelDataCopyWith<$Res> { - factory _$$_MarvelDataCopyWith( - _$_MarvelData value, $Res Function(_$_MarvelData) then) = - __$$_MarvelDataCopyWithImpl<$Res>; + factory _$$MarvelDataImplCopyWith( + _$MarvelDataImpl value, $Res Function(_$MarvelDataImpl) then) = + __$$MarvelDataImplCopyWithImpl<$Res>; @override @useResult $Res call({List> results}); } /// @nodoc -class __$$_MarvelDataCopyWithImpl<$Res> - extends _$MarvelDataCopyWithImpl<$Res, _$_MarvelData> - implements _$$_MarvelDataCopyWith<$Res> { - __$$_MarvelDataCopyWithImpl( - _$_MarvelData _value, $Res Function(_$_MarvelData) _then) +class __$$MarvelDataImplCopyWithImpl<$Res> + extends _$MarvelDataCopyWithImpl<$Res, _$MarvelDataImpl> + implements _$$MarvelDataImplCopyWith<$Res> { + __$$MarvelDataImplCopyWithImpl( + _$MarvelDataImpl _value, $Res Function(_$MarvelDataImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -391,7 +392,7 @@ class __$$_MarvelDataCopyWithImpl<$Res> $Res call({ Object? results = null, }) { - return _then(_$_MarvelData( + return _then(_$MarvelDataImpl( null == results ? _value._results : results // ignore: cast_nullable_to_non_nullable @@ -402,11 +403,12 @@ class __$$_MarvelDataCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$_MarvelData implements _MarvelData { - _$_MarvelData(final List> results) : _results = results; +class _$MarvelDataImpl implements _MarvelData { + _$MarvelDataImpl(final List> results) + : _results = results; - factory _$_MarvelData.fromJson(Map json) => - _$$_MarvelDataFromJson(json); + factory _$MarvelDataImpl.fromJson(Map json) => + _$$MarvelDataImplFromJson(json); final List> _results; @override @@ -425,7 +427,7 @@ class _$_MarvelData implements _MarvelData { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_MarvelData && + other is _$MarvelDataImpl && const DeepCollectionEquality().equals(other._results, _results)); } @@ -437,28 +439,29 @@ class _$_MarvelData implements _MarvelData { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_MarvelDataCopyWith<_$_MarvelData> get copyWith => - __$$_MarvelDataCopyWithImpl<_$_MarvelData>(this, _$identity); + _$$MarvelDataImplCopyWith<_$MarvelDataImpl> get copyWith => + __$$MarvelDataImplCopyWithImpl<_$MarvelDataImpl>(this, _$identity); @override Map toJson() { - return _$$_MarvelDataToJson( + return _$$MarvelDataImplToJson( this, ); } } abstract class _MarvelData implements MarvelData { - factory _MarvelData(final List> results) = _$_MarvelData; + factory _MarvelData(final List> results) = + _$MarvelDataImpl; factory _MarvelData.fromJson(Map json) = - _$_MarvelData.fromJson; + _$MarvelDataImpl.fromJson; @override List> get results; @override @JsonKey(ignore: true) - _$$_MarvelDataCopyWith<_$_MarvelData> get copyWith => + _$$MarvelDataImplCopyWith<_$MarvelDataImpl> get copyWith => throw _privateConstructorUsedError; } @@ -514,18 +517,21 @@ class _$ComicCopyWithImpl<$Res, $Val extends Comic> } /// @nodoc -abstract class _$$_ComicCopyWith<$Res> implements $ComicCopyWith<$Res> { - factory _$$_ComicCopyWith(_$_Comic value, $Res Function(_$_Comic) then) = - __$$_ComicCopyWithImpl<$Res>; +abstract class _$$ComicImplCopyWith<$Res> implements $ComicCopyWith<$Res> { + factory _$$ComicImplCopyWith( + _$ComicImpl value, $Res Function(_$ComicImpl) then) = + __$$ComicImplCopyWithImpl<$Res>; @override @useResult $Res call({int id, String title}); } /// @nodoc -class __$$_ComicCopyWithImpl<$Res> extends _$ComicCopyWithImpl<$Res, _$_Comic> - implements _$$_ComicCopyWith<$Res> { - __$$_ComicCopyWithImpl(_$_Comic _value, $Res Function(_$_Comic) _then) +class __$$ComicImplCopyWithImpl<$Res> + extends _$ComicCopyWithImpl<$Res, _$ComicImpl> + implements _$$ComicImplCopyWith<$Res> { + __$$ComicImplCopyWithImpl( + _$ComicImpl _value, $Res Function(_$ComicImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -534,7 +540,7 @@ class __$$_ComicCopyWithImpl<$Res> extends _$ComicCopyWithImpl<$Res, _$_Comic> Object? id = null, Object? title = null, }) { - return _then(_$_Comic( + return _then(_$ComicImpl( id: null == id ? _value.id : id // ignore: cast_nullable_to_non_nullable @@ -549,11 +555,11 @@ class __$$_ComicCopyWithImpl<$Res> extends _$ComicCopyWithImpl<$Res, _$_Comic> /// @nodoc @JsonSerializable() -class _$_Comic implements _Comic { - _$_Comic({required this.id, required this.title}); +class _$ComicImpl implements _Comic { + _$ComicImpl({required this.id, required this.title}); - factory _$_Comic.fromJson(Map json) => - _$$_ComicFromJson(json); + factory _$ComicImpl.fromJson(Map json) => + _$$ComicImplFromJson(json); @override final int id; @@ -569,7 +575,7 @@ class _$_Comic implements _Comic { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_Comic && + other is _$ComicImpl && (identical(other.id, id) || other.id == id) && (identical(other.title, title) || other.title == title)); } @@ -581,12 +587,12 @@ class _$_Comic implements _Comic { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_ComicCopyWith<_$_Comic> get copyWith => - __$$_ComicCopyWithImpl<_$_Comic>(this, _$identity); + _$$ComicImplCopyWith<_$ComicImpl> get copyWith => + __$$ComicImplCopyWithImpl<_$ComicImpl>(this, _$identity); @override Map toJson() { - return _$$_ComicToJson( + return _$$ComicImplToJson( this, ); } @@ -594,9 +600,9 @@ class _$_Comic implements _Comic { abstract class _Comic implements Comic { factory _Comic({required final int id, required final String title}) = - _$_Comic; + _$ComicImpl; - factory _Comic.fromJson(Map json) = _$_Comic.fromJson; + factory _Comic.fromJson(Map json) = _$ComicImpl.fromJson; @override int get id; @@ -604,6 +610,6 @@ abstract class _Comic implements Comic { String get title; @override @JsonKey(ignore: true) - _$$_ComicCopyWith<_$_Comic> get copyWith => + _$$ComicImplCopyWith<_$ComicImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/packages/riverpod/example/lib/models.g.dart b/packages/riverpod/example/lib/models.g.dart index bf0a71d10..839ebc7df 100644 --- a/packages/riverpod/example/lib/models.g.dart +++ b/packages/riverpod/example/lib/models.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: non_constant_identifier_names +// ignore_for_file: type=lint part of 'models.dart'; @@ -8,46 +8,48 @@ part of 'models.dart'; // JsonSerializableGenerator // ************************************************************************** -_$_Configuration _$$_ConfigurationFromJson(Map json) => - _$_Configuration( +_$ConfigurationImpl _$$ConfigurationImplFromJson(Map json) => + _$ConfigurationImpl( publicKey: json['public_key'] as String, privateKey: json['private_key'] as String, ); -Map _$$_ConfigurationToJson(_$_Configuration instance) => +Map _$$ConfigurationImplToJson(_$ConfigurationImpl instance) => { 'public_key': instance.publicKey, 'private_key': instance.privateKey, }; -_$_MarvelResponse _$$_MarvelResponseFromJson(Map json) => - _$_MarvelResponse( +_$MarvelResponseImpl _$$MarvelResponseImplFromJson(Map json) => + _$MarvelResponseImpl( MarvelData.fromJson(json['data'] as Map), ); -Map _$$_MarvelResponseToJson(_$_MarvelResponse instance) => +Map _$$MarvelResponseImplToJson( + _$MarvelResponseImpl instance) => { 'data': instance.data, }; -_$_MarvelData _$$_MarvelDataFromJson(Map json) => - _$_MarvelData( +_$MarvelDataImpl _$$MarvelDataImplFromJson(Map json) => + _$MarvelDataImpl( (json['results'] as List) .map((e) => e as Map) .toList(), ); -Map _$$_MarvelDataToJson(_$_MarvelData instance) => +Map _$$MarvelDataImplToJson(_$MarvelDataImpl instance) => { 'results': instance.results, }; -_$_Comic _$$_ComicFromJson(Map json) => _$_Comic( +_$ComicImpl _$$ComicImplFromJson(Map json) => _$ComicImpl( id: json['id'] as int, title: json['title'] as String, ); -Map _$$_ComicToJson(_$_Comic instance) => { +Map _$$ComicImplToJson(_$ComicImpl instance) => + { 'id': instance.id, 'title': instance.title, }; diff --git a/packages/riverpod/example/pubspec.yaml b/packages/riverpod/example/pubspec.yaml index 6fcdd0c5e..5a55da610 100644 --- a/packages/riverpod/example/pubspec.yaml +++ b/packages/riverpod/example/pubspec.yaml @@ -14,7 +14,6 @@ dependencies: dev_dependencies: build_runner: ^2.0.0 - build_verify: ^3.0.0 freezed: ^2.1.0+1 json_serializable: ^6.3.0 test: ^1.16.0 diff --git a/packages/riverpod/example/test/ensure_build_test.dart b/packages/riverpod/example/test/ensure_build_test.dart deleted file mode 100644 index 259a7faf7..000000000 --- a/packages/riverpod/example/test/ensure_build_test.dart +++ /dev/null @@ -1,10 +0,0 @@ -import 'package:build_verify/build_verify.dart'; -import 'package:test/test.dart'; - -void main() { - test('ensure_build', () { - expectBuildClean( - packageRelativeDirectory: 'packages/riverpod/example', - ); - }); -} diff --git a/packages/riverpod_analyzer_utils/lib/src/riverpod_ast/generator_provider_declaration.dart b/packages/riverpod_analyzer_utils/lib/src/riverpod_ast/generator_provider_declaration.dart index ff66551b4..42e961ba2 100644 --- a/packages/riverpod_analyzer_utils/lib/src/riverpod_ast/generator_provider_declaration.dart +++ b/packages/riverpod_analyzer_utils/lib/src/riverpod_ast/generator_provider_declaration.dart @@ -61,9 +61,15 @@ abstract class GeneratorProviderDeclaration extends ProviderDeclaration { @override GeneratorProviderDeclarationElement get providerElement; RiverpodAnnotation get annotation; - DartType get valueType; - DartType get exposedType; - DartType get createdType; + + String get valueTypeDisplayString => valueTypeNode?.toSource() ?? 'Object?'; + String get exposedTypeDisplayString => exposedTypeNode?.source ?? 'Object?'; + String get createdTypeDisplayString => + createdTypeNode?.toSource() ?? 'Object?'; + + TypeAnnotation? get valueTypeNode; + SourcedType? get exposedTypeNode; + TypeAnnotation? get createdTypeNode; final List refInvocations = []; @@ -85,35 +91,83 @@ abstract class GeneratorProviderDeclaration extends ProviderDeclaration { } } -DartType? _computeExposedType( - DartType createdType, +SourcedType? _computeExposedType( + TypeAnnotation? createdType, LibraryElement library, ) { - if (createdType.isRaw) return createdType; + if (createdType == null) { + return ( + source: null, + dartType: library.typeProvider.dynamicType, + ); + } - if (createdType.isDartAsyncFuture || - createdType.isDartAsyncFutureOr || - createdType.isDartAsyncStream) { - createdType as InterfaceType; - return library.createdTypeToValueType(createdType.typeArguments.first); + final createdDartType = createdType.type!; + if (createdDartType.isRaw) { + return ( + source: createdType.toSource(), + dartType: createdType.type!, + ); } - return createdType; + if (createdDartType.isDartAsyncFuture || + createdDartType.isDartAsyncFutureOr || + createdDartType.isDartAsyncStream) { + createdType as NamedType; + createdDartType as InterfaceType; + + final typeSource = createdType.toSource(); + if (typeSource != 'Future' && + typeSource != 'FutureOr' && + typeSource != 'Stream' && + !typeSource.startsWith('Future<') && + !typeSource.startsWith('FutureOr<') && + !typeSource.startsWith('Stream<')) { + throw UnsupportedError( + 'Returning a typedef of type Future/FutureOr/Stream is not supported\n' + 'The code that triggered this error is: $typeSource', + ); + } + + final valueTypeArg = createdType.typeArguments?.arguments.firstOrNull; + + final exposedDartType = + library.createdTypeToValueType(createdDartType.typeArguments.first); + if (exposedDartType == null) return null; + + return ( + source: valueTypeArg == null ? 'AsyncValue' : 'AsyncValue<$valueTypeArg>', + dartType: exposedDartType, + ); + } + + return ( + source: createdType.toSource(), + dartType: createdType.type!, + ); } -DartType _getValueType(DartType createdType) { - if (createdType.isRaw) return createdType; +TypeAnnotation? _getValueType( + TypeAnnotation? createdType, + LibraryElement library, +) { + if (createdType == null) return null; + final dartType = createdType.type!; + if (dartType.isRaw) return createdType; - if (createdType.isDartAsyncFuture || - createdType.isDartAsyncFutureOr || - createdType.isDartAsyncStream) { - createdType as InterfaceType; - return createdType.typeArguments.first; + if (dartType.isDartAsyncFuture || + dartType.isDartAsyncFutureOr || + dartType.isDartAsyncStream) { + createdType as NamedType; + + return createdType.typeArguments?.arguments.firstOrNull; } return createdType; } +typedef SourcedType = ({String? source, DartType dartType}); + class ClassBasedProviderDeclaration extends GeneratorProviderDeclaration { ClassBasedProviderDeclaration._({ required this.name, @@ -121,9 +175,9 @@ class ClassBasedProviderDeclaration extends GeneratorProviderDeclaration { required this.buildMethod, required this.providerElement, required this.annotation, - required this.createdType, - required this.exposedType, - required this.valueType, + required this.createdTypeNode, + required this.exposedTypeNode, + required this.valueTypeNode, }); static ClassBasedProviderDeclaration? _parse( @@ -155,24 +209,25 @@ class ClassBasedProviderDeclaration extends GeneratorProviderDeclaration { ); if (providerElement == null) return null; - final createdType = buildMethod.returnType?.type ?? - element.library.typeProvider.dynamicType; + final createdTypeNode = buildMethod.returnType; - final exposedType = _computeExposedType(createdType, element.library); - if (exposedType == null) { + final exposedTypeNode = + _computeExposedType(createdTypeNode, element.library); + if (exposedTypeNode == null) { // Error already reported return null; } + final valueTypeNode = _getValueType(createdTypeNode, element.library); final classBasedProviderDeclaration = ClassBasedProviderDeclaration._( name: node.name, node: node, buildMethod: buildMethod, providerElement: providerElement, annotation: riverpodAnnotation, - createdType: createdType, - exposedType: exposedType, - valueType: _getValueType(createdType), + createdTypeNode: createdTypeNode, + exposedTypeNode: exposedTypeNode, + valueTypeNode: valueTypeNode, ); riverpodAnnotation._parent = classBasedProviderDeclaration; node.accept( @@ -192,11 +247,11 @@ class ClassBasedProviderDeclaration extends GeneratorProviderDeclaration { final RiverpodAnnotation annotation; final MethodDeclaration buildMethod; @override - final DartType createdType; + final TypeAnnotation? createdTypeNode; @override - final DartType exposedType; + final TypeAnnotation? valueTypeNode; @override - final DartType valueType; + final SourcedType exposedTypeNode; @override void accept(RiverpodAstVisitor visitor) { @@ -249,9 +304,9 @@ class FunctionalProviderDeclaration extends GeneratorProviderDeclaration { required this.node, required this.providerElement, required this.annotation, - required this.createdType, - required this.exposedType, - required this.valueType, + required this.createdTypeNode, + required this.exposedTypeNode, + required this.valueTypeNode, }); static FunctionalProviderDeclaration? _parse( @@ -269,9 +324,10 @@ class FunctionalProviderDeclaration extends GeneratorProviderDeclaration { ); if (providerElement == null) return null; - final createdType = element.returnType; - final exposedType = _computeExposedType(createdType, element.library); - if (exposedType == null) { + final createdTypeNode = node.returnType; + final exposedTypeNode = + _computeExposedType(createdTypeNode, element.library); + if (exposedTypeNode == null) { // Error already reported return null; } @@ -281,9 +337,9 @@ class FunctionalProviderDeclaration extends GeneratorProviderDeclaration { node: node, providerElement: providerElement, annotation: riverpodAnnotation, - createdType: createdType, - exposedType: exposedType, - valueType: _getValueType(createdType), + createdTypeNode: createdTypeNode, + exposedTypeNode: exposedTypeNode, + valueTypeNode: _getValueType(createdTypeNode, element.library), ); riverpodAnnotation._parent = functionalProviderDeclaration; node.accept( @@ -302,11 +358,11 @@ class FunctionalProviderDeclaration extends GeneratorProviderDeclaration { @override final RiverpodAnnotation annotation; @override - final DartType createdType; + final TypeAnnotation? createdTypeNode; @override - final DartType exposedType; + final TypeAnnotation? valueTypeNode; @override - final DartType valueType; + final SourcedType exposedTypeNode; /// Whether the provider uses the syntax sugar for scoped providers: /// diff --git a/packages/riverpod_analyzer_utils_tests/test/generator_provider_declaration_test.dart b/packages/riverpod_analyzer_utils_tests/test/generator_provider_declaration_test.dart index 69036f3c9..ad1453d50 100644 --- a/packages/riverpod_analyzer_utils_tests/test/generator_provider_declaration_test.dart +++ b/packages/riverpod_analyzer_utils_tests/test/generator_provider_declaration_test.dart @@ -29,23 +29,36 @@ Future> value3(Value3Ref ref) async => 0; final value3 = result.functionalProviderDeclarations.singleWhere( (e) => e.name.toString() == 'value3', ); - expect(value.createdType.toString(), 'Future'); - expect(value.exposedType.toString(), 'Future'); - expect(value.valueType.toString(), 'Future'); - expect(value.createdType.isRaw, true); - expect(value.valueType.isRaw, true); - - expect(value2.createdType.toString(), 'Future'); - expect(value2.exposedType.toString(), 'AsyncValue'); - expect(value2.valueType.toString(), 'int'); - expect(value2.createdType.isRaw, false); - expect(value2.valueType.isRaw, false); - - expect(value3.createdType.toString(), 'Future'); - expect(value3.exposedType.toString(), 'AsyncValue'); - expect(value3.valueType.toString(), 'int'); - expect(value3.createdType.isRaw, false); - expect(value3.valueType.isRaw, true); + expect(value.createdTypeNode.toString(), 'Raw>'); + expect(value.createdTypeDisplayString, 'Raw>'); + expect(value.exposedTypeNode.source, 'Raw>'); + expect(value.exposedTypeNode.dartType.toString(), 'Future'); + expect(value.exposedTypeDisplayString, 'Raw>'); + expect(value.valueTypeNode.toString(), 'Raw>'); + expect(value.valueTypeDisplayString, 'Raw>'); + expect(value.createdTypeNode!.type!.isRaw, true); + expect(value.valueTypeNode!.type!.isRaw, true); + + expect(value2.createdTypeNode.toString(), 'Future'); + expect(value2.exposedTypeNode.source, 'AsyncValue'); + expect(value2.exposedTypeNode.dartType.toString(), 'AsyncValue'); + expect(value2.valueTypeNode.toString(), 'int'); + expect(value2.createdTypeNode!.type!.isRaw, false); + expect(value2.createdTypeDisplayString, 'Future'); + expect(value2.exposedTypeDisplayString, 'AsyncValue'); + expect(value2.valueTypeDisplayString, 'int'); + expect(value2.createdTypeNode!.type!.isRaw, false); + expect(value2.valueTypeNode!.type!.isRaw, false); + + expect(value3.createdTypeNode.toString(), 'Future>'); + expect(value3.exposedTypeNode.source, 'AsyncValue>'); + expect(value3.exposedTypeNode.dartType.toString(), 'AsyncValue'); + expect(value3.valueTypeNode.toString(), 'Raw'); + expect(value3.createdTypeDisplayString, 'Future>'); + expect(value3.exposedTypeDisplayString, 'AsyncValue>'); + expect(value3.valueTypeDisplayString, 'Raw'); + expect(value3.createdTypeNode!.type!.isRaw, false); + expect(value3.valueTypeNode!.type!.isRaw, true); }); testSource('Decode needsOverride/isScoped', source: ''' diff --git a/packages/riverpod_generator/CHANGELOG.md b/packages/riverpod_generator/CHANGELOG.md index b15a422cc..059b0f565 100644 --- a/packages/riverpod_generator/CHANGELOG.md +++ b/packages/riverpod_generator/CHANGELOG.md @@ -1,3 +1,22 @@ +## Unreleased major + +The code generator now supports import aliases, generated types and typedefs +as input of providers!. + +This comes with a few minor restrictions: + +- **Breaking**: Returning a Typedef or type Future/FutureOr/Stream is no-longer supported: + + ```dart + typedef Example = Future; + + @riverpod + Example foo(FooRef ref) async => 0; + ``` + +- **Breaking**: Arugments of the form `fn(void myParameter())` + are no-longer supported. Instead use `fn(void Function() myParameter)`. + ## 2.3.3 - 2023-09-27 - `riverpod_analyzer_utils` upgraded to `0.3.4` diff --git a/packages/riverpod_generator/integration/build_yaml/lib/main.g.dart b/packages/riverpod_generator/integration/build_yaml/lib/main.g.dart index ff7c3efc3..1f9b43a79 100644 --- a/packages/riverpod_generator/integration/build_yaml/lib/main.g.dart +++ b/packages/riverpod_generator/integration/build_yaml/lib/main.g.dart @@ -934,4 +934,4 @@ class _CountStreamNotifier2ProviderElement int get a => (origin as CountStreamNotifier2Provider).a; } // 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 diff --git a/packages/riverpod_generator/integration/build_yaml/pubspec.yaml b/packages/riverpod_generator/integration/build_yaml/pubspec.yaml index 519d94960..8d904a11c 100644 --- a/packages/riverpod_generator/integration/build_yaml/pubspec.yaml +++ b/packages/riverpod_generator/integration/build_yaml/pubspec.yaml @@ -11,6 +11,5 @@ dependencies: dev_dependencies: build_runner: ^2.3.2 - build_verify: ^3.0.0 riverpod_generator: test: ^1.16.0 diff --git a/packages/riverpod_generator/integration/build_yaml/test/build_yaml_test.dart b/packages/riverpod_generator/integration/build_yaml/test/build_yaml_test.dart deleted file mode 100644 index 1f2c0ef7e..000000000 --- a/packages/riverpod_generator/integration/build_yaml/test/build_yaml_test.dart +++ /dev/null @@ -1,38 +0,0 @@ -import 'package:build_verify/build_verify.dart'; -import 'package:build_yaml/main.dart'; -import 'package:test/test.dart'; - -void main() { - test( - 'ensure_build', - () => expectBuildClean( - packageRelativeDirectory: - 'packages/riverpod_generator/integration/build_yaml', - ), - timeout: const Timeout(Duration(minutes: 1)), - ); - - test('provider names', () { - expect(countPod.name, 'countPod'); - expect(countFuturePod.name, 'countFuturePod'); - expect(countStreamPod.name, 'countStreamPod'); - expect(countNotifierPod.name, 'countNotifierPod'); - expect(countAsyncNotifierPod.name, 'countAsyncNotifierPod'); - expect(countStreamNotifierPod.name, 'countStreamNotifierPod'); - }); - - test('provider family names', () { - expect(count2ProviderFamily.name, 'count2ProviderFamily'); - expect(countFuture2ProviderFamily.name, 'countFuture2ProviderFamily'); - expect(countStream2ProviderFamily.name, 'countStream2ProviderFamily'); - expect(countNotifier2ProviderFamily.name, 'countNotifier2ProviderFamily'); - expect( - countAsyncNotifier2ProviderFamily.name, - 'countAsyncNotifier2ProviderFamily', - ); - expect( - countStreamNotifier2ProviderFamily.name, - 'countStreamNotifier2ProviderFamily', - ); - }); -} diff --git a/packages/riverpod_generator/lib/src/parse_generator.dart b/packages/riverpod_generator/lib/src/parse_generator.dart index 3c52f8359..3e7e477ed 100644 --- a/packages/riverpod_generator/lib/src/parse_generator.dart +++ b/packages/riverpod_generator/lib/src/parse_generator.dart @@ -20,7 +20,10 @@ abstract class ParserGenerator ) async { final firstAnnotatedElementFromUniqueSource = {}; - for (final annotated in library.annotatedWithExact(typeChecker)) { + for (final annotated in library.annotatedWithExact( + typeChecker, + throwOnUnresolved: false, + )) { firstAnnotatedElementFromUniqueSource.putIfAbsent( annotated.element.source!.uri, () => annotated.element, diff --git a/packages/riverpod_generator/lib/src/riverpod_generator.dart b/packages/riverpod_generator/lib/src/riverpod_generator.dart index 0bd74277c..a575c5271 100644 --- a/packages/riverpod_generator/lib/src/riverpod_generator.dart +++ b/packages/riverpod_generator/lib/src/riverpod_generator.dart @@ -80,7 +80,7 @@ class RiverpodGenerator extends ParserGenerator { if (buffer.isNotEmpty) { buffer.write(''' // 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 '''); } diff --git a/packages/riverpod_generator/lib/src/templates/class_based_provider.dart b/packages/riverpod_generator/lib/src/templates/class_based_provider.dart index ad9078d47..8e096d824 100644 --- a/packages/riverpod_generator/lib/src/templates/class_based_provider.dart +++ b/packages/riverpod_generator/lib/src/templates/class_based_provider.dart @@ -98,8 +98,8 @@ class ClassBasedProviderTemplate extends Template { var providerType = '${leading}NotifierProvider'; final providerName = providerNameFor(provider.providerElement, options); - final returnType = provider.createdType; - if (!returnType.isRaw) { + final returnType = provider.createdTypeNode?.type; + if (returnType != null && !returnType.isRaw) { if ((returnType.isDartAsyncFutureOr) || (returnType.isDartAsyncFuture)) { notifierBaseType = '${leading}AsyncNotifier'; providerType = '${leading}AsyncNotifierProvider'; @@ -112,7 +112,7 @@ class ClassBasedProviderTemplate extends Template { buffer.write(''' ${providerDocFor(provider.providerElement.element)} @ProviderFor(${provider.name}) -final $providerName = $providerType<${provider.name}, ${provider.valueType}>.internal( +final $providerName = $providerType<${provider.name}, ${provider.valueTypeDisplayString}>.internal( ${provider.providerElement.name}.new, name: r'$providerName', debugGetCreateSourceHash: $hashFn, @@ -120,7 +120,7 @@ final $providerName = $providerType<${provider.name}, ${provider.valueType}>.int allTransitiveDependencies: ${serializeAllTransitiveDependencies(provider.providerElement.annotation, options)}, ); -typedef $notifierTypedefName = $notifierBaseType<${provider.valueType}>; +typedef $notifierTypedefName = $notifierBaseType<${provider.valueTypeDisplayString}>; '''); } } diff --git a/packages/riverpod_generator/lib/src/templates/family.dart b/packages/riverpod_generator/lib/src/templates/family.dart index 843dd7c84..97d356eab 100644 --- a/packages/riverpod_generator/lib/src/templates/family.dart +++ b/packages/riverpod_generator/lib/src/templates/family.dart @@ -1,4 +1,4 @@ -import 'package:analyzer/dart/element/element.dart'; +import 'package:analyzer/dart/ast/ast.dart'; import 'package:collection/collection.dart'; import 'package:riverpod_analyzer_utils/riverpod_analyzer_utils.dart'; @@ -52,17 +52,17 @@ class FamilyTemplate extends Template { var providerType = '${leading}Provider'; var refType = '${leading}ProviderRef'; var elementType = '${leading}ProviderElement'; - var createdType = provider.createdType.toString(); + var createdType = provider.createdTypeDisplayString; - final returnType = provider.createdType; - if (!returnType.isRaw) { + final returnType = provider.createdTypeNode?.type; + if (returnType != null && !returnType.isRaw) { if (returnType.isDartAsyncFutureOr || returnType.isDartAsyncFuture) { providerType = '${leading}FutureProvider'; refType = '${leading}FutureProviderRef'; elementType = '${leading}FutureProviderElement'; // Always use FutureOr in overrideWith as return value // or otherwise we get a compilation error. - createdType = 'FutureOr<${provider.valueType}>'; + createdType = 'FutureOr<${provider.valueTypeDisplayString}>'; } else if (returnType.isDartAsyncStream) { providerType = '${leading}StreamProvider'; refType = '${leading}StreamProviderRef'; @@ -70,14 +70,12 @@ class FamilyTemplate extends Template { } } - final parameters = provider - .node.functionExpression.parameters!.parameterElements - .whereNotNull() + final parameters = provider.node.functionExpression.parameters!.parameters .skip(1) .toList(); final parametersPassThrough = buildParamInvocationQuery({ - for (final parameter in parameters) parameter: parameter.name, + for (final parameter in parameters) parameter: parameter.name!.lexeme, }); return FamilyTemplate._( @@ -87,7 +85,7 @@ class FamilyTemplate extends Template { hashFn: hashFn, elementType: elementType, refType: refType, - providerGenerics: '<${provider.valueType}>', + providerGenerics: '<${provider.valueTypeDisplayString}>', providerCreate: '(ref) => ${provider.name}(ref as ${provider._refImplName}, $parametersPassThrough)', providerType: providerType, @@ -131,8 +129,8 @@ ${parameters.map((e) => ' ${e.name}: ${e.name},\n').join()} var notifierBaseType = 'Buildless${leading}Notifier'; var elementType = '${leading}NotifierProviderElement'; - final returnType = provider.createdType; - if (!returnType.isRaw) { + final returnType = provider.createdTypeNode?.type; + if (returnType != null && !returnType.isRaw) { if (returnType.isDartAsyncFutureOr || returnType.isDartAsyncFuture) { providerType = '${leading}AsyncNotifierProviderImpl'; refType = '${leading}AsyncNotifierProviderRef'; @@ -146,15 +144,14 @@ ${parameters.map((e) => ' ${e.name}: ${e.name},\n').join()} } } - final parameters = provider.buildMethod.parameters!.parameterElements - .whereNotNull() - .toList(); + final parameters = + provider.buildMethod.parameters!.parameters.whereNotNull().toList(); final parameterDefinition = buildParamDefinitionQuery(parameters); final cascadePropertyInit = parameters.map((e) => '..${e.name} = ${e.name}').join('\n'); final parametersPassThrough = buildParamInvocationQuery({ - for (final parameter in parameters) parameter: parameter.name, + for (final parameter in parameters) parameter: parameter.name!.lexeme, }); return FamilyTemplate._( @@ -164,20 +161,21 @@ ${parameters.map((e) => ' ${e.name}: ${e.name},\n').join()} hashFn: hashFn, elementType: elementType, refType: refType, - providerGenerics: '<${provider.name}, ${provider.valueType}>', + providerGenerics: + '<${provider.name}, ${provider.valueTypeDisplayString}>', providerType: providerType, providerCreate: '() => ${provider.name}()$cascadePropertyInit', parametersPassThrough: parametersPassThrough, other: ''' -abstract class $notifierTypedefName extends $notifierBaseType<${provider.valueType}> { - ${parameters.map((e) => 'late final ${e.type} ${e.name};').join('\n')} +abstract class $notifierTypedefName extends $notifierBaseType<${provider.valueTypeDisplayString}> { + ${parameters.map((e) => 'late final ${e.typeDisplayString} ${e.name};').join('\n')} - ${provider.createdType} build($parameterDefinition); + ${provider.createdTypeDisplayString} build($parameterDefinition); } ''', providerOther: ''' @override - ${provider.createdType} runNotifierBuild( + ${provider.createdTypeDisplayString} runNotifierBuild( covariant ${provider.name} notifier, ) { return notifier.build($parametersPassThrough); @@ -203,7 +201,7 @@ ${parameters.map((e) => ' ${e.name}: ${e.name},\n').join()} } final GeneratorProviderDeclaration provider; - final List parameters; + final List parameters; final BuildYamlOptions options; final String refType; final String elementType; @@ -245,7 +243,7 @@ $docs const $providerName = $familyName(); $docs -class $familyName extends Family<${provider.exposedType}> { +class $familyName extends Family<${provider.exposedTypeDisplayString}> { $docs const $familyName(); @@ -303,7 +301,7 @@ class $providerTypeNameImpl extends $providerType$providerGenerics { )} }) : super.internal(); -${parameters.map((e) => 'final ${e.type.getDisplayString(withNullability: true)} ${e.name};').join()} +${parameters.map((e) => 'final ${e.typeDisplayString} ${e.name};').join()} $providerOther @@ -329,18 +327,18 @@ ${parameters.map((e) => 'hash = _SystemHash.combine(hash, ${e.name}.hashCode);') } } -mixin $refNameImpl on $refType<${provider.valueType}> { +mixin $refNameImpl on $refType<${provider.valueTypeDisplayString}> { ${parameters.map((e) { return ''' /// The parameter `${e.name}` of this provider. -${e.type} get ${e.name};'''; +${e.typeDisplayString} get ${e.name};'''; }).join()} } class $elementNameImpl extends $elementType$providerGenerics with $refNameImpl { $elementNameImpl(super.provider); -${parameters.map((e) => '@override ${e.type} get ${e.name} => (origin as $providerTypeNameImpl).${e.name};').join()} +${parameters.map((e) => '@override ${e.typeDisplayString} get ${e.name} => (origin as $providerTypeNameImpl).${e.name};').join()} } '''); } diff --git a/packages/riverpod_generator/lib/src/templates/functional_provider.dart b/packages/riverpod_generator/lib/src/templates/functional_provider.dart index 8e9535b9c..bdfc4a744 100644 --- a/packages/riverpod_generator/lib/src/templates/functional_provider.dart +++ b/packages/riverpod_generator/lib/src/templates/functional_provider.dart @@ -35,8 +35,8 @@ class FunctionalProviderTemplate extends Template { var providerType = '${leading}Provider'; - final returnType = provider.createdType; - if (!returnType.isRaw) { + final returnType = provider.createdTypeNode?.type; + if (returnType != null && !returnType.isRaw) { if ((returnType.isDartAsyncFutureOr) || (returnType.isDartAsyncFuture)) { providerType = '${leading}FutureProvider'; } else if (returnType.isDartAsyncStream) { @@ -58,7 +58,7 @@ class FunctionalProviderTemplate extends Template { buffer.write(''' ${providerDocFor(provider.providerElement.element)} @ProviderFor(${provider.name}) -final $providerName = $providerType<${provider.valueType}>.internal( +final $providerName = $providerType<${provider.valueTypeDisplayString}>.internal( $createFn, name: r'$providerName', debugGetCreateSourceHash: $hashFn, @@ -66,7 +66,7 @@ final $providerName = $providerType<${provider.valueType}>.internal( allTransitiveDependencies: ${serializeAllTransitiveDependencies(provider.providerElement.annotation, options)}, ); -typedef $refName = ${providerType}Ref<${provider.valueType}>; +typedef $refName = ${providerType}Ref<${provider.valueTypeDisplayString}>; '''); } } diff --git a/packages/riverpod_generator/lib/src/templates/parameters.dart b/packages/riverpod_generator/lib/src/templates/parameters.dart index 55a302b8a..42494526b 100644 --- a/packages/riverpod_generator/lib/src/templates/parameters.dart +++ b/packages/riverpod_generator/lib/src/templates/parameters.dart @@ -1,7 +1,7 @@ -import 'package:analyzer/dart/element/element.dart'; +import 'package:analyzer/dart/ast/ast.dart'; String buildParamDefinitionQuery( - List parameters, { + List parameters, { bool asThisParameter = false, bool asSuperParameter = false, bool writeBrackets = true, @@ -23,14 +23,17 @@ String buildParamDefinitionQuery( .toList(); final buffer = StringBuffer(); - String encodeParameter(ParameterElement e) { - final leading = e.isRequiredNamed || asRequiredNamed ? 'required ' : ''; - final trailing = e.defaultValueCode != null && !asRequiredNamed - ? '= ${e.defaultValueCode}' + String encodeParameter(FormalParameter parameter) { + late final element = parameter.declaredElement!; + late final leading = + parameter.isRequiredNamed || asRequiredNamed ? 'required ' : ''; + late final trailing = element.defaultValueCode != null && !asRequiredNamed + ? '= ${element.defaultValueCode}' : ''; - if (asThisParameter) return '${leading}this.${e.name}$trailing'; - if (asSuperParameter) return '${leading}super.${e.name}$trailing'; - return '$leading${e.type} ${e.name}$trailing'; + if (asThisParameter) return '${leading}this.${parameter.name}$trailing'; + if (asSuperParameter) return '${leading}super.${parameter.name}$trailing'; + + return '$leading${parameter.typeDisplayString} ${parameter.name}$trailing'; } buffer.writeAll( @@ -53,7 +56,7 @@ String buildParamDefinitionQuery( } String buildParamInvocationQuery( - Map parameters, { + Map parameters, { bool asThisParameter = false, }) { final buffer = StringBuffer(); @@ -67,3 +70,22 @@ String buildParamInvocationQuery( return buffer.toString(); } + +extension ParamterType on FormalParameter { + String get typeDisplayString { + final that = this; + switch (that) { + case DefaultFormalParameter(): + return that.parameter.typeDisplayString; + case SimpleFormalParameter(): + // No type, so let's just return '' + return that.type?.toSource() ?? ''; + case FieldFormalParameter(): + case FunctionTypedFormalParameter(): + case SuperFormalParameter(): + throw UnsupportedError( + 'Only parameters of the form "Type name" are supported', + ); + } + } +} diff --git a/packages/riverpod_generator/pubspec.yaml b/packages/riverpod_generator/pubspec.yaml index 3a53c7191..c902305c2 100644 --- a/packages/riverpod_generator/pubspec.yaml +++ b/packages/riverpod_generator/pubspec.yaml @@ -7,10 +7,10 @@ funding: - https://github.com/sponsors/rrousselGit/ environment: - sdk: ">=2.17.0 <3.0.0" + sdk: ">=3.0.0 <4.0.0" dependencies: - analyzer: ">=5.12.0 <7.0.0" + analyzer: ">=6.0.0 <7.0.0" build: ^2.0.0 build_config: ^1.0.0 collection: ^1.15.0 @@ -23,6 +23,7 @@ dependencies: dev_dependencies: build_runner: ^2.1.7 - build_verify: ^3.0.0 + freezed: ^2.4.3 + freezed_annotation: ^2.4.1 riverpod: ^2.3.0 test: ^1.21.0 diff --git a/packages/riverpod_generator/test/ensuire_build_test.dart b/packages/riverpod_generator/test/ensuire_build_test.dart deleted file mode 100644 index bebf03832..000000000 --- a/packages/riverpod_generator/test/ensuire_build_test.dart +++ /dev/null @@ -1,10 +0,0 @@ -import 'package:build_verify/build_verify.dart'; -import 'package:test/test.dart'; - -void main() { - test('ensure_build', () { - expectBuildClean( - packageRelativeDirectory: 'packages/riverpod_generator', - ); - }); -} diff --git a/packages/riverpod_generator/test/integration/async.g.dart b/packages/riverpod_generator/test/integration/async.g.dart index e1af6bc9f..b5b89e9f6 100644 --- a/packages/riverpod_generator/test/integration/async.g.dart +++ b/packages/riverpod_generator/test/integration/async.g.dart @@ -773,4 +773,4 @@ class _FamilyClassProviderElement List? get fifth => (origin as FamilyClassProvider).fifth; } // 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 diff --git a/packages/riverpod_generator/test/integration/auto_dispose.g.dart b/packages/riverpod_generator/test/integration/auto_dispose.g.dart index 4bd8667b9..c66d4ba5b 100644 --- a/packages/riverpod_generator/test/integration/auto_dispose.g.dart +++ b/packages/riverpod_generator/test/integration/auto_dispose.g.dart @@ -35,4 +35,4 @@ final notKeepAliveProvider = AutoDisposeProvider.internal( typedef NotKeepAliveRef = AutoDisposeProviderRef; // 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 diff --git a/packages/riverpod_generator/test/integration/dependencies.g.dart b/packages/riverpod_generator/test/integration/dependencies.g.dart index 000466f9f..1b35a13c2 100644 --- a/packages/riverpod_generator/test/integration/dependencies.g.dart +++ b/packages/riverpod_generator/test/integration/dependencies.g.dart @@ -687,4 +687,4 @@ final emptyDependenciesClassBasedProvider = typedef _$EmptyDependenciesClassBased = AutoDisposeNotifier; // 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 diff --git a/packages/riverpod_generator/test/integration/dependencies2.g.dart b/packages/riverpod_generator/test/integration/dependencies2.g.dart index 69ec582c1..f90564f71 100644 --- a/packages/riverpod_generator/test/integration/dependencies2.g.dart +++ b/packages/riverpod_generator/test/integration/dependencies2.g.dart @@ -410,4 +410,4 @@ class _NotifierFamilyWithDependenciesProviderElement int? get id => (origin as NotifierFamilyWithDependenciesProvider).id; } // 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 diff --git a/packages/riverpod_generator/test/integration/generated.dart b/packages/riverpod_generator/test/integration/generated.dart new file mode 100644 index 000000000..2a117a8e6 --- /dev/null +++ b/packages/riverpod_generator/test/integration/generated.dart @@ -0,0 +1,83 @@ +// ignore_for_file: library_private_types_in_public_api, inference_failure_on_function_return_type, always_declare_return_types, type_annotate_public_apis + +import 'package:freezed_annotation/freezed_annotation.dart'; +import 'package:riverpod/riverpod.dart' as r; +import 'package:riverpod_annotation/riverpod_annotation.dart'; + +part 'generated.freezed.dart'; +part 'generated.g.dart'; + +@freezed +class Test with _$Test { + factory Test() = _Test; +} + +@riverpod +_Test generated(GeneratedRef ref) => _Test(); + +@riverpod +_Test generatedFamily(GeneratedFamilyRef ref, _Test test) => _Test(); + +@riverpod +class GeneratedClass extends _$GeneratedClass { + @override + _Test build() => _Test(); +} + +@riverpod +class GeneratedClassFamily extends _$GeneratedClassFamily { + @override + _Test build(_Test test) => _Test(); +} + +@riverpod +$dynamic($DynamicRef ref) => _Test(); + +@riverpod +$dynamicFamily($DynamicFamilyRef ref, test) => _Test(); + +@riverpod +class $DynamicClass extends _$$DynamicClass { + @override + build() => _Test(); +} + +@riverpod +class $DynamicClassFamily extends _$$DynamicClassFamily { + @override + build(test) => _Test(); +} + +@riverpod +_dynamic(_DynamicRef ref, test) => 0; + +@riverpod +r.AsyncValue alias(AliasRef ref) { + return const r.AsyncData(42); +} + +@riverpod +r.AsyncValue aliasFamily( + AliasFamilyRef ref, + r.AsyncValue test, +) { + return const r.AsyncData(42); +} + +@riverpod +class AliasClass extends _$AliasClass { + @override + r.AsyncValue build() { + return const r.AsyncData(42); + } +} + +@riverpod +class AliasClassFamily extends _$AliasClassFamily { + @override + r.AsyncValue build( + r.AsyncValue test, + ) { + return const r.AsyncData(42); + } +} diff --git a/packages/riverpod_generator/test/integration/generated.freezed.dart b/packages/riverpod_generator/test/integration/generated.freezed.dart new file mode 100644 index 000000000..b7df1ae69 --- /dev/null +++ b/packages/riverpod_generator/test/integration/generated.freezed.dart @@ -0,0 +1,74 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'generated.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + +/// @nodoc +mixin _$Test {} + +/// @nodoc +abstract class $TestCopyWith<$Res> { + factory $TestCopyWith(Test value, $Res Function(Test) then) = + _$TestCopyWithImpl<$Res, Test>; +} + +/// @nodoc +class _$TestCopyWithImpl<$Res, $Val extends Test> + implements $TestCopyWith<$Res> { + _$TestCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; +} + +/// @nodoc +abstract class _$$TestImplCopyWith<$Res> { + factory _$$TestImplCopyWith( + _$TestImpl value, $Res Function(_$TestImpl) then) = + __$$TestImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$TestImplCopyWithImpl<$Res> + extends _$TestCopyWithImpl<$Res, _$TestImpl> + implements _$$TestImplCopyWith<$Res> { + __$$TestImplCopyWithImpl(_$TestImpl _value, $Res Function(_$TestImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$TestImpl implements _Test { + _$TestImpl(); + + @override + String toString() { + return 'Test()'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$TestImpl); + } + + @override + int get hashCode => runtimeType.hashCode; +} + +abstract class _Test implements Test { + factory _Test() = _$TestImpl; +} diff --git a/packages/riverpod_generator/test/integration/generated.g.dart b/packages/riverpod_generator/test/integration/generated.g.dart new file mode 100644 index 000000000..0eb0350dc --- /dev/null +++ b/packages/riverpod_generator/test/integration/generated.g.dart @@ -0,0 +1,1064 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'generated.dart'; + +// ************************************************************************** +// RiverpodGenerator +// ************************************************************************** + +String _$generatedHash() => r'e49f3520d06ed50d34a44de613fdcd20b19f48d4'; + +/// See also [generated]. +@ProviderFor(generated) +final generatedProvider = AutoDisposeProvider<_Test>.internal( + generated, + name: r'generatedProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') ? null : _$generatedHash, + dependencies: null, + allTransitiveDependencies: null, +); + +typedef GeneratedRef = AutoDisposeProviderRef<_Test>; +String _$generatedFamilyHash() => r'ed284f58926c87acc81dab9168882d5d1c2cddf8'; + +/// Copied from Dart SDK +class _SystemHash { + _SystemHash._(); + + static int combine(int hash, int value) { + // ignore: parameter_assignments + hash = 0x1fffffff & (hash + value); + // ignore: parameter_assignments + hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10)); + return hash ^ (hash >> 6); + } + + static int finish(int hash) { + // ignore: parameter_assignments + hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); + // ignore: parameter_assignments + hash = hash ^ (hash >> 11); + return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); + } +} + +/// See also [generatedFamily]. +@ProviderFor(generatedFamily) +const generatedFamilyProvider = GeneratedFamilyFamily(); + +/// See also [generatedFamily]. +class GeneratedFamilyFamily extends Family<_Test> { + /// See also [generatedFamily]. + const GeneratedFamilyFamily(); + + /// See also [generatedFamily]. + GeneratedFamilyProvider call( + _Test test, + ) { + return GeneratedFamilyProvider( + test, + ); + } + + @override + GeneratedFamilyProvider getProviderOverride( + covariant GeneratedFamilyProvider provider, + ) { + return call( + provider.test, + ); + } + + static const Iterable? _dependencies = null; + + @override + Iterable? get dependencies => _dependencies; + + static const Iterable? _allTransitiveDependencies = null; + + @override + Iterable? get allTransitiveDependencies => + _allTransitiveDependencies; + + @override + String? get name => r'generatedFamilyProvider'; +} + +/// See also [generatedFamily]. +class GeneratedFamilyProvider extends AutoDisposeProvider<_Test> { + /// See also [generatedFamily]. + GeneratedFamilyProvider( + _Test test, + ) : this._internal( + (ref) => generatedFamily( + ref as GeneratedFamilyRef, + test, + ), + from: generatedFamilyProvider, + name: r'generatedFamilyProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$generatedFamilyHash, + dependencies: GeneratedFamilyFamily._dependencies, + allTransitiveDependencies: + GeneratedFamilyFamily._allTransitiveDependencies, + test: test, + ); + + GeneratedFamilyProvider._internal( + super._createNotifier, { + required super.name, + required super.dependencies, + required super.allTransitiveDependencies, + required super.debugGetCreateSourceHash, + required super.from, + required this.test, + }) : super.internal(); + + final _Test test; + + @override + Override overrideWith( + _Test Function(GeneratedFamilyRef provider) create, + ) { + return ProviderOverride( + origin: this, + override: GeneratedFamilyProvider._internal( + (ref) => create(ref as GeneratedFamilyRef), + from: from, + name: null, + dependencies: null, + allTransitiveDependencies: null, + debugGetCreateSourceHash: null, + test: test, + ), + ); + } + + @override + AutoDisposeProviderElement<_Test> createElement() { + return _GeneratedFamilyProviderElement(this); + } + + @override + bool operator ==(Object other) { + return other is GeneratedFamilyProvider && other.test == test; + } + + @override + int get hashCode { + var hash = _SystemHash.combine(0, runtimeType.hashCode); + hash = _SystemHash.combine(hash, test.hashCode); + + return _SystemHash.finish(hash); + } +} + +mixin GeneratedFamilyRef on AutoDisposeProviderRef<_Test> { + /// The parameter `test` of this provider. + _Test get test; +} + +class _GeneratedFamilyProviderElement extends AutoDisposeProviderElement<_Test> + with GeneratedFamilyRef { + _GeneratedFamilyProviderElement(super.provider); + + @override + _Test get test => (origin as GeneratedFamilyProvider).test; +} + +String _$$dynamicHash() => r'f62d63d9340f30b253e687f76deacd8205fed0e7'; + +/// See also [$dynamic]. +@ProviderFor($dynamic) +final $dynamicProvider = AutoDisposeProvider.internal( + $dynamic, + name: r'$dynamicProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') ? null : _$$dynamicHash, + dependencies: null, + allTransitiveDependencies: null, +); + +typedef $DynamicRef = AutoDisposeProviderRef; +String _$$dynamicFamilyHash() => r'b764133af8837b8321b08814892f198d4bc1aa18'; + +/// See also [$dynamicFamily]. +@ProviderFor($dynamicFamily) +const $dynamicFamilyProvider = $DynamicFamilyFamily(); + +/// See also [$dynamicFamily]. +class $DynamicFamilyFamily extends Family { + /// See also [$dynamicFamily]. + const $DynamicFamilyFamily(); + + /// See also [$dynamicFamily]. + $DynamicFamilyProvider call( + test, + ) { + return $DynamicFamilyProvider( + test, + ); + } + + @override + $DynamicFamilyProvider getProviderOverride( + covariant $DynamicFamilyProvider provider, + ) { + return call( + provider.test, + ); + } + + static const Iterable? _dependencies = null; + + @override + Iterable? get dependencies => _dependencies; + + static const Iterable? _allTransitiveDependencies = null; + + @override + Iterable? get allTransitiveDependencies => + _allTransitiveDependencies; + + @override + String? get name => r'$dynamicFamilyProvider'; +} + +/// See also [$dynamicFamily]. +class $DynamicFamilyProvider extends AutoDisposeProvider { + /// See also [$dynamicFamily]. + $DynamicFamilyProvider( + test, + ) : this._internal( + (ref) => $dynamicFamily( + ref as $DynamicFamilyRef, + test, + ), + from: $dynamicFamilyProvider, + name: r'$dynamicFamilyProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$$dynamicFamilyHash, + dependencies: $DynamicFamilyFamily._dependencies, + allTransitiveDependencies: + $DynamicFamilyFamily._allTransitiveDependencies, + test: test, + ); + + $DynamicFamilyProvider._internal( + super._createNotifier, { + required super.name, + required super.dependencies, + required super.allTransitiveDependencies, + required super.debugGetCreateSourceHash, + required super.from, + required this.test, + }) : super.internal(); + + final test; + + @override + Override overrideWith( + Object? Function($DynamicFamilyRef provider) create, + ) { + return ProviderOverride( + origin: this, + override: $DynamicFamilyProvider._internal( + (ref) => create(ref as $DynamicFamilyRef), + from: from, + name: null, + dependencies: null, + allTransitiveDependencies: null, + debugGetCreateSourceHash: null, + test: test, + ), + ); + } + + @override + AutoDisposeProviderElement createElement() { + return _$DynamicFamilyProviderElement(this); + } + + @override + bool operator ==(Object other) { + return other is $DynamicFamilyProvider && other.test == test; + } + + @override + int get hashCode { + var hash = _SystemHash.combine(0, runtimeType.hashCode); + hash = _SystemHash.combine(hash, test.hashCode); + + return _SystemHash.finish(hash); + } +} + +mixin $DynamicFamilyRef on AutoDisposeProviderRef { + /// The parameter `test` of this provider. + get test; +} + +class _$DynamicFamilyProviderElement extends AutoDisposeProviderElement + with $DynamicFamilyRef { + _$DynamicFamilyProviderElement(super.provider); + + @override + get test => (origin as $DynamicFamilyProvider).test; +} + +String _$dynamicHash() => r'da9dc07960139fff2cf5fe584dca5c524e4f2308'; + +/// See also [_dynamic]. +@ProviderFor(_dynamic) +const _dynamicProvider = _DynamicFamily(); + +/// See also [_dynamic]. +class _DynamicFamily extends Family { + /// See also [_dynamic]. + const _DynamicFamily(); + + /// See also [_dynamic]. + _DynamicProvider call( + test, + ) { + return _DynamicProvider( + test, + ); + } + + @override + _DynamicProvider getProviderOverride( + covariant _DynamicProvider provider, + ) { + return call( + provider.test, + ); + } + + static const Iterable? _dependencies = null; + + @override + Iterable? get dependencies => _dependencies; + + static const Iterable? _allTransitiveDependencies = null; + + @override + Iterable? get allTransitiveDependencies => + _allTransitiveDependencies; + + @override + String? get name => r'_dynamicProvider'; +} + +/// See also [_dynamic]. +class _DynamicProvider extends AutoDisposeProvider { + /// See also [_dynamic]. + _DynamicProvider( + test, + ) : this._internal( + (ref) => _dynamic( + ref as _DynamicRef, + test, + ), + from: _dynamicProvider, + name: r'_dynamicProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$dynamicHash, + dependencies: _DynamicFamily._dependencies, + allTransitiveDependencies: _DynamicFamily._allTransitiveDependencies, + test: test, + ); + + _DynamicProvider._internal( + super._createNotifier, { + required super.name, + required super.dependencies, + required super.allTransitiveDependencies, + required super.debugGetCreateSourceHash, + required super.from, + required this.test, + }) : super.internal(); + + final test; + + @override + Override overrideWith( + Object? Function(_DynamicRef provider) create, + ) { + return ProviderOverride( + origin: this, + override: _DynamicProvider._internal( + (ref) => create(ref as _DynamicRef), + from: from, + name: null, + dependencies: null, + allTransitiveDependencies: null, + debugGetCreateSourceHash: null, + test: test, + ), + ); + } + + @override + AutoDisposeProviderElement createElement() { + return _DynamicProviderElement(this); + } + + @override + bool operator ==(Object other) { + return other is _DynamicProvider && other.test == test; + } + + @override + int get hashCode { + var hash = _SystemHash.combine(0, runtimeType.hashCode); + hash = _SystemHash.combine(hash, test.hashCode); + + return _SystemHash.finish(hash); + } +} + +mixin _DynamicRef on AutoDisposeProviderRef { + /// The parameter `test` of this provider. + get test; +} + +class _DynamicProviderElement extends AutoDisposeProviderElement + with _DynamicRef { + _DynamicProviderElement(super.provider); + + @override + get test => (origin as _DynamicProvider).test; +} + +String _$aliasHash() => r'cc08ec4cc5ec0dc98bdb7f4dcbc035021b09bcf3'; + +/// See also [alias]. +@ProviderFor(alias) +final aliasProvider = AutoDisposeProvider>.internal( + alias, + name: r'aliasProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') ? null : _$aliasHash, + dependencies: null, + allTransitiveDependencies: null, +); + +typedef AliasRef = AutoDisposeProviderRef>; +String _$aliasFamilyHash() => r'f345937d5750132f629aef41646b119a301f750b'; + +/// See also [aliasFamily]. +@ProviderFor(aliasFamily) +const aliasFamilyProvider = AliasFamilyFamily(); + +/// See also [aliasFamily]. +class AliasFamilyFamily extends Family> { + /// See also [aliasFamily]. + const AliasFamilyFamily(); + + /// See also [aliasFamily]. + AliasFamilyProvider call( + r.AsyncValue test, + ) { + return AliasFamilyProvider( + test, + ); + } + + @override + AliasFamilyProvider getProviderOverride( + covariant AliasFamilyProvider provider, + ) { + return call( + provider.test, + ); + } + + static const Iterable? _dependencies = null; + + @override + Iterable? get dependencies => _dependencies; + + static const Iterable? _allTransitiveDependencies = null; + + @override + Iterable? get allTransitiveDependencies => + _allTransitiveDependencies; + + @override + String? get name => r'aliasFamilyProvider'; +} + +/// See also [aliasFamily]. +class AliasFamilyProvider extends AutoDisposeProvider> { + /// See also [aliasFamily]. + AliasFamilyProvider( + r.AsyncValue test, + ) : this._internal( + (ref) => aliasFamily( + ref as AliasFamilyRef, + test, + ), + from: aliasFamilyProvider, + name: r'aliasFamilyProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$aliasFamilyHash, + dependencies: AliasFamilyFamily._dependencies, + allTransitiveDependencies: + AliasFamilyFamily._allTransitiveDependencies, + test: test, + ); + + AliasFamilyProvider._internal( + super._createNotifier, { + required super.name, + required super.dependencies, + required super.allTransitiveDependencies, + required super.debugGetCreateSourceHash, + required super.from, + required this.test, + }) : super.internal(); + + final r.AsyncValue test; + + @override + Override overrideWith( + r.AsyncValue Function(AliasFamilyRef provider) create, + ) { + return ProviderOverride( + origin: this, + override: AliasFamilyProvider._internal( + (ref) => create(ref as AliasFamilyRef), + from: from, + name: null, + dependencies: null, + allTransitiveDependencies: null, + debugGetCreateSourceHash: null, + test: test, + ), + ); + } + + @override + AutoDisposeProviderElement> createElement() { + return _AliasFamilyProviderElement(this); + } + + @override + bool operator ==(Object other) { + return other is AliasFamilyProvider && other.test == test; + } + + @override + int get hashCode { + var hash = _SystemHash.combine(0, runtimeType.hashCode); + hash = _SystemHash.combine(hash, test.hashCode); + + return _SystemHash.finish(hash); + } +} + +mixin AliasFamilyRef on AutoDisposeProviderRef> { + /// The parameter `test` of this provider. + r.AsyncValue get test; +} + +class _AliasFamilyProviderElement + extends AutoDisposeProviderElement> with AliasFamilyRef { + _AliasFamilyProviderElement(super.provider); + + @override + r.AsyncValue get test => (origin as AliasFamilyProvider).test; +} + +String _$generatedClassHash() => r'984153f97e25de687d2f19756b277aabd56f6e72'; + +/// See also [GeneratedClass]. +@ProviderFor(GeneratedClass) +final generatedClassProvider = + AutoDisposeNotifierProvider.internal( + GeneratedClass.new, + name: r'generatedClassProvider', + debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') + ? null + : _$generatedClassHash, + dependencies: null, + allTransitiveDependencies: null, +); + +typedef _$GeneratedClass = AutoDisposeNotifier<_Test>; +String _$generatedClassFamilyHash() => + r'28d0a5a82af5b254f6ef07b492916e2feb7e6e63'; + +abstract class _$GeneratedClassFamily + extends BuildlessAutoDisposeNotifier<_Test> { + late final _Test test; + + _Test build( + _Test test, + ); +} + +/// See also [GeneratedClassFamily]. +@ProviderFor(GeneratedClassFamily) +const generatedClassFamilyProvider = GeneratedClassFamilyFamily(); + +/// See also [GeneratedClassFamily]. +class GeneratedClassFamilyFamily extends Family<_Test> { + /// See also [GeneratedClassFamily]. + const GeneratedClassFamilyFamily(); + + /// See also [GeneratedClassFamily]. + GeneratedClassFamilyProvider call( + _Test test, + ) { + return GeneratedClassFamilyProvider( + test, + ); + } + + @override + GeneratedClassFamilyProvider getProviderOverride( + covariant GeneratedClassFamilyProvider provider, + ) { + return call( + provider.test, + ); + } + + static const Iterable? _dependencies = null; + + @override + Iterable? get dependencies => _dependencies; + + static const Iterable? _allTransitiveDependencies = null; + + @override + Iterable? get allTransitiveDependencies => + _allTransitiveDependencies; + + @override + String? get name => r'generatedClassFamilyProvider'; +} + +/// See also [GeneratedClassFamily]. +class GeneratedClassFamilyProvider + extends AutoDisposeNotifierProviderImpl { + /// See also [GeneratedClassFamily]. + GeneratedClassFamilyProvider( + _Test test, + ) : this._internal( + () => GeneratedClassFamily()..test = test, + from: generatedClassFamilyProvider, + name: r'generatedClassFamilyProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$generatedClassFamilyHash, + dependencies: GeneratedClassFamilyFamily._dependencies, + allTransitiveDependencies: + GeneratedClassFamilyFamily._allTransitiveDependencies, + test: test, + ); + + GeneratedClassFamilyProvider._internal( + super._createNotifier, { + required super.name, + required super.dependencies, + required super.allTransitiveDependencies, + required super.debugGetCreateSourceHash, + required super.from, + required this.test, + }) : super.internal(); + + final _Test test; + + @override + _Test runNotifierBuild( + covariant GeneratedClassFamily notifier, + ) { + return notifier.build( + test, + ); + } + + @override + Override overrideWith(GeneratedClassFamily Function() create) { + return ProviderOverride( + origin: this, + override: GeneratedClassFamilyProvider._internal( + () => create()..test = test, + from: from, + name: null, + dependencies: null, + allTransitiveDependencies: null, + debugGetCreateSourceHash: null, + test: test, + ), + ); + } + + @override + AutoDisposeNotifierProviderElement + createElement() { + return _GeneratedClassFamilyProviderElement(this); + } + + @override + bool operator ==(Object other) { + return other is GeneratedClassFamilyProvider && other.test == test; + } + + @override + int get hashCode { + var hash = _SystemHash.combine(0, runtimeType.hashCode); + hash = _SystemHash.combine(hash, test.hashCode); + + return _SystemHash.finish(hash); + } +} + +mixin GeneratedClassFamilyRef on AutoDisposeNotifierProviderRef<_Test> { + /// The parameter `test` of this provider. + _Test get test; +} + +class _GeneratedClassFamilyProviderElement + extends AutoDisposeNotifierProviderElement + with GeneratedClassFamilyRef { + _GeneratedClassFamilyProviderElement(super.provider); + + @override + _Test get test => (origin as GeneratedClassFamilyProvider).test; +} + +String _$$dynamicClassHash() => r'c6d8e5191c3f060df3ce3eee66107433fd4c3292'; + +/// See also [$DynamicClass]. +@ProviderFor($DynamicClass) +final $dynamicClassProvider = + AutoDisposeNotifierProvider<$DynamicClass, Object?>.internal( + $DynamicClass.new, + name: r'$dynamicClassProvider', + debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') + ? null + : _$$dynamicClassHash, + dependencies: null, + allTransitiveDependencies: null, +); + +typedef _$$DynamicClass = AutoDisposeNotifier; +String _$$dynamicClassFamilyHash() => + r'bdda961386f3b647c071d79293a8da441580c470'; + +abstract class _$$DynamicClassFamily + extends BuildlessAutoDisposeNotifier { + late final test; + + Object? build( + test, + ); +} + +/// See also [$DynamicClassFamily]. +@ProviderFor($DynamicClassFamily) +const $dynamicClassFamilyProvider = $DynamicClassFamilyFamily(); + +/// See also [$DynamicClassFamily]. +class $DynamicClassFamilyFamily extends Family { + /// See also [$DynamicClassFamily]. + const $DynamicClassFamilyFamily(); + + /// See also [$DynamicClassFamily]. + $DynamicClassFamilyProvider call( + test, + ) { + return $DynamicClassFamilyProvider( + test, + ); + } + + @override + $DynamicClassFamilyProvider getProviderOverride( + covariant $DynamicClassFamilyProvider provider, + ) { + return call( + provider.test, + ); + } + + static const Iterable? _dependencies = null; + + @override + Iterable? get dependencies => _dependencies; + + static const Iterable? _allTransitiveDependencies = null; + + @override + Iterable? get allTransitiveDependencies => + _allTransitiveDependencies; + + @override + String? get name => r'$dynamicClassFamilyProvider'; +} + +/// See also [$DynamicClassFamily]. +class $DynamicClassFamilyProvider + extends AutoDisposeNotifierProviderImpl<$DynamicClassFamily, Object?> { + /// See also [$DynamicClassFamily]. + $DynamicClassFamilyProvider( + test, + ) : this._internal( + () => $DynamicClassFamily()..test = test, + from: $dynamicClassFamilyProvider, + name: r'$dynamicClassFamilyProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$$dynamicClassFamilyHash, + dependencies: $DynamicClassFamilyFamily._dependencies, + allTransitiveDependencies: + $DynamicClassFamilyFamily._allTransitiveDependencies, + test: test, + ); + + $DynamicClassFamilyProvider._internal( + super._createNotifier, { + required super.name, + required super.dependencies, + required super.allTransitiveDependencies, + required super.debugGetCreateSourceHash, + required super.from, + required this.test, + }) : super.internal(); + + final test; + + @override + Object? runNotifierBuild( + covariant $DynamicClassFamily notifier, + ) { + return notifier.build( + test, + ); + } + + @override + Override overrideWith($DynamicClassFamily Function() create) { + return ProviderOverride( + origin: this, + override: $DynamicClassFamilyProvider._internal( + () => create()..test = test, + from: from, + name: null, + dependencies: null, + allTransitiveDependencies: null, + debugGetCreateSourceHash: null, + test: test, + ), + ); + } + + @override + AutoDisposeNotifierProviderElement<$DynamicClassFamily, Object?> + createElement() { + return _$DynamicClassFamilyProviderElement(this); + } + + @override + bool operator ==(Object other) { + return other is $DynamicClassFamilyProvider && other.test == test; + } + + @override + int get hashCode { + var hash = _SystemHash.combine(0, runtimeType.hashCode); + hash = _SystemHash.combine(hash, test.hashCode); + + return _SystemHash.finish(hash); + } +} + +mixin $DynamicClassFamilyRef on AutoDisposeNotifierProviderRef { + /// The parameter `test` of this provider. + get test; +} + +class _$DynamicClassFamilyProviderElement + extends AutoDisposeNotifierProviderElement<$DynamicClassFamily, Object?> + with $DynamicClassFamilyRef { + _$DynamicClassFamilyProviderElement(super.provider); + + @override + get test => (origin as $DynamicClassFamilyProvider).test; +} + +String _$aliasClassHash() => r'a6c6d7594ebd09ba728e42d79b12af560d09c379'; + +/// See also [AliasClass]. +@ProviderFor(AliasClass) +final aliasClassProvider = + AutoDisposeNotifierProvider>.internal( + AliasClass.new, + name: r'aliasClassProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') ? null : _$aliasClassHash, + dependencies: null, + allTransitiveDependencies: null, +); + +typedef _$AliasClass = AutoDisposeNotifier>; +String _$aliasClassFamilyHash() => r'3f348beb95dae3a9890b4a4d0ce01481316fc66d'; + +abstract class _$AliasClassFamily + extends BuildlessAutoDisposeNotifier> { + late final r.AsyncValue test; + + r.AsyncValue build( + r.AsyncValue test, + ); +} + +/// See also [AliasClassFamily]. +@ProviderFor(AliasClassFamily) +const aliasClassFamilyProvider = AliasClassFamilyFamily(); + +/// See also [AliasClassFamily]. +class AliasClassFamilyFamily extends Family> { + /// See also [AliasClassFamily]. + const AliasClassFamilyFamily(); + + /// See also [AliasClassFamily]. + AliasClassFamilyProvider call( + r.AsyncValue test, + ) { + return AliasClassFamilyProvider( + test, + ); + } + + @override + AliasClassFamilyProvider getProviderOverride( + covariant AliasClassFamilyProvider provider, + ) { + return call( + provider.test, + ); + } + + static const Iterable? _dependencies = null; + + @override + Iterable? get dependencies => _dependencies; + + static const Iterable? _allTransitiveDependencies = null; + + @override + Iterable? get allTransitiveDependencies => + _allTransitiveDependencies; + + @override + String? get name => r'aliasClassFamilyProvider'; +} + +/// See also [AliasClassFamily]. +class AliasClassFamilyProvider extends AutoDisposeNotifierProviderImpl< + AliasClassFamily, r.AsyncValue> { + /// See also [AliasClassFamily]. + AliasClassFamilyProvider( + r.AsyncValue test, + ) : this._internal( + () => AliasClassFamily()..test = test, + from: aliasClassFamilyProvider, + name: r'aliasClassFamilyProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$aliasClassFamilyHash, + dependencies: AliasClassFamilyFamily._dependencies, + allTransitiveDependencies: + AliasClassFamilyFamily._allTransitiveDependencies, + test: test, + ); + + AliasClassFamilyProvider._internal( + super._createNotifier, { + required super.name, + required super.dependencies, + required super.allTransitiveDependencies, + required super.debugGetCreateSourceHash, + required super.from, + required this.test, + }) : super.internal(); + + final r.AsyncValue test; + + @override + r.AsyncValue runNotifierBuild( + covariant AliasClassFamily notifier, + ) { + return notifier.build( + test, + ); + } + + @override + Override overrideWith(AliasClassFamily Function() create) { + return ProviderOverride( + origin: this, + override: AliasClassFamilyProvider._internal( + () => create()..test = test, + from: from, + name: null, + dependencies: null, + allTransitiveDependencies: null, + debugGetCreateSourceHash: null, + test: test, + ), + ); + } + + @override + AutoDisposeNotifierProviderElement> + createElement() { + return _AliasClassFamilyProviderElement(this); + } + + @override + bool operator ==(Object other) { + return other is AliasClassFamilyProvider && other.test == test; + } + + @override + int get hashCode { + var hash = _SystemHash.combine(0, runtimeType.hashCode); + hash = _SystemHash.combine(hash, test.hashCode); + + return _SystemHash.finish(hash); + } +} + +mixin AliasClassFamilyRef on AutoDisposeNotifierProviderRef> { + /// The parameter `test` of this provider. + r.AsyncValue get test; +} + +class _AliasClassFamilyProviderElement + extends AutoDisposeNotifierProviderElement> with AliasClassFamilyRef { + _AliasClassFamilyProviderElement(super.provider); + + @override + r.AsyncValue get test => (origin as AliasClassFamilyProvider).test; +} +// ignore_for_file: type=lint +// 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 diff --git a/packages/riverpod_generator/test/integration/hash/hash1.g.dart b/packages/riverpod_generator/test/integration/hash/hash1.g.dart index 8fd887b16..b58198086 100644 --- a/packages/riverpod_generator/test/integration/hash/hash1.g.dart +++ b/packages/riverpod_generator/test/integration/hash/hash1.g.dart @@ -50,4 +50,4 @@ final simpleClassProvider = typedef _$SimpleClass = AutoDisposeNotifier; // 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 diff --git a/packages/riverpod_generator/test/integration/scopes.g.dart b/packages/riverpod_generator/test/integration/scopes.g.dart index eb436b0d5..66bf93a38 100644 --- a/packages/riverpod_generator/test/integration/scopes.g.dart +++ b/packages/riverpod_generator/test/integration/scopes.g.dart @@ -24,4 +24,4 @@ final scopedProvider = AutoDisposeProvider.internal( typedef ScopedRef = AutoDisposeProviderRef; // 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 diff --git a/packages/riverpod_generator/test/integration/split.g.dart b/packages/riverpod_generator/test/integration/split.g.dart index 40f69d5b7..4adb6cc1d 100644 --- a/packages/riverpod_generator/test/integration/split.g.dart +++ b/packages/riverpod_generator/test/integration/split.g.dart @@ -35,4 +35,4 @@ final counterProvider = AutoDisposeProvider.internal( typedef CounterRef = AutoDisposeProviderRef; // 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 diff --git a/packages/riverpod_generator/test/integration/stream.g.dart b/packages/riverpod_generator/test/integration/stream.g.dart index 27b82c013..e198b666f 100644 --- a/packages/riverpod_generator/test/integration/stream.g.dart +++ b/packages/riverpod_generator/test/integration/stream.g.dart @@ -504,4 +504,4 @@ class _FamilyClassProviderElement List? get fifth => (origin as FamilyClassProvider).fifth; } // 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 diff --git a/packages/riverpod_generator/test/integration/sync.g.dart b/packages/riverpod_generator/test/integration/sync.g.dart index 6df7f672e..e17272d9d 100644 --- a/packages/riverpod_generator/test/integration/sync.g.dart +++ b/packages/riverpod_generator/test/integration/sync.g.dart @@ -10,7 +10,7 @@ String _$rawFutureHash() => r'5203a56065b768023770326281618e3229ccb530'; /// See also [rawFuture]. @ProviderFor(rawFuture) -final rawFutureProvider = AutoDisposeProvider>.internal( +final rawFutureProvider = AutoDisposeProvider>>.internal( rawFuture, name: r'rawFutureProvider', debugGetCreateSourceHash: @@ -19,12 +19,12 @@ final rawFutureProvider = AutoDisposeProvider>.internal( allTransitiveDependencies: null, ); -typedef RawFutureRef = AutoDisposeProviderRef>; +typedef RawFutureRef = AutoDisposeProviderRef>>; String _$rawStreamHash() => r'2b764189753a8b74f47ba557a79416f00ef5cebd'; /// See also [rawStream]. @ProviderFor(rawStream) -final rawStreamProvider = AutoDisposeProvider>.internal( +final rawStreamProvider = AutoDisposeProvider>>.internal( rawStream, name: r'rawStreamProvider', debugGetCreateSourceHash: @@ -33,7 +33,7 @@ final rawStreamProvider = AutoDisposeProvider>.internal( allTransitiveDependencies: null, ); -typedef RawStreamRef = AutoDisposeProviderRef>; +typedef RawStreamRef = AutoDisposeProviderRef>>; String _$rawFamilyFutureHash() => r'485f59512081852e51279658facc015309743864'; /// Copied from Dart SDK @@ -62,7 +62,7 @@ class _SystemHash { const rawFamilyFutureProvider = RawFamilyFutureFamily(); /// See also [rawFamilyFuture]. -class RawFamilyFutureFamily extends Family> { +class RawFamilyFutureFamily extends Family>> { /// See also [rawFamilyFuture]. const RawFamilyFutureFamily(); @@ -100,7 +100,7 @@ class RawFamilyFutureFamily extends Family> { } /// See also [rawFamilyFuture]. -class RawFamilyFutureProvider extends AutoDisposeProvider> { +class RawFamilyFutureProvider extends AutoDisposeProvider>> { /// See also [rawFamilyFuture]. RawFamilyFutureProvider( int id, @@ -135,7 +135,7 @@ class RawFamilyFutureProvider extends AutoDisposeProvider> { @override Override overrideWith( - Future Function(RawFamilyFutureRef provider) create, + Raw> Function(RawFamilyFutureRef provider) create, ) { return ProviderOverride( origin: this, @@ -152,7 +152,7 @@ class RawFamilyFutureProvider extends AutoDisposeProvider> { } @override - AutoDisposeProviderElement> createElement() { + AutoDisposeProviderElement>> createElement() { return _RawFamilyFutureProviderElement(this); } @@ -170,13 +170,14 @@ class RawFamilyFutureProvider extends AutoDisposeProvider> { } } -mixin RawFamilyFutureRef on AutoDisposeProviderRef> { +mixin RawFamilyFutureRef on AutoDisposeProviderRef>> { /// The parameter `id` of this provider. int get id; } class _RawFamilyFutureProviderElement - extends AutoDisposeProviderElement> with RawFamilyFutureRef { + extends AutoDisposeProviderElement>> + with RawFamilyFutureRef { _RawFamilyFutureProviderElement(super.provider); @override @@ -190,7 +191,7 @@ String _$rawFamilyStreamHash() => r'e778e5cfcb8ab381e2412f5c73213aaa03b93012'; const rawFamilyStreamProvider = RawFamilyStreamFamily(); /// See also [rawFamilyStream]. -class RawFamilyStreamFamily extends Family> { +class RawFamilyStreamFamily extends Family>> { /// See also [rawFamilyStream]. const RawFamilyStreamFamily(); @@ -228,7 +229,7 @@ class RawFamilyStreamFamily extends Family> { } /// See also [rawFamilyStream]. -class RawFamilyStreamProvider extends AutoDisposeProvider> { +class RawFamilyStreamProvider extends AutoDisposeProvider>> { /// See also [rawFamilyStream]. RawFamilyStreamProvider( int id, @@ -263,7 +264,7 @@ class RawFamilyStreamProvider extends AutoDisposeProvider> { @override Override overrideWith( - Stream Function(RawFamilyStreamRef provider) create, + Raw> Function(RawFamilyStreamRef provider) create, ) { return ProviderOverride( origin: this, @@ -280,7 +281,7 @@ class RawFamilyStreamProvider extends AutoDisposeProvider> { } @override - AutoDisposeProviderElement> createElement() { + AutoDisposeProviderElement>> createElement() { return _RawFamilyStreamProviderElement(this); } @@ -298,13 +299,14 @@ class RawFamilyStreamProvider extends AutoDisposeProvider> { } } -mixin RawFamilyStreamRef on AutoDisposeProviderRef> { +mixin RawFamilyStreamRef on AutoDisposeProviderRef>> { /// The parameter `id` of this provider. int get id; } class _RawFamilyStreamProviderElement - extends AutoDisposeProviderElement> with RawFamilyStreamRef { + extends AutoDisposeProviderElement>> + with RawFamilyStreamRef { _RawFamilyStreamProviderElement(super.provider); @override @@ -579,7 +581,7 @@ String _$rawFutureClassHash() => r'bf66f1cdbd99118b8845d206e6a2611b3101f45c'; /// See also [RawFutureClass]. @ProviderFor(RawFutureClass) final rawFutureClassProvider = - AutoDisposeNotifierProvider>.internal( + AutoDisposeNotifierProvider>>.internal( RawFutureClass.new, name: r'rawFutureClassProvider', debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') @@ -589,13 +591,13 @@ final rawFutureClassProvider = allTransitiveDependencies: null, ); -typedef _$RawFutureClass = AutoDisposeNotifier>; +typedef _$RawFutureClass = AutoDisposeNotifier>>; String _$rawStreamClassHash() => r'712cffcb2018cfb4ff45012c1aa6e43c8cbe9d5d'; /// See also [RawStreamClass]. @ProviderFor(RawStreamClass) final rawStreamClassProvider = - AutoDisposeNotifierProvider>.internal( + AutoDisposeNotifierProvider>>.internal( RawStreamClass.new, name: r'rawStreamClassProvider', debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') @@ -605,15 +607,15 @@ final rawStreamClassProvider = allTransitiveDependencies: null, ); -typedef _$RawStreamClass = AutoDisposeNotifier>; +typedef _$RawStreamClass = AutoDisposeNotifier>>; String _$rawFamilyFutureClassHash() => r'd7cacb0f2c51697d107de6daa68b242c04085dca'; abstract class _$RawFamilyFutureClass - extends BuildlessAutoDisposeNotifier> { + extends BuildlessAutoDisposeNotifier>> { late final int id; - Future build( + Raw> build( int id, ); } @@ -623,7 +625,7 @@ abstract class _$RawFamilyFutureClass const rawFamilyFutureClassProvider = RawFamilyFutureClassFamily(); /// See also [RawFamilyFutureClass]. -class RawFamilyFutureClassFamily extends Family> { +class RawFamilyFutureClassFamily extends Family>> { /// See also [RawFamilyFutureClass]. const RawFamilyFutureClassFamily(); @@ -662,7 +664,7 @@ class RawFamilyFutureClassFamily extends Family> { /// See also [RawFamilyFutureClass]. class RawFamilyFutureClassProvider extends AutoDisposeNotifierProviderImpl< - RawFamilyFutureClass, Future> { + RawFamilyFutureClass, Raw>> { /// See also [RawFamilyFutureClass]. RawFamilyFutureClassProvider( int id, @@ -693,7 +695,7 @@ class RawFamilyFutureClassProvider extends AutoDisposeNotifierProviderImpl< final int id; @override - Future runNotifierBuild( + Raw> runNotifierBuild( covariant RawFamilyFutureClass notifier, ) { return notifier.build( @@ -718,7 +720,7 @@ class RawFamilyFutureClassProvider extends AutoDisposeNotifierProviderImpl< } @override - AutoDisposeNotifierProviderElement> + AutoDisposeNotifierProviderElement>> createElement() { return _RawFamilyFutureClassProviderElement(this); } @@ -738,14 +740,14 @@ class RawFamilyFutureClassProvider extends AutoDisposeNotifierProviderImpl< } mixin RawFamilyFutureClassRef - on AutoDisposeNotifierProviderRef> { + on AutoDisposeNotifierProviderRef>> { /// The parameter `id` of this provider. int get id; } class _RawFamilyFutureClassProviderElement extends AutoDisposeNotifierProviderElement> with RawFamilyFutureClassRef { + Raw>> with RawFamilyFutureClassRef { _RawFamilyFutureClassProviderElement(super.provider); @override @@ -756,10 +758,10 @@ String _$rawFamilyStreamClassHash() => r'321796a0befc43fb83f7ccfdcb6b011fc8c7c599'; abstract class _$RawFamilyStreamClass - extends BuildlessAutoDisposeNotifier> { + extends BuildlessAutoDisposeNotifier>> { late final int id; - Stream build( + Raw> build( int id, ); } @@ -769,7 +771,7 @@ abstract class _$RawFamilyStreamClass const rawFamilyStreamClassProvider = RawFamilyStreamClassFamily(); /// See also [RawFamilyStreamClass]. -class RawFamilyStreamClassFamily extends Family> { +class RawFamilyStreamClassFamily extends Family>> { /// See also [RawFamilyStreamClass]. const RawFamilyStreamClassFamily(); @@ -808,7 +810,7 @@ class RawFamilyStreamClassFamily extends Family> { /// See also [RawFamilyStreamClass]. class RawFamilyStreamClassProvider extends AutoDisposeNotifierProviderImpl< - RawFamilyStreamClass, Stream> { + RawFamilyStreamClass, Raw>> { /// See also [RawFamilyStreamClass]. RawFamilyStreamClassProvider( int id, @@ -839,7 +841,7 @@ class RawFamilyStreamClassProvider extends AutoDisposeNotifierProviderImpl< final int id; @override - Stream runNotifierBuild( + Raw> runNotifierBuild( covariant RawFamilyStreamClass notifier, ) { return notifier.build( @@ -864,7 +866,7 @@ class RawFamilyStreamClassProvider extends AutoDisposeNotifierProviderImpl< } @override - AutoDisposeNotifierProviderElement> + AutoDisposeNotifierProviderElement>> createElement() { return _RawFamilyStreamClassProviderElement(this); } @@ -884,14 +886,14 @@ class RawFamilyStreamClassProvider extends AutoDisposeNotifierProviderImpl< } mixin RawFamilyStreamClassRef - on AutoDisposeNotifierProviderRef> { + on AutoDisposeNotifierProviderRef>> { /// The parameter `id` of this provider. int get id; } class _RawFamilyStreamClassProviderElement extends AutoDisposeNotifierProviderElement> with RawFamilyStreamClassRef { + Raw>> with RawFamilyStreamClassRef { _RawFamilyStreamClassProviderElement(super.provider); @override @@ -1185,4 +1187,4 @@ final supports$InClassNameProvider = typedef _$Supports$InClassName = AutoDisposeNotifier; // 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 diff --git a/packages/riverpod_graph/test/integration/generated/golden/lib/sync.g.dart b/packages/riverpod_graph/test/integration/generated/golden/lib/sync.g.dart index 6a22a5e6d..905333469 100644 --- a/packages/riverpod_graph/test/integration/generated/golden/lib/sync.g.dart +++ b/packages/riverpod_graph/test/integration/generated/golden/lib/sync.g.dart @@ -567,4 +567,4 @@ final supports$InClassNameProvider = typedef _$Supports$InClassName = AutoDisposeNotifier; // 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 diff --git a/packages/riverpod_graph/test/integration/generated/golden/pubspec.yaml b/packages/riverpod_graph/test/integration/generated/golden/pubspec.yaml index 5f80267d0..6069dd9f2 100644 --- a/packages/riverpod_graph/test/integration/generated/golden/pubspec.yaml +++ b/packages/riverpod_graph/test/integration/generated/golden/pubspec.yaml @@ -20,7 +20,6 @@ dependencies: dev_dependencies: build_runner: ^2.2.0 - build_verify: ^3.0.0 flutter_test: sdk: flutter riverpod_generator: diff --git a/packages/riverpod_graph/test/integration/generated/golden/test/ensuire_build_test.dart b/packages/riverpod_graph/test/integration/generated/golden/test/ensuire_build_test.dart deleted file mode 100644 index d08ca1a38..000000000 --- a/packages/riverpod_graph/test/integration/generated/golden/test/ensuire_build_test.dart +++ /dev/null @@ -1,11 +0,0 @@ -import 'package:build_verify/build_verify.dart'; -import 'package:flutter_test/flutter_test.dart'; - -void main() { - test('ensure_build', () { - expectBuildClean( - packageRelativeDirectory: - 'packages/riverpod_graph/test/integration/generated/golden', - ); - }); -} diff --git a/packages/riverpod_lint/lib/src/lints/unsupported_provider_value.dart b/packages/riverpod_lint/lib/src/lints/unsupported_provider_value.dart index 70cc1bc3a..f4bdec2f7 100644 --- a/packages/riverpod_lint/lib/src/lints/unsupported_provider_value.dart +++ b/packages/riverpod_lint/lib/src/lints/unsupported_provider_value.dart @@ -8,7 +8,7 @@ extension on ClassBasedProviderDeclaration { /// Returns whether the value exposed by the provider is the newly created /// Notifier itself. bool get returnsSelf { - return valueType == node.declaredElement?.thisType; + return valueTypeNode?.type == node.declaredElement?.thisType; } } @@ -31,15 +31,13 @@ class UnsupportedProviderValue extends RiverpodLintRule { CustomLintContext context, ) { void checkCreatedType(GeneratorProviderDeclaration declaration) { - if (declaration.valueType.isRaw) { - return; - } + final valueType = declaration.valueTypeNode?.type; + if (valueType == null || valueType.isRaw) return; String? invalidValueName; - if (notifierBaseType.isAssignableFromType(declaration.valueType)) { + if (notifierBaseType.isAssignableFromType(valueType)) { invalidValueName = 'Notifier'; - } else if (asyncNotifierBaseType - .isAssignableFromType(declaration.valueType)) { + } else if (asyncNotifierBaseType.isAssignableFromType(valueType)) { invalidValueName = 'AsyncNotifier'; } @@ -51,10 +49,9 @@ class UnsupportedProviderValue extends RiverpodLintRule { return; } - if (stateNotifierType.isAssignableFromType(declaration.valueType)) { + if (stateNotifierType.isAssignableFromType(valueType)) { invalidValueName = 'StateNotifier'; - } else if (changeNotifierType - .isAssignableFromType(declaration.valueType)) { + } else if (changeNotifierType.isAssignableFromType(valueType)) { invalidValueName = 'ChangeNotifier'; } diff --git a/packages/riverpod_lint/pubspec.yaml b/packages/riverpod_lint/pubspec.yaml index decce4749..6d4fa3d6e 100644 --- a/packages/riverpod_lint/pubspec.yaml +++ b/packages/riverpod_lint/pubspec.yaml @@ -11,7 +11,7 @@ environment: sdk: ">=2.17.0 <3.0.0" dependencies: - analyzer: ">=5.12.0 <7.0.0" + analyzer: ">=6.0.0 <7.0.0" analyzer_plugin: ^0.11.2 collection: ^1.16.0 custom_lint_builder: ^0.5.2 diff --git a/packages/riverpod_lint_flutter_test/pubspec.yaml b/packages/riverpod_lint_flutter_test/pubspec.yaml index 33a3e7dc2..8140f9b6b 100644 --- a/packages/riverpod_lint_flutter_test/pubspec.yaml +++ b/packages/riverpod_lint_flutter_test/pubspec.yaml @@ -15,15 +15,13 @@ dependencies: dev_dependencies: build_runner: ^2.4.6 - build_verify: ^3.0.0 custom_lint: ^0.5.2 - flutter_test: - sdk: flutter freezed: ^2.3.2 json_serializable: ^6.6.1 riverpod_lint: path: ../riverpod_lint riverpod_generator: ^2.0.0 + test: ^1.15.0 dependency_overrides: riverpod_generator: diff --git a/packages/riverpod_lint_flutter_test/test/assists/convert_class_based_provider_to_functional/convert_class_based_provider_to_functional.g.dart b/packages/riverpod_lint_flutter_test/test/assists/convert_class_based_provider_to_functional/convert_class_based_provider_to_functional.g.dart index 801c4ebe0..efb028f60 100644 --- a/packages/riverpod_lint_flutter_test/test/assists/convert_class_based_provider_to_functional/convert_class_based_provider_to_functional.g.dart +++ b/packages/riverpod_lint_flutter_test/test/assists/convert_class_based_provider_to_functional/convert_class_based_provider_to_functional.g.dart @@ -218,4 +218,4 @@ class _ExampleFamilyProviderElement String get b => (origin as ExampleFamilyProvider).b; } // 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 diff --git a/packages/riverpod_lint_flutter_test/test/assists/convert_functional_provider_to_class_based/convert_functional_provider_to_class_based.g.dart b/packages/riverpod_lint_flutter_test/test/assists/convert_functional_provider_to_class_based/convert_functional_provider_to_class_based.g.dart index 32014e572..ddd8f825f 100644 --- a/packages/riverpod_lint_flutter_test/test/assists/convert_functional_provider_to_class_based/convert_functional_provider_to_class_based.g.dart +++ b/packages/riverpod_lint_flutter_test/test/assists/convert_functional_provider_to_class_based/convert_functional_provider_to_class_based.g.dart @@ -198,4 +198,4 @@ class _ExampleFamilyProviderElement extends AutoDisposeProviderElement String get b => (origin as ExampleFamilyProvider).b; } // 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 diff --git a/packages/riverpod_lint_flutter_test/test/ensuire_build_test.dart b/packages/riverpod_lint_flutter_test/test/ensuire_build_test.dart deleted file mode 100644 index 7600dca8a..000000000 --- a/packages/riverpod_lint_flutter_test/test/ensuire_build_test.dart +++ /dev/null @@ -1,10 +0,0 @@ -import 'package:build_verify/build_verify.dart'; -import 'package:test/test.dart'; - -void main() { - test('ensure_build', () { - expectBuildClean( - packageRelativeDirectory: 'packages/riverpod_lint_flutter_test', - ); - }); -} diff --git a/packages/riverpod_lint_flutter_test/test/lints/avoid_build_context_in_providers.g.dart b/packages/riverpod_lint_flutter_test/test/lints/avoid_build_context_in_providers.g.dart index 3b4658b59..405da9b98 100644 --- a/packages/riverpod_lint_flutter_test/test/lints/avoid_build_context_in_providers.g.dart +++ b/packages/riverpod_lint_flutter_test/test/lints/avoid_build_context_in_providers.g.dart @@ -333,4 +333,4 @@ class _MyNotifierProviderElement BuildContext get context2 => (origin as MyNotifierProvider).context2; } // 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 diff --git a/packages/riverpod_lint_flutter_test/test/lints/dependencies.g.dart b/packages/riverpod_lint_flutter_test/test/lints/dependencies.g.dart index a30c4f2cf..bdca0999b 100644 --- a/packages/riverpod_lint_flutter_test/test/lints/dependencies.g.dart +++ b/packages/riverpod_lint_flutter_test/test/lints/dependencies.g.dart @@ -730,4 +730,4 @@ final regression2417Provider = typedef _$Regression2417 = AutoDisposeNotifier; // 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 diff --git a/packages/riverpod_lint_flutter_test/test/lints/functional_ref.g.dart b/packages/riverpod_lint_flutter_test/test/lints/functional_ref.g.dart index ea777e89e..4d1cd3b71 100644 --- a/packages/riverpod_lint_flutter_test/test/lints/functional_ref.g.dart +++ b/packages/riverpod_lint_flutter_test/test/lints/functional_ref.g.dart @@ -67,4 +67,4 @@ final scopedProvider = AutoDisposeProvider.internal( typedef ScopedRef = AutoDisposeProviderRef; // 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 diff --git a/packages/riverpod_lint_flutter_test/test/lints/notifier_extends/notifier_extends.g.dart b/packages/riverpod_lint_flutter_test/test/lints/notifier_extends/notifier_extends.g.dart index 81d40ef69..d3e24dc06 100644 --- a/packages/riverpod_lint_flutter_test/test/lints/notifier_extends/notifier_extends.g.dart +++ b/packages/riverpod_lint_flutter_test/test/lints/notifier_extends/notifier_extends.g.dart @@ -66,4 +66,4 @@ final _privateClassProvider = typedef _$PrivateClass = AutoDisposeNotifier; // 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 diff --git a/packages/riverpod_lint_flutter_test/test/lints/provider_dependencies/provider_dependencies.g.dart b/packages/riverpod_lint_flutter_test/test/lints/provider_dependencies/provider_dependencies.g.dart index ec5ac67d9..fa69314a0 100644 --- a/packages/riverpod_lint_flutter_test/test/lints/provider_dependencies/provider_dependencies.g.dart +++ b/packages/riverpod_lint_flutter_test/test/lints/provider_dependencies/provider_dependencies.g.dart @@ -202,4 +202,4 @@ final noDepWithoutCommaProvider = AutoDisposeProvider.internal( typedef NoDepWithoutCommaRef = AutoDisposeProviderRef; // 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 diff --git a/packages/riverpod_lint_flutter_test/test/lints/provider_parameters.g.dart b/packages/riverpod_lint_flutter_test/test/lints/provider_parameters.g.dart index 3bf28cc5a..ede96a7c8 100644 --- a/packages/riverpod_lint_flutter_test/test/lints/provider_parameters.g.dart +++ b/packages/riverpod_lint_flutter_test/test/lints/provider_parameters.g.dart @@ -153,4 +153,4 @@ class _GeneratorProviderElement extends ProviderElement with GeneratorRef { Object? get value => (origin as GeneratorProvider).value; } // 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 diff --git a/packages/riverpod_lint_flutter_test/test/lints/scoped_providers_should_specify_dependencies.g.dart b/packages/riverpod_lint_flutter_test/test/lints/scoped_providers_should_specify_dependencies.g.dart index cd6fd4b52..4427befd2 100644 --- a/packages/riverpod_lint_flutter_test/test/lints/scoped_providers_should_specify_dependencies.g.dart +++ b/packages/riverpod_lint_flutter_test/test/lints/scoped_providers_should_specify_dependencies.g.dart @@ -54,4 +54,4 @@ final rootProvider = AutoDisposeProvider.internal( typedef RootRef = AutoDisposeProviderRef; // 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 diff --git a/packages/riverpod_lint_flutter_test/test/lints/unsupported_provider_value.g.dart b/packages/riverpod_lint_flutter_test/test/lints/unsupported_provider_value.g.dart index 39429dd9f..39c1da5f9 100644 --- a/packages/riverpod_lint_flutter_test/test/lints/unsupported_provider_value.g.dart +++ b/packages/riverpod_lint_flutter_test/test/lints/unsupported_provider_value.g.dart @@ -134,7 +134,7 @@ String _$rawNotifierHash() => r'c01adc70a8e08258bf5d13024aa8e9b86359a2b2'; /// See also [rawNotifier]. @ProviderFor(rawNotifier) -final rawNotifierProvider = AutoDisposeProvider.internal( +final rawNotifierProvider = AutoDisposeProvider>.internal( rawNotifier, name: r'rawNotifierProvider', debugGetCreateSourceHash: @@ -143,13 +143,13 @@ final rawNotifierProvider = AutoDisposeProvider.internal( allTransitiveDependencies: null, ); -typedef RawNotifierRef = AutoDisposeProviderRef; +typedef RawNotifierRef = AutoDisposeProviderRef>; String _$rawFutureNotifierHash() => r'883253dbf7ade868c44b288ec3da02be64dcfb20'; /// See also [rawFutureNotifier]. @ProviderFor(rawFutureNotifier) final rawFutureNotifierProvider = - AutoDisposeProvider>.internal( + AutoDisposeProvider>>.internal( rawFutureNotifier, name: r'rawFutureNotifierProvider', debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') @@ -159,13 +159,14 @@ final rawFutureNotifierProvider = allTransitiveDependencies: null, ); -typedef RawFutureNotifierRef = AutoDisposeProviderRef>; +typedef RawFutureNotifierRef + = AutoDisposeProviderRef>>; String _$rawStreamNotifierHash() => r'f22f6a906e275c6245365bf029e2dc217cf3a301'; /// See also [rawStreamNotifier]. @ProviderFor(rawStreamNotifier) final rawStreamNotifierProvider = - AutoDisposeProvider>.internal( + AutoDisposeProvider>>.internal( rawStreamNotifier, name: r'rawStreamNotifierProvider', debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') @@ -175,13 +176,14 @@ final rawStreamNotifierProvider = allTransitiveDependencies: null, ); -typedef RawStreamNotifierRef = AutoDisposeProviderRef>; +typedef RawStreamNotifierRef + = AutoDisposeProviderRef>>; String _$futureRawNotifierHash() => r'd70ca757ff2539fc698ff924c135ee5e88a98018'; /// See also [futureRawNotifier]. @ProviderFor(futureRawNotifier) final futureRawNotifierProvider = - AutoDisposeFutureProvider.internal( + AutoDisposeFutureProvider>.internal( futureRawNotifier, name: r'futureRawNotifierProvider', debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') @@ -191,13 +193,14 @@ final futureRawNotifierProvider = allTransitiveDependencies: null, ); -typedef FutureRawNotifierRef = AutoDisposeFutureProviderRef; +typedef FutureRawNotifierRef + = AutoDisposeFutureProviderRef>; String _$streamRawNotifierHash() => r'b1075c37ef3e8a83dfb9a3d469b76bd4855c336f'; /// See also [streamRawNotifier]. @ProviderFor(streamRawNotifier) final streamRawNotifierProvider = - AutoDisposeStreamProvider.internal( + AutoDisposeStreamProvider>.internal( streamRawNotifier, name: r'streamRawNotifierProvider', debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') @@ -207,7 +210,8 @@ final streamRawNotifierProvider = allTransitiveDependencies: null, ); -typedef StreamRawNotifierRef = AutoDisposeStreamProviderRef; +typedef StreamRawNotifierRef + = AutoDisposeStreamProviderRef>; String _$stateNotifierClassHash() => r'576978be5b8a02c212afe7afbe37c733a49ecbce'; @@ -341,4 +345,4 @@ final asyncNotifierClassProvider = typedef _$AsyncNotifierClass = AutoDisposeNotifier; // 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 diff --git a/website/docs/concepts/provider_observer_logger.dart b/website/docs/concepts/provider_observer_logger.dart index d7903659e..40f8120e6 100644 --- a/website/docs/concepts/provider_observer_logger.dart +++ b/website/docs/concepts/provider_observer_logger.dart @@ -32,7 +32,7 @@ void main() { } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { diff --git a/website/docs/concepts/reading_consumer_hook.dart b/website/docs/concepts/reading_consumer_hook.dart index f7f36b8be..6dfd4b024 100644 --- a/website/docs/concepts/reading_consumer_hook.dart +++ b/website/docs/concepts/reading_consumer_hook.dart @@ -7,7 +7,7 @@ import 'reading_counter.dart'; class HomeView extends HookConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/docs/concepts/reading_consumer_hook_widget.dart b/website/docs/concepts/reading_consumer_hook_widget.dart index f0f7aaa30..eb3716806 100644 --- a/website/docs/concepts/reading_consumer_hook_widget.dart +++ b/website/docs/concepts/reading_consumer_hook_widget.dart @@ -8,7 +8,7 @@ import 'reading_counter.dart'; /* SNIPPET START */ class HomeView extends HookConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/docs/concepts/reading_consumer_stateful_widget.dart b/website/docs/concepts/reading_consumer_stateful_widget.dart index 0773296a3..5fef555b9 100644 --- a/website/docs/concepts/reading_consumer_stateful_widget.dart +++ b/website/docs/concepts/reading_consumer_stateful_widget.dart @@ -5,7 +5,7 @@ import 'reading_counter.dart'; /* SNIPPET START */ class HomeView extends ConsumerStatefulWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override HomeViewState createState() => HomeViewState(); diff --git a/website/docs/concepts/reading_consumer_widget.dart b/website/docs/concepts/reading_consumer_widget.dart index 568e004f4..18b851e55 100644 --- a/website/docs/concepts/reading_consumer_widget.dart +++ b/website/docs/concepts/reading_consumer_widget.dart @@ -5,7 +5,7 @@ import 'reading_counter.dart'; /* SNIPPET START */ class HomeView extends ConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/docs/concepts/reading_listen.dart b/website/docs/concepts/reading_listen.dart index 37121f87c..4ed90e7af 100644 --- a/website/docs/concepts/reading_listen.dart +++ b/website/docs/concepts/reading_listen.dart @@ -5,7 +5,7 @@ import 'reading_counter.dart'; /* SNIPPET START */ -final counterProvider = StateNotifierProvider((ref) => Counter(ref)); +final counterProvider = StateNotifierProvider(Counter.new); final anotherProvider = Provider((ref) { ref.listen(counterProvider, (int? previousCount, int newCount) { diff --git a/website/docs/concepts/reading_listen_build.dart b/website/docs/concepts/reading_listen_build.dart index 2449c763e..066565b67 100644 --- a/website/docs/concepts/reading_listen_build.dart +++ b/website/docs/concepts/reading_listen_build.dart @@ -6,10 +6,10 @@ import 'reading_counter.dart'; /* SNIPPET START */ -final counterProvider = StateNotifierProvider((ref) => Counter(ref)); +final counterProvider = StateNotifierProvider(Counter.new); class HomeView extends ConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/docs/concepts/reading_read.dart b/website/docs/concepts/reading_read.dart index 553c137f3..daf2e5f0f 100644 --- a/website/docs/concepts/reading_read.dart +++ b/website/docs/concepts/reading_read.dart @@ -7,10 +7,10 @@ import 'reading_counter.dart'; /* SNIPPET START */ -final counterProvider = StateNotifierProvider((ref) => Counter(ref)); +final counterProvider = StateNotifierProvider(Counter.new); class HomeView extends ConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/docs/concepts/reading_stateful_hook_consumer_widget.dart b/website/docs/concepts/reading_stateful_hook_consumer_widget.dart index d1a79e64e..d47189e61 100644 --- a/website/docs/concepts/reading_stateful_hook_consumer_widget.dart +++ b/website/docs/concepts/reading_stateful_hook_consumer_widget.dart @@ -8,7 +8,7 @@ import 'reading_counter.dart'; /* SNIPPET START */ class HomeView extends StatefulHookConsumerWidget { - const HomeView({Key? key}) : super(key: key); + const HomeView({super.key}); @override HomeViewState createState() => HomeViewState(); diff --git a/website/docs/concepts/reading_watch_build.dart b/website/docs/concepts/reading_watch_build.dart index af23d3d5d..acade55d7 100644 --- a/website/docs/concepts/reading_watch_build.dart +++ b/website/docs/concepts/reading_watch_build.dart @@ -21,7 +21,7 @@ class TodoList extends StateNotifier> { final counterProvider = StateProvider((ref) => 0); class HomeView extends ConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/docs/cookbooks/testing_flutter.dart b/website/docs/cookbooks/testing_flutter.dart index 0fc7580d3..6685a1bdb 100644 --- a/website/docs/cookbooks/testing_flutter.dart +++ b/website/docs/cookbooks/testing_flutter.dart @@ -4,7 +4,7 @@ import 'package:flutter_test/flutter_test.dart'; class MyApp extends StatelessWidget { // ignore: prefer_const_constructors_in_immutables - MyApp({Key? key}) : super(key: key); + MyApp({super.key}); @override Widget build(BuildContext context) { diff --git a/website/docs/cookbooks/testing_full.dart b/website/docs/cookbooks/testing_full.dart index 3f91c575b..0f79b4ee8 100644 --- a/website/docs/cookbooks/testing_full.dart +++ b/website/docs/cookbooks/testing_full.dart @@ -43,7 +43,7 @@ class FakeRepository implements Repository { } class TodoItem extends StatelessWidget { - const TodoItem({Key? key, required this.todo}) : super(key: key); + const TodoItem({super.key, required this.todo}); final Todo todo; @override Widget build(BuildContext context) { diff --git a/website/docs/cookbooks/testing_override_info.dart b/website/docs/cookbooks/testing_override_info.dart index 0a396c8ef..d71ae3c69 100644 --- a/website/docs/cookbooks/testing_override_info.dart +++ b/website/docs/cookbooks/testing_override_info.dart @@ -17,7 +17,7 @@ class Todo { } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { diff --git a/website/docs/providers/change_notifier_provider/todos_consumer.dart b/website/docs/providers/change_notifier_provider/todos_consumer.dart index da889e521..beac13f4e 100644 --- a/website/docs/providers/change_notifier_provider/todos_consumer.dart +++ b/website/docs/providers/change_notifier_provider/todos_consumer.dart @@ -8,7 +8,7 @@ import 'todos.dart'; /* SNIPPET START */ class TodoListView extends ConsumerWidget { - const TodoListView({Key? key}) : super(key: key); + const TodoListView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/docs/providers/provider/optimized_previous_button.dart b/website/docs/providers/provider/optimized_previous_button.dart index 3ec7de654..83223168f 100644 --- a/website/docs/providers/provider/optimized_previous_button.dart +++ b/website/docs/providers/provider/optimized_previous_button.dart @@ -14,7 +14,7 @@ final canGoToPreviousPageProvider = Provider((ref) { }); class PreviousButton extends ConsumerWidget { - const PreviousButton({Key? key}): super(key: key); + const PreviousButton({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/docs/providers/provider/unoptimized_previous_button.dart b/website/docs/providers/provider/unoptimized_previous_button.dart index c28df14e3..a04b9d65c 100644 --- a/website/docs/providers/provider/unoptimized_previous_button.dart +++ b/website/docs/providers/provider/unoptimized_previous_button.dart @@ -7,7 +7,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; final pageIndexProvider = StateProvider((ref) => 0); class PreviousButton extends ConsumerWidget { - const PreviousButton({Key? key}): super(key: key); + const PreviousButton({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/docs/providers/state_notifier_provider/todos_consumer.dart b/website/docs/providers/state_notifier_provider/todos_consumer.dart index 1b98eb780..8722a542f 100644 --- a/website/docs/providers/state_notifier_provider/todos_consumer.dart +++ b/website/docs/providers/state_notifier_provider/todos_consumer.dart @@ -8,7 +8,7 @@ import 'todos.dart'; /* SNIPPET START */ class TodoListView extends ConsumerWidget { - const TodoListView({Key? key}): super(key: key); + const TodoListView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/docs/providers/state_provider/full.dart b/website/docs/providers/state_provider/full.dart index 74a0c7c72..4c598055f 100644 --- a/website/docs/providers/state_provider/full.dart +++ b/website/docs/providers/state_provider/full.dart @@ -11,7 +11,7 @@ void main() { } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { @@ -56,7 +56,7 @@ final productsProvider = Provider>((ref) { }); class MyHomePage extends ConsumerWidget { - const MyHomePage({Key? key}) : super(key: key); + const MyHomePage({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/docs/providers/state_provider/update_read_once.dart b/website/docs/providers/state_provider/update_read_once.dart index 1c99c21ee..825df6d0f 100644 --- a/website/docs/providers/state_provider/update_read_once.dart +++ b/website/docs/providers/state_provider/update_read_once.dart @@ -6,7 +6,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; final counterProvider = StateProvider((ref) => 0); class HomeView extends ConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/docs/providers/state_provider/update_read_twice.dart b/website/docs/providers/state_provider/update_read_twice.dart index af6d060a8..c029e0730 100644 --- a/website/docs/providers/state_provider/update_read_twice.dart +++ b/website/docs/providers/state_provider/update_read_twice.dart @@ -6,7 +6,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; final counterProvider = StateProvider((ref) => 0); class HomeView extends ConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/bn/docusaurus-plugin-content-docs/current/concepts/provider_observer_logger.dart b/website/i18n/bn/docusaurus-plugin-content-docs/current/concepts/provider_observer_logger.dart index dc80cc762..0d801dbce 100644 --- a/website/i18n/bn/docusaurus-plugin-content-docs/current/concepts/provider_observer_logger.dart +++ b/website/i18n/bn/docusaurus-plugin-content-docs/current/concepts/provider_observer_logger.dart @@ -32,7 +32,7 @@ void main() { } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { diff --git a/website/i18n/bn/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook.dart b/website/i18n/bn/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook.dart index c4b2efcc4..8d0ecbafd 100644 --- a/website/i18n/bn/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook.dart +++ b/website/i18n/bn/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook.dart @@ -6,7 +6,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'reading_counter.dart'; class HomeView extends HookConsumerWidget { - const HomeView({Key? key}) : super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/bn/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook_widget.dart b/website/i18n/bn/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook_widget.dart index aded824b7..a7dcff48f 100644 --- a/website/i18n/bn/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook_widget.dart +++ b/website/i18n/bn/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook_widget.dart @@ -8,7 +8,7 @@ import 'reading_counter.dart'; /* SNIPPET START */ class HomeView extends HookConsumerWidget { - const HomeView({Key? key}) : super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/bn/docusaurus-plugin-content-docs/current/concepts/reading_consumer_stateful_widget.dart b/website/i18n/bn/docusaurus-plugin-content-docs/current/concepts/reading_consumer_stateful_widget.dart index b85c0504f..254e86a9d 100644 --- a/website/i18n/bn/docusaurus-plugin-content-docs/current/concepts/reading_consumer_stateful_widget.dart +++ b/website/i18n/bn/docusaurus-plugin-content-docs/current/concepts/reading_consumer_stateful_widget.dart @@ -5,7 +5,7 @@ import 'reading_counter.dart'; /* SNIPPET START */ class HomeView extends ConsumerStatefulWidget { - const HomeView({Key? key}) : super(key: key); + const HomeView({super.key}); @override HomeViewState createState() => HomeViewState(); diff --git a/website/i18n/bn/docusaurus-plugin-content-docs/current/concepts/reading_consumer_widget.dart b/website/i18n/bn/docusaurus-plugin-content-docs/current/concepts/reading_consumer_widget.dart index 568e004f4..18b851e55 100644 --- a/website/i18n/bn/docusaurus-plugin-content-docs/current/concepts/reading_consumer_widget.dart +++ b/website/i18n/bn/docusaurus-plugin-content-docs/current/concepts/reading_consumer_widget.dart @@ -5,7 +5,7 @@ import 'reading_counter.dart'; /* SNIPPET START */ class HomeView extends ConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/bn/docusaurus-plugin-content-docs/current/concepts/reading_listen.dart b/website/i18n/bn/docusaurus-plugin-content-docs/current/concepts/reading_listen.dart index 37121f87c..4ed90e7af 100644 --- a/website/i18n/bn/docusaurus-plugin-content-docs/current/concepts/reading_listen.dart +++ b/website/i18n/bn/docusaurus-plugin-content-docs/current/concepts/reading_listen.dart @@ -5,7 +5,7 @@ import 'reading_counter.dart'; /* SNIPPET START */ -final counterProvider = StateNotifierProvider((ref) => Counter(ref)); +final counterProvider = StateNotifierProvider(Counter.new); final anotherProvider = Provider((ref) { ref.listen(counterProvider, (int? previousCount, int newCount) { diff --git a/website/i18n/bn/docusaurus-plugin-content-docs/current/concepts/reading_listen_build.dart b/website/i18n/bn/docusaurus-plugin-content-docs/current/concepts/reading_listen_build.dart index 2449c763e..066565b67 100644 --- a/website/i18n/bn/docusaurus-plugin-content-docs/current/concepts/reading_listen_build.dart +++ b/website/i18n/bn/docusaurus-plugin-content-docs/current/concepts/reading_listen_build.dart @@ -6,10 +6,10 @@ import 'reading_counter.dart'; /* SNIPPET START */ -final counterProvider = StateNotifierProvider((ref) => Counter(ref)); +final counterProvider = StateNotifierProvider(Counter.new); class HomeView extends ConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/bn/docusaurus-plugin-content-docs/current/concepts/reading_read.dart b/website/i18n/bn/docusaurus-plugin-content-docs/current/concepts/reading_read.dart index 6de10d964..91be089df 100644 --- a/website/i18n/bn/docusaurus-plugin-content-docs/current/concepts/reading_read.dart +++ b/website/i18n/bn/docusaurus-plugin-content-docs/current/concepts/reading_read.dart @@ -8,10 +8,10 @@ import 'reading_counter.dart'; /* SNIPPET START */ final counterProvider = - StateNotifierProvider((ref) => Counter(ref)); + StateNotifierProvider(Counter.new); class HomeView extends ConsumerWidget { - const HomeView({Key? key}) : super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/bn/docusaurus-plugin-content-docs/current/concepts/reading_watch_build.dart b/website/i18n/bn/docusaurus-plugin-content-docs/current/concepts/reading_watch_build.dart index ac58d040e..bc0c7bdf4 100644 --- a/website/i18n/bn/docusaurus-plugin-content-docs/current/concepts/reading_watch_build.dart +++ b/website/i18n/bn/docusaurus-plugin-content-docs/current/concepts/reading_watch_build.dart @@ -21,7 +21,7 @@ class TodoList extends StateNotifier> { final counterProvider = StateProvider((ref) => 0); class HomeView extends ConsumerWidget { - const HomeView({Key? key}) : super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/bn/docusaurus-plugin-content-docs/current/cookbooks/testing_flutter.dart b/website/i18n/bn/docusaurus-plugin-content-docs/current/cookbooks/testing_flutter.dart index a43c7ce42..36ff78123 100644 --- a/website/i18n/bn/docusaurus-plugin-content-docs/current/cookbooks/testing_flutter.dart +++ b/website/i18n/bn/docusaurus-plugin-content-docs/current/cookbooks/testing_flutter.dart @@ -4,7 +4,7 @@ import 'package:flutter_test/flutter_test.dart'; class MyApp extends StatelessWidget { // ignore: prefer_const_constructors_in_immutables - MyApp({Key? key}) : super(key: key); + MyApp({super.key}); @override Widget build(BuildContext context) { diff --git a/website/i18n/bn/docusaurus-plugin-content-docs/current/cookbooks/testing_full.dart b/website/i18n/bn/docusaurus-plugin-content-docs/current/cookbooks/testing_full.dart index dbdcfdbd3..128e211f7 100644 --- a/website/i18n/bn/docusaurus-plugin-content-docs/current/cookbooks/testing_full.dart +++ b/website/i18n/bn/docusaurus-plugin-content-docs/current/cookbooks/testing_full.dart @@ -42,7 +42,7 @@ class FakeRepository implements Repository { } class TodoItem extends StatelessWidget { - const TodoItem({Key? key, required this.todo}) : super(key: key); + const TodoItem({super.key, required this.todo}); final Todo todo; @override Widget build(BuildContext context) { diff --git a/website/i18n/bn/docusaurus-plugin-content-docs/current/cookbooks/testing_override_info.dart b/website/i18n/bn/docusaurus-plugin-content-docs/current/cookbooks/testing_override_info.dart index 3ea55f0a6..38a80e15b 100644 --- a/website/i18n/bn/docusaurus-plugin-content-docs/current/cookbooks/testing_override_info.dart +++ b/website/i18n/bn/docusaurus-plugin-content-docs/current/cookbooks/testing_override_info.dart @@ -17,7 +17,7 @@ class Todo { } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { diff --git a/website/i18n/bn/docusaurus-plugin-content-docs/current/providers/provider/optimized_previous_button.dart b/website/i18n/bn/docusaurus-plugin-content-docs/current/providers/provider/optimized_previous_button.dart index 99616a42d..2848a2a91 100644 --- a/website/i18n/bn/docusaurus-plugin-content-docs/current/providers/provider/optimized_previous_button.dart +++ b/website/i18n/bn/docusaurus-plugin-content-docs/current/providers/provider/optimized_previous_button.dart @@ -14,7 +14,7 @@ final canGoToPreviousPageProvider = Provider((ref) { }); class PreviousButton extends ConsumerWidget { - const PreviousButton({Key? key}) : super(key: key); + const PreviousButton({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/bn/docusaurus-plugin-content-docs/current/providers/provider/unoptimized_previous_button.dart b/website/i18n/bn/docusaurus-plugin-content-docs/current/providers/provider/unoptimized_previous_button.dart index 638b0b438..9ae43a3eb 100644 --- a/website/i18n/bn/docusaurus-plugin-content-docs/current/providers/provider/unoptimized_previous_button.dart +++ b/website/i18n/bn/docusaurus-plugin-content-docs/current/providers/provider/unoptimized_previous_button.dart @@ -7,7 +7,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; final pageIndexProvider = StateProvider((ref) => 0); class PreviousButton extends ConsumerWidget { - const PreviousButton({Key? key}) : super(key: key); + const PreviousButton({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/bn/docusaurus-plugin-content-docs/current/providers/state_notifier_provider/todos_consumer.dart b/website/i18n/bn/docusaurus-plugin-content-docs/current/providers/state_notifier_provider/todos_consumer.dart index 8233438b1..e319dfbed 100644 --- a/website/i18n/bn/docusaurus-plugin-content-docs/current/providers/state_notifier_provider/todos_consumer.dart +++ b/website/i18n/bn/docusaurus-plugin-content-docs/current/providers/state_notifier_provider/todos_consumer.dart @@ -8,7 +8,7 @@ import 'todos.dart'; /* SNIPPET START */ class TodoListView extends ConsumerWidget { - const TodoListView({Key? key}) : super(key: key); + const TodoListView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/bn/docusaurus-plugin-content-docs/current/providers/state_provider/full.dart b/website/i18n/bn/docusaurus-plugin-content-docs/current/providers/state_provider/full.dart index d2ea00677..3c59ff2da 100644 --- a/website/i18n/bn/docusaurus-plugin-content-docs/current/providers/state_provider/full.dart +++ b/website/i18n/bn/docusaurus-plugin-content-docs/current/providers/state_provider/full.dart @@ -11,7 +11,7 @@ void main() { } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { @@ -56,7 +56,7 @@ final productsProvider = Provider>((ref) { }); class MyHomePage extends ConsumerWidget { - const MyHomePage({Key? key}) : super(key: key); + const MyHomePage({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/bn/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_once.dart b/website/i18n/bn/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_once.dart index 1c99c21ee..825df6d0f 100644 --- a/website/i18n/bn/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_once.dart +++ b/website/i18n/bn/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_once.dart @@ -6,7 +6,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; final counterProvider = StateProvider((ref) => 0); class HomeView extends ConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/bn/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_twice.dart b/website/i18n/bn/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_twice.dart index f7b715b7f..59590fa5b 100644 --- a/website/i18n/bn/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_twice.dart +++ b/website/i18n/bn/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_twice.dart @@ -6,7 +6,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; final counterProvider = StateProvider((ref) => 0); class HomeView extends ConsumerWidget { - const HomeView({Key? key}) : super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/de/docusaurus-plugin-content-docs/current/concepts/provider_observer_logger.dart b/website/i18n/de/docusaurus-plugin-content-docs/current/concepts/provider_observer_logger.dart index 918a3f54c..238d1eaf8 100644 --- a/website/i18n/de/docusaurus-plugin-content-docs/current/concepts/provider_observer_logger.dart +++ b/website/i18n/de/docusaurus-plugin-content-docs/current/concepts/provider_observer_logger.dart @@ -32,7 +32,7 @@ void main() { } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { diff --git a/website/i18n/de/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook.dart b/website/i18n/de/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook.dart index 54d11e333..6312de226 100644 --- a/website/i18n/de/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook.dart +++ b/website/i18n/de/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook.dart @@ -6,7 +6,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'reading_counter.dart'; class HomeView extends HookConsumerWidget { - const HomeView({Key? key}) : super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/de/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook_widget.dart b/website/i18n/de/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook_widget.dart index c8ffcf8c7..4480fe7fa 100644 --- a/website/i18n/de/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook_widget.dart +++ b/website/i18n/de/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook_widget.dart @@ -8,7 +8,7 @@ import 'reading_counter.dart'; /* SNIPPET START */ class HomeView extends HookConsumerWidget { - const HomeView({Key? key}) : super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/de/docusaurus-plugin-content-docs/current/concepts/reading_consumer_stateful_widget.dart b/website/i18n/de/docusaurus-plugin-content-docs/current/concepts/reading_consumer_stateful_widget.dart index 640971b27..879e2661b 100644 --- a/website/i18n/de/docusaurus-plugin-content-docs/current/concepts/reading_consumer_stateful_widget.dart +++ b/website/i18n/de/docusaurus-plugin-content-docs/current/concepts/reading_consumer_stateful_widget.dart @@ -5,7 +5,7 @@ import 'reading_counter.dart'; /* SNIPPET START */ class HomeView extends ConsumerStatefulWidget { - const HomeView({Key? key}) : super(key: key); + const HomeView({super.key}); @override HomeViewState createState() => HomeViewState(); diff --git a/website/i18n/de/docusaurus-plugin-content-docs/current/concepts/reading_consumer_widget.dart b/website/i18n/de/docusaurus-plugin-content-docs/current/concepts/reading_consumer_widget.dart index 70a7d548b..86604fc7b 100644 --- a/website/i18n/de/docusaurus-plugin-content-docs/current/concepts/reading_consumer_widget.dart +++ b/website/i18n/de/docusaurus-plugin-content-docs/current/concepts/reading_consumer_widget.dart @@ -5,7 +5,7 @@ import 'reading_counter.dart'; /* SNIPPET START */ class HomeView extends ConsumerWidget { - const HomeView({Key? key}) : super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/de/docusaurus-plugin-content-docs/current/concepts/reading_listen.dart b/website/i18n/de/docusaurus-plugin-content-docs/current/concepts/reading_listen.dart index 37121f87c..4ed90e7af 100644 --- a/website/i18n/de/docusaurus-plugin-content-docs/current/concepts/reading_listen.dart +++ b/website/i18n/de/docusaurus-plugin-content-docs/current/concepts/reading_listen.dart @@ -5,7 +5,7 @@ import 'reading_counter.dart'; /* SNIPPET START */ -final counterProvider = StateNotifierProvider((ref) => Counter(ref)); +final counterProvider = StateNotifierProvider(Counter.new); final anotherProvider = Provider((ref) { ref.listen(counterProvider, (int? previousCount, int newCount) { diff --git a/website/i18n/de/docusaurus-plugin-content-docs/current/concepts/reading_listen_build.dart b/website/i18n/de/docusaurus-plugin-content-docs/current/concepts/reading_listen_build.dart index 2449c763e..066565b67 100644 --- a/website/i18n/de/docusaurus-plugin-content-docs/current/concepts/reading_listen_build.dart +++ b/website/i18n/de/docusaurus-plugin-content-docs/current/concepts/reading_listen_build.dart @@ -6,10 +6,10 @@ import 'reading_counter.dart'; /* SNIPPET START */ -final counterProvider = StateNotifierProvider((ref) => Counter(ref)); +final counterProvider = StateNotifierProvider(Counter.new); class HomeView extends ConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/de/docusaurus-plugin-content-docs/current/concepts/reading_read.dart b/website/i18n/de/docusaurus-plugin-content-docs/current/concepts/reading_read.dart index cb30574b7..1c42dd23f 100644 --- a/website/i18n/de/docusaurus-plugin-content-docs/current/concepts/reading_read.dart +++ b/website/i18n/de/docusaurus-plugin-content-docs/current/concepts/reading_read.dart @@ -8,10 +8,10 @@ import 'reading_counter.dart'; /* SNIPPET START */ final counterProvider = - StateNotifierProvider((ref) => Counter(ref)); + StateNotifierProvider(Counter.new); class HomeView extends ConsumerWidget { - const HomeView({Key? key}) : super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/de/docusaurus-plugin-content-docs/current/concepts/reading_watch_build.dart b/website/i18n/de/docusaurus-plugin-content-docs/current/concepts/reading_watch_build.dart index eb0aaebf0..d7fc059f6 100644 --- a/website/i18n/de/docusaurus-plugin-content-docs/current/concepts/reading_watch_build.dart +++ b/website/i18n/de/docusaurus-plugin-content-docs/current/concepts/reading_watch_build.dart @@ -21,7 +21,7 @@ class TodoList extends StateNotifier> { final counterProvider = StateProvider((ref) => 0); class HomeView extends ConsumerWidget { - const HomeView({Key? key}) : super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/de/docusaurus-plugin-content-docs/current/cookbooks/testing_flutter.dart b/website/i18n/de/docusaurus-plugin-content-docs/current/cookbooks/testing_flutter.dart index 88fdbefcc..58b425278 100644 --- a/website/i18n/de/docusaurus-plugin-content-docs/current/cookbooks/testing_flutter.dart +++ b/website/i18n/de/docusaurus-plugin-content-docs/current/cookbooks/testing_flutter.dart @@ -4,7 +4,7 @@ import 'package:flutter_test/flutter_test.dart'; class MyApp extends StatelessWidget { // ignore: prefer_const_constructors_in_immutables - MyApp({Key? key}) : super(key: key); + MyApp({super.key}); @override Widget build(BuildContext context) { diff --git a/website/i18n/de/docusaurus-plugin-content-docs/current/cookbooks/testing_full.dart b/website/i18n/de/docusaurus-plugin-content-docs/current/cookbooks/testing_full.dart index 3e9f51e7f..4bfe5b24a 100644 --- a/website/i18n/de/docusaurus-plugin-content-docs/current/cookbooks/testing_full.dart +++ b/website/i18n/de/docusaurus-plugin-content-docs/current/cookbooks/testing_full.dart @@ -43,7 +43,7 @@ class FakeRepository implements Repository { } class TodoItem extends StatelessWidget { - const TodoItem({Key? key, required this.todo}) : super(key: key); + const TodoItem({super.key, required this.todo}); final Todo todo; @override Widget build(BuildContext context) { diff --git a/website/i18n/de/docusaurus-plugin-content-docs/current/cookbooks/testing_override_info.dart b/website/i18n/de/docusaurus-plugin-content-docs/current/cookbooks/testing_override_info.dart index c0541c9b3..19f2e726f 100644 --- a/website/i18n/de/docusaurus-plugin-content-docs/current/cookbooks/testing_override_info.dart +++ b/website/i18n/de/docusaurus-plugin-content-docs/current/cookbooks/testing_override_info.dart @@ -17,7 +17,7 @@ class Todo { } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { diff --git a/website/i18n/de/docusaurus-plugin-content-docs/current/providers/provider/optimized_previous_button.dart b/website/i18n/de/docusaurus-plugin-content-docs/current/providers/provider/optimized_previous_button.dart index dbab5f7a2..4e04ebdb7 100644 --- a/website/i18n/de/docusaurus-plugin-content-docs/current/providers/provider/optimized_previous_button.dart +++ b/website/i18n/de/docusaurus-plugin-content-docs/current/providers/provider/optimized_previous_button.dart @@ -14,7 +14,7 @@ final canGoToPreviousPageProvider = Provider((ref) { }); class PreviousButton extends ConsumerWidget { - const PreviousButton({Key? key}) : super(key: key); + const PreviousButton({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/de/docusaurus-plugin-content-docs/current/providers/provider/unoptimized_previous_button.dart b/website/i18n/de/docusaurus-plugin-content-docs/current/providers/provider/unoptimized_previous_button.dart index d80ddd6f3..99efdd26b 100644 --- a/website/i18n/de/docusaurus-plugin-content-docs/current/providers/provider/unoptimized_previous_button.dart +++ b/website/i18n/de/docusaurus-plugin-content-docs/current/providers/provider/unoptimized_previous_button.dart @@ -7,7 +7,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; final pageIndexProvider = StateProvider((ref) => 0); class PreviousButton extends ConsumerWidget { - const PreviousButton({Key? key}) : super(key: key); + const PreviousButton({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/de/docusaurus-plugin-content-docs/current/providers/state_notifier_provider/todos_consumer.dart b/website/i18n/de/docusaurus-plugin-content-docs/current/providers/state_notifier_provider/todos_consumer.dart index 2cfabd954..035772e30 100644 --- a/website/i18n/de/docusaurus-plugin-content-docs/current/providers/state_notifier_provider/todos_consumer.dart +++ b/website/i18n/de/docusaurus-plugin-content-docs/current/providers/state_notifier_provider/todos_consumer.dart @@ -8,7 +8,7 @@ import 'todos.dart'; /* SNIPPET START */ class TodoListView extends ConsumerWidget { - const TodoListView({Key? key}) : super(key: key); + const TodoListView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/de/docusaurus-plugin-content-docs/current/providers/state_provider/full.dart b/website/i18n/de/docusaurus-plugin-content-docs/current/providers/state_provider/full.dart index 84ed40342..d47fb2427 100644 --- a/website/i18n/de/docusaurus-plugin-content-docs/current/providers/state_provider/full.dart +++ b/website/i18n/de/docusaurus-plugin-content-docs/current/providers/state_provider/full.dart @@ -11,7 +11,7 @@ void main() { } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { @@ -56,7 +56,7 @@ final productsProvider = Provider>((ref) { }); class MyHomePage extends ConsumerWidget { - const MyHomePage({Key? key}) : super(key: key); + const MyHomePage({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/de/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_once.dart b/website/i18n/de/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_once.dart index 1c99c21ee..825df6d0f 100644 --- a/website/i18n/de/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_once.dart +++ b/website/i18n/de/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_once.dart @@ -6,7 +6,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; final counterProvider = StateProvider((ref) => 0); class HomeView extends ConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/de/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_twice.dart b/website/i18n/de/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_twice.dart index 11ec10463..91b877290 100644 --- a/website/i18n/de/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_twice.dart +++ b/website/i18n/de/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_twice.dart @@ -6,7 +6,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; final counterProvider = StateProvider((ref) => 0); class HomeView extends ConsumerWidget { - const HomeView({Key? key}) : super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/es/docusaurus-plugin-content-docs/current/providers/provider/optimized_previous_button.dart b/website/i18n/es/docusaurus-plugin-content-docs/current/providers/provider/optimized_previous_button.dart index b50a7825f..397c8dc1b 100644 --- a/website/i18n/es/docusaurus-plugin-content-docs/current/providers/provider/optimized_previous_button.dart +++ b/website/i18n/es/docusaurus-plugin-content-docs/current/providers/provider/optimized_previous_button.dart @@ -14,7 +14,7 @@ final canGoToPreviousPageProvider = Provider((ref) { }); class PreviousButton extends ConsumerWidget { - const PreviousButton({Key? key}) : super(key: key); + const PreviousButton({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/es/docusaurus-plugin-content-docs/current/providers/provider/unoptimized_previous_button.dart b/website/i18n/es/docusaurus-plugin-content-docs/current/providers/provider/unoptimized_previous_button.dart index e866be3b6..24f11a845 100644 --- a/website/i18n/es/docusaurus-plugin-content-docs/current/providers/provider/unoptimized_previous_button.dart +++ b/website/i18n/es/docusaurus-plugin-content-docs/current/providers/provider/unoptimized_previous_button.dart @@ -7,7 +7,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; final pageIndexProvider = StateProvider((ref) => 0); class PreviousButton extends ConsumerWidget { - const PreviousButton({Key? key}) : super(key: key); + const PreviousButton({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/es/docusaurus-plugin-content-docs/current/providers/state_notifier_provider/todos_consumer.dart b/website/i18n/es/docusaurus-plugin-content-docs/current/providers/state_notifier_provider/todos_consumer.dart index 97a3acef9..09c82341b 100644 --- a/website/i18n/es/docusaurus-plugin-content-docs/current/providers/state_notifier_provider/todos_consumer.dart +++ b/website/i18n/es/docusaurus-plugin-content-docs/current/providers/state_notifier_provider/todos_consumer.dart @@ -8,7 +8,7 @@ import 'todos.dart'; /* SNIPPET START */ class TodoListView extends ConsumerWidget { - const TodoListView({Key? key}): super(key: key); + const TodoListView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/es/docusaurus-plugin-content-docs/current/providers/state_provider/full.dart b/website/i18n/es/docusaurus-plugin-content-docs/current/providers/state_provider/full.dart index 358bc0d07..283d4c4bd 100644 --- a/website/i18n/es/docusaurus-plugin-content-docs/current/providers/state_provider/full.dart +++ b/website/i18n/es/docusaurus-plugin-content-docs/current/providers/state_provider/full.dart @@ -11,7 +11,7 @@ void main() { } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { @@ -56,7 +56,7 @@ final productsProvider = Provider>((ref) { }); class MyHomePage extends ConsumerWidget { - const MyHomePage({Key? key}) : super(key: key); + const MyHomePage({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/es/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_once.dart b/website/i18n/es/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_once.dart index 1c99c21ee..825df6d0f 100644 --- a/website/i18n/es/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_once.dart +++ b/website/i18n/es/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_once.dart @@ -6,7 +6,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; final counterProvider = StateProvider((ref) => 0); class HomeView extends ConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/es/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_twice.dart b/website/i18n/es/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_twice.dart index 038c8be76..b60695d94 100644 --- a/website/i18n/es/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_twice.dart +++ b/website/i18n/es/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_twice.dart @@ -6,7 +6,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; final counterProvider = StateProvider((ref) => 0); class HomeView extends ConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/provider_observer_logger.dart b/website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/provider_observer_logger.dart index 974a0264c..71ccc1557 100644 --- a/website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/provider_observer_logger.dart +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/provider_observer_logger.dart @@ -32,7 +32,7 @@ void main() { } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook.dart b/website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook.dart index 38d581c67..10031d23d 100644 --- a/website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook.dart +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook.dart @@ -6,7 +6,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'reading_counter.dart'; class HomeView extends HookConsumerWidget { - const HomeView({Key? key}) : super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook_widget.dart b/website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook_widget.dart index 1a57537ea..194bec8dc 100644 --- a/website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook_widget.dart +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook_widget.dart @@ -8,7 +8,7 @@ import 'reading_counter.dart'; /* SNIPPET START */ class HomeView extends HookConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/reading_consumer_stateful_widget.dart b/website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/reading_consumer_stateful_widget.dart index 1671265f4..a685b7bac 100644 --- a/website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/reading_consumer_stateful_widget.dart +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/reading_consumer_stateful_widget.dart @@ -5,7 +5,7 @@ import 'reading_counter.dart'; /* SNIPPET START */ class HomeView extends ConsumerStatefulWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override HomeViewState createState() => HomeViewState(); diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/reading_consumer_widget.dart b/website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/reading_consumer_widget.dart index a5f2d55f4..0970aede5 100644 --- a/website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/reading_consumer_widget.dart +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/reading_consumer_widget.dart @@ -5,7 +5,7 @@ import 'reading_counter.dart'; /* SNIPPET START */ class HomeView extends ConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/reading_listen.dart b/website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/reading_listen.dart index 37121f87c..4ed90e7af 100644 --- a/website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/reading_listen.dart +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/reading_listen.dart @@ -5,7 +5,7 @@ import 'reading_counter.dart'; /* SNIPPET START */ -final counterProvider = StateNotifierProvider((ref) => Counter(ref)); +final counterProvider = StateNotifierProvider(Counter.new); final anotherProvider = Provider((ref) { ref.listen(counterProvider, (int? previousCount, int newCount) { diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/reading_listen_build.dart b/website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/reading_listen_build.dart index 2449c763e..066565b67 100644 --- a/website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/reading_listen_build.dart +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/reading_listen_build.dart @@ -6,10 +6,10 @@ import 'reading_counter.dart'; /* SNIPPET START */ -final counterProvider = StateNotifierProvider((ref) => Counter(ref)); +final counterProvider = StateNotifierProvider(Counter.new); class HomeView extends ConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/reading_read.dart b/website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/reading_read.dart index 45eeb7db0..23a1a9a97 100644 --- a/website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/reading_read.dart +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/reading_read.dart @@ -7,10 +7,10 @@ import 'reading_counter.dart'; /* SNIPPET START */ -final counterProvider = StateNotifierProvider((ref) => Counter(ref)); +final counterProvider = StateNotifierProvider(Counter.new); class HomeView extends ConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/reading_watch_build.dart b/website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/reading_watch_build.dart index dcf2febec..e87b2436b 100644 --- a/website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/reading_watch_build.dart +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/concepts/reading_watch_build.dart @@ -21,7 +21,7 @@ class TodoList extends StateNotifier> { final counterProvider = StateProvider((ref) => 0); class HomeView extends ConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/providers/change_notifier_provider/todos_consumer.dart b/website/i18n/fr/docusaurus-plugin-content-docs/current/providers/change_notifier_provider/todos_consumer.dart index 6b85441de..600101582 100644 --- a/website/i18n/fr/docusaurus-plugin-content-docs/current/providers/change_notifier_provider/todos_consumer.dart +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/providers/change_notifier_provider/todos_consumer.dart @@ -8,7 +8,7 @@ import 'todos.dart'; /* SNIPPET START */ class TodoListView extends ConsumerWidget { - const TodoListView({Key? key}) : super(key: key); + const TodoListView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/providers/provider/optimized_previous_button.dart b/website/i18n/fr/docusaurus-plugin-content-docs/current/providers/provider/optimized_previous_button.dart index 98f248da8..0ca446615 100644 --- a/website/i18n/fr/docusaurus-plugin-content-docs/current/providers/provider/optimized_previous_button.dart +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/providers/provider/optimized_previous_button.dart @@ -15,7 +15,7 @@ final canGoToPreviousPageProvider = Provider((ref) { }); class PreviousButton extends ConsumerWidget { - const PreviousButton({Key? key}): super(key: key); + const PreviousButton({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/providers/provider/unoptimized_previous_button.dart b/website/i18n/fr/docusaurus-plugin-content-docs/current/providers/provider/unoptimized_previous_button.dart index ec01269c4..9a60b44fc 100644 --- a/website/i18n/fr/docusaurus-plugin-content-docs/current/providers/provider/unoptimized_previous_button.dart +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/providers/provider/unoptimized_previous_button.dart @@ -7,7 +7,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; final pageIndexProvider = StateProvider((ref) => 0); class PreviousButton extends ConsumerWidget { - const PreviousButton({Key? key}): super(key: key); + const PreviousButton({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/providers/state_notifier_provider/todos_consumer.dart b/website/i18n/fr/docusaurus-plugin-content-docs/current/providers/state_notifier_provider/todos_consumer.dart index 609279285..016ba782b 100644 --- a/website/i18n/fr/docusaurus-plugin-content-docs/current/providers/state_notifier_provider/todos_consumer.dart +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/providers/state_notifier_provider/todos_consumer.dart @@ -8,7 +8,7 @@ import 'todos.dart'; /* SNIPPET START */ class TodoListView extends ConsumerWidget { - const TodoListView({Key? key}): super(key: key); + const TodoListView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/providers/state_provider/full.dart b/website/i18n/fr/docusaurus-plugin-content-docs/current/providers/state_provider/full.dart index 64d83e706..bb48b1107 100644 --- a/website/i18n/fr/docusaurus-plugin-content-docs/current/providers/state_provider/full.dart +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/providers/state_provider/full.dart @@ -11,7 +11,7 @@ void main() { } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { @@ -56,7 +56,7 @@ final productsProvider = Provider>((ref) { }); class MyHomePage extends ConsumerWidget { - const MyHomePage({Key? key}) : super(key: key); + const MyHomePage({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_once.dart b/website/i18n/fr/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_once.dart index 1c99c21ee..825df6d0f 100644 --- a/website/i18n/fr/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_once.dart +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_once.dart @@ -6,7 +6,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; final counterProvider = StateProvider((ref) => 0); class HomeView extends ConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_twice.dart b/website/i18n/fr/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_twice.dart index 961a891e6..37d6d4a19 100644 --- a/website/i18n/fr/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_twice.dart +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_twice.dart @@ -6,7 +6,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; final counterProvider = StateProvider((ref) => 0); class HomeView extends ConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/it/docusaurus-plugin-content-docs/current/concepts/provider_observer_logger.dart b/website/i18n/it/docusaurus-plugin-content-docs/current/concepts/provider_observer_logger.dart index 769d9025e..fbca504d5 100644 --- a/website/i18n/it/docusaurus-plugin-content-docs/current/concepts/provider_observer_logger.dart +++ b/website/i18n/it/docusaurus-plugin-content-docs/current/concepts/provider_observer_logger.dart @@ -33,7 +33,7 @@ void main() { } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { diff --git a/website/i18n/it/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook.dart b/website/i18n/it/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook.dart index 59a7af0ec..3a99d644d 100644 --- a/website/i18n/it/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook.dart +++ b/website/i18n/it/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook.dart @@ -6,7 +6,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'reading_counter.dart'; class HomeView extends HookConsumerWidget { - const HomeView({Key? key}) : super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/it/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook_widget.dart b/website/i18n/it/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook_widget.dart index f9866ec6c..2199b694f 100644 --- a/website/i18n/it/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook_widget.dart +++ b/website/i18n/it/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook_widget.dart @@ -8,7 +8,7 @@ import 'reading_counter.dart'; /* SNIPPET START */ class HomeView extends HookConsumerWidget { - const HomeView({Key? key}) : super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/it/docusaurus-plugin-content-docs/current/concepts/reading_consumer_stateful_widget.dart b/website/i18n/it/docusaurus-plugin-content-docs/current/concepts/reading_consumer_stateful_widget.dart index 4bbb6c991..bf6aac600 100644 --- a/website/i18n/it/docusaurus-plugin-content-docs/current/concepts/reading_consumer_stateful_widget.dart +++ b/website/i18n/it/docusaurus-plugin-content-docs/current/concepts/reading_consumer_stateful_widget.dart @@ -5,7 +5,7 @@ import 'reading_counter.dart'; /* SNIPPET START */ class HomeView extends ConsumerStatefulWidget { - const HomeView({Key? key}) : super(key: key); + const HomeView({super.key}); @override HomeViewState createState() => HomeViewState(); diff --git a/website/i18n/it/docusaurus-plugin-content-docs/current/concepts/reading_consumer_widget.dart b/website/i18n/it/docusaurus-plugin-content-docs/current/concepts/reading_consumer_widget.dart index cb3d8de3c..85d64730d 100644 --- a/website/i18n/it/docusaurus-plugin-content-docs/current/concepts/reading_consumer_widget.dart +++ b/website/i18n/it/docusaurus-plugin-content-docs/current/concepts/reading_consumer_widget.dart @@ -5,7 +5,7 @@ import 'reading_counter.dart'; /* SNIPPET START */ class HomeView extends ConsumerWidget { - const HomeView({Key? key}) : super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/it/docusaurus-plugin-content-docs/current/concepts/reading_read.dart b/website/i18n/it/docusaurus-plugin-content-docs/current/concepts/reading_read.dart index 33cb5f845..f6e0d4112 100644 --- a/website/i18n/it/docusaurus-plugin-content-docs/current/concepts/reading_read.dart +++ b/website/i18n/it/docusaurus-plugin-content-docs/current/concepts/reading_read.dart @@ -8,10 +8,10 @@ import 'reading_counter.dart'; /* SNIPPET START */ final counterProvider = - StateNotifierProvider((ref) => Counter(ref)); + StateNotifierProvider(Counter.new); class HomeView extends ConsumerWidget { - const HomeView({Key? key}) : super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/it/docusaurus-plugin-content-docs/current/concepts/reading_stateful_hook_consumer_widget.dart b/website/i18n/it/docusaurus-plugin-content-docs/current/concepts/reading_stateful_hook_consumer_widget.dart index 4f0c7a165..ad4ef3fdf 100644 --- a/website/i18n/it/docusaurus-plugin-content-docs/current/concepts/reading_stateful_hook_consumer_widget.dart +++ b/website/i18n/it/docusaurus-plugin-content-docs/current/concepts/reading_stateful_hook_consumer_widget.dart @@ -8,7 +8,7 @@ import 'reading_counter.dart'; /* SNIPPET START */ class HomeView extends StatefulHookConsumerWidget { - const HomeView({Key? key}) : super(key: key); + const HomeView({super.key}); @override HomeViewState createState() => HomeViewState(); diff --git a/website/i18n/it/docusaurus-plugin-content-docs/current/concepts/reading_watch_build.dart b/website/i18n/it/docusaurus-plugin-content-docs/current/concepts/reading_watch_build.dart index 4d941edd3..9976365c8 100644 --- a/website/i18n/it/docusaurus-plugin-content-docs/current/concepts/reading_watch_build.dart +++ b/website/i18n/it/docusaurus-plugin-content-docs/current/concepts/reading_watch_build.dart @@ -21,7 +21,7 @@ class TodoList extends StateNotifier> { final counterProvider = StateProvider((ref) => 0); class HomeView extends ConsumerWidget { - const HomeView({Key? key}) : super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/it/docusaurus-plugin-content-docs/current/cookbooks/testing_flutter.dart b/website/i18n/it/docusaurus-plugin-content-docs/current/cookbooks/testing_flutter.dart index 5d96a2ace..0b50be457 100644 --- a/website/i18n/it/docusaurus-plugin-content-docs/current/cookbooks/testing_flutter.dart +++ b/website/i18n/it/docusaurus-plugin-content-docs/current/cookbooks/testing_flutter.dart @@ -4,7 +4,7 @@ import 'package:flutter_test/flutter_test.dart'; class MyApp extends StatelessWidget { // ignore: prefer_const_constructors_in_immutables - MyApp({Key? key}) : super(key: key); + MyApp({super.key}); @override Widget build(BuildContext context) { diff --git a/website/i18n/it/docusaurus-plugin-content-docs/current/cookbooks/testing_full.dart b/website/i18n/it/docusaurus-plugin-content-docs/current/cookbooks/testing_full.dart index 9c615f171..ec47bdfed 100644 --- a/website/i18n/it/docusaurus-plugin-content-docs/current/cookbooks/testing_full.dart +++ b/website/i18n/it/docusaurus-plugin-content-docs/current/cookbooks/testing_full.dart @@ -43,7 +43,7 @@ class FakeRepository implements Repository { } class TodoItem extends StatelessWidget { - const TodoItem({Key? key, required this.todo}) : super(key: key); + const TodoItem({super.key, required this.todo}); final Todo todo; @override Widget build(BuildContext context) { diff --git a/website/i18n/it/docusaurus-plugin-content-docs/current/cookbooks/testing_override_info.dart b/website/i18n/it/docusaurus-plugin-content-docs/current/cookbooks/testing_override_info.dart index c998894ce..302f85601 100644 --- a/website/i18n/it/docusaurus-plugin-content-docs/current/cookbooks/testing_override_info.dart +++ b/website/i18n/it/docusaurus-plugin-content-docs/current/cookbooks/testing_override_info.dart @@ -17,7 +17,7 @@ class Todo { } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { diff --git a/website/i18n/it/docusaurus-plugin-content-docs/current/providers/provider/optimized_previous_button.dart b/website/i18n/it/docusaurus-plugin-content-docs/current/providers/provider/optimized_previous_button.dart index 5c4623d07..a9a7d2469 100644 --- a/website/i18n/it/docusaurus-plugin-content-docs/current/providers/provider/optimized_previous_button.dart +++ b/website/i18n/it/docusaurus-plugin-content-docs/current/providers/provider/optimized_previous_button.dart @@ -15,7 +15,7 @@ final canGoToPreviousPageProvider = Provider((ref) { }); class PreviousButton extends ConsumerWidget { - const PreviousButton({Key? key}) : super(key: key); + const PreviousButton({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/it/docusaurus-plugin-content-docs/current/providers/provider/unoptimized_previous_button.dart b/website/i18n/it/docusaurus-plugin-content-docs/current/providers/provider/unoptimized_previous_button.dart index 15453e5cc..f8a4596df 100644 --- a/website/i18n/it/docusaurus-plugin-content-docs/current/providers/provider/unoptimized_previous_button.dart +++ b/website/i18n/it/docusaurus-plugin-content-docs/current/providers/provider/unoptimized_previous_button.dart @@ -7,7 +7,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; final pageIndexProvider = StateProvider((ref) => 0); class PreviousButton extends ConsumerWidget { - const PreviousButton({Key? key}) : super(key: key); + const PreviousButton({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/it/docusaurus-plugin-content-docs/current/providers/state_notifier_provider/todos_consumer.dart b/website/i18n/it/docusaurus-plugin-content-docs/current/providers/state_notifier_provider/todos_consumer.dart index 4e0febf0b..10628cc8b 100644 --- a/website/i18n/it/docusaurus-plugin-content-docs/current/providers/state_notifier_provider/todos_consumer.dart +++ b/website/i18n/it/docusaurus-plugin-content-docs/current/providers/state_notifier_provider/todos_consumer.dart @@ -8,7 +8,7 @@ import 'todos.dart'; /* SNIPPET START */ class TodoListView extends ConsumerWidget { - const TodoListView({Key? key}) : super(key: key); + const TodoListView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/it/docusaurus-plugin-content-docs/current/providers/state_provider/full.dart b/website/i18n/it/docusaurus-plugin-content-docs/current/providers/state_provider/full.dart index 9be456f53..966f4dec3 100644 --- a/website/i18n/it/docusaurus-plugin-content-docs/current/providers/state_provider/full.dart +++ b/website/i18n/it/docusaurus-plugin-content-docs/current/providers/state_provider/full.dart @@ -11,7 +11,7 @@ void main() { } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { @@ -56,7 +56,7 @@ final productsProvider = Provider>((ref) { }); class MyHomePage extends ConsumerWidget { - const MyHomePage({Key? key}) : super(key: key); + const MyHomePage({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/it/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_twice.dart b/website/i18n/it/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_twice.dart index f8b51a482..e3896c225 100644 --- a/website/i18n/it/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_twice.dart +++ b/website/i18n/it/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_twice.dart @@ -6,7 +6,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; final counterProvider = StateProvider((ref) => 0); class HomeView extends ConsumerWidget { - const HomeView({Key? key}) : super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/provider_observer_logger.dart b/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/provider_observer_logger.dart index 0109bc44f..d6e0a046d 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/provider_observer_logger.dart +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/provider_observer_logger.dart @@ -32,7 +32,7 @@ void main() { } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook.dart b/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook.dart index 4eaa6d0d6..fe3d6ac4f 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook.dart +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook.dart @@ -7,7 +7,7 @@ import 'reading_counter.dart'; class HomeView extends HookConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook_widget.dart b/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook_widget.dart index 3ede1219f..0668b2510 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook_widget.dart +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook_widget.dart @@ -8,7 +8,7 @@ import 'reading_counter.dart'; /* SNIPPET START */ class HomeView extends HookConsumerWidget { - const HomeView({Key? key}) : super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/reading_consumer_stateful_widget.dart b/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/reading_consumer_stateful_widget.dart index 33b7693df..8fd00f4d8 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/reading_consumer_stateful_widget.dart +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/reading_consumer_stateful_widget.dart @@ -5,7 +5,7 @@ import 'reading_counter.dart'; /* SNIPPET START */ class HomeView extends ConsumerStatefulWidget { - const HomeView({Key? key}) : super(key: key); + const HomeView({super.key}); @override HomeViewState createState() => HomeViewState(); diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/reading_consumer_widget.dart b/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/reading_consumer_widget.dart index e9f83a366..3a5cb346e 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/reading_consumer_widget.dart +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/reading_consumer_widget.dart @@ -5,7 +5,7 @@ import 'reading_counter.dart'; /* SNIPPET START */ class HomeView extends ConsumerWidget { - const HomeView({Key? key}) : super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/reading_listen.dart b/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/reading_listen.dart index 37121f87c..4ed90e7af 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/reading_listen.dart +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/reading_listen.dart @@ -5,7 +5,7 @@ import 'reading_counter.dart'; /* SNIPPET START */ -final counterProvider = StateNotifierProvider((ref) => Counter(ref)); +final counterProvider = StateNotifierProvider(Counter.new); final anotherProvider = Provider((ref) { ref.listen(counterProvider, (int? previousCount, int newCount) { diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/reading_listen_build.dart b/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/reading_listen_build.dart index 2449c763e..066565b67 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/reading_listen_build.dart +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/reading_listen_build.dart @@ -6,10 +6,10 @@ import 'reading_counter.dart'; /* SNIPPET START */ -final counterProvider = StateNotifierProvider((ref) => Counter(ref)); +final counterProvider = StateNotifierProvider(Counter.new); class HomeView extends ConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/reading_read.dart b/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/reading_read.dart index d47644e84..e9afa56c4 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/reading_read.dart +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/reading_read.dart @@ -7,10 +7,10 @@ import 'reading_counter.dart'; /* SNIPPET START */ -final counterProvider = StateNotifierProvider((ref) => Counter(ref)); +final counterProvider = StateNotifierProvider(Counter.new); class HomeView extends ConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/reading_stateful_hook_consumer_widget.dart b/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/reading_stateful_hook_consumer_widget.dart index a4371343f..0e9db5bae 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/reading_stateful_hook_consumer_widget.dart +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/reading_stateful_hook_consumer_widget.dart @@ -8,7 +8,7 @@ import 'reading_counter.dart'; /* SNIPPET START */ class HomeView extends StatefulHookConsumerWidget { - const HomeView({Key? key}) : super(key: key); + const HomeView({super.key}); @override HomeViewState createState() => HomeViewState(); diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/reading_watch_build.dart b/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/reading_watch_build.dart index 73551cc2c..fc1744463 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/reading_watch_build.dart +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/concepts/reading_watch_build.dart @@ -21,7 +21,7 @@ class TodoList extends StateNotifier> { final counterProvider = StateProvider((ref) => 0); class HomeView extends ConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/cookbooks/testing_flutter.dart b/website/i18n/ja/docusaurus-plugin-content-docs/current/cookbooks/testing_flutter.dart index 4f48da6c1..823aa3d30 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/cookbooks/testing_flutter.dart +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/cookbooks/testing_flutter.dart @@ -4,7 +4,7 @@ import 'package:flutter_test/flutter_test.dart'; class MyApp extends StatelessWidget { // ignore: prefer_const_constructors_in_immutables - MyApp({Key? key}) : super(key: key); + MyApp({super.key}); @override Widget build(BuildContext context) { diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/cookbooks/testing_full.dart b/website/i18n/ja/docusaurus-plugin-content-docs/current/cookbooks/testing_full.dart index a7172bcab..ba5140848 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/cookbooks/testing_full.dart +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/cookbooks/testing_full.dart @@ -43,7 +43,7 @@ class FakeRepository implements Repository { } class TodoItem extends StatelessWidget { - const TodoItem({Key? key, required this.todo}) : super(key: key); + const TodoItem({super.key, required this.todo}); final Todo todo; @override Widget build(BuildContext context) { diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/cookbooks/testing_override_info.dart b/website/i18n/ja/docusaurus-plugin-content-docs/current/cookbooks/testing_override_info.dart index 0785daa06..b25deff3a 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/cookbooks/testing_override_info.dart +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/cookbooks/testing_override_info.dart @@ -17,7 +17,7 @@ class Todo { } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/providers/change_notifier_provider/todos_consumer.dart b/website/i18n/ja/docusaurus-plugin-content-docs/current/providers/change_notifier_provider/todos_consumer.dart index 9ac192a8a..abb3f67dd 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/providers/change_notifier_provider/todos_consumer.dart +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/providers/change_notifier_provider/todos_consumer.dart @@ -8,7 +8,7 @@ import 'todos.dart'; /* SNIPPET START */ class TodoListView extends ConsumerWidget { - const TodoListView({Key? key}) : super(key: key); + const TodoListView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/providers/provider/optimized_previous_button.dart b/website/i18n/ja/docusaurus-plugin-content-docs/current/providers/provider/optimized_previous_button.dart index 7ee48eada..58ed9ed3e 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/providers/provider/optimized_previous_button.dart +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/providers/provider/optimized_previous_button.dart @@ -14,7 +14,7 @@ final canGoToPreviousPageProvider = Provider((ref) { }); class PreviousButton extends ConsumerWidget { - const PreviousButton({Key? key}) : super(key: key); + const PreviousButton({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/providers/provider/unoptimized_previous_button.dart b/website/i18n/ja/docusaurus-plugin-content-docs/current/providers/provider/unoptimized_previous_button.dart index 874338d50..0f1f4a503 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/providers/provider/unoptimized_previous_button.dart +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/providers/provider/unoptimized_previous_button.dart @@ -7,7 +7,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; final pageIndexProvider = StateProvider((ref) => 0); class PreviousButton extends ConsumerWidget { - const PreviousButton({Key? key}) : super(key: key); + const PreviousButton({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/providers/state_notifier_provider/todos_consumer.dart b/website/i18n/ja/docusaurus-plugin-content-docs/current/providers/state_notifier_provider/todos_consumer.dart index 2200ea96a..f1e5a74a0 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/providers/state_notifier_provider/todos_consumer.dart +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/providers/state_notifier_provider/todos_consumer.dart @@ -8,7 +8,7 @@ import 'todos.dart'; /* SNIPPET START */ class TodoListView extends ConsumerWidget { - const TodoListView({Key? key}): super(key: key); + const TodoListView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/providers/state_provider/full.dart b/website/i18n/ja/docusaurus-plugin-content-docs/current/providers/state_provider/full.dart index 358bc0d07..283d4c4bd 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/providers/state_provider/full.dart +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/providers/state_provider/full.dart @@ -11,7 +11,7 @@ void main() { } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { @@ -56,7 +56,7 @@ final productsProvider = Provider>((ref) { }); class MyHomePage extends ConsumerWidget { - const MyHomePage({Key? key}) : super(key: key); + const MyHomePage({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_once.dart b/website/i18n/ja/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_once.dart index 1c99c21ee..825df6d0f 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_once.dart +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_once.dart @@ -6,7 +6,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; final counterProvider = StateProvider((ref) => 0); class HomeView extends ConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_twice.dart b/website/i18n/ja/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_twice.dart index 27fc70d5d..645be50ee 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_twice.dart +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_twice.dart @@ -6,7 +6,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; final counterProvider = StateProvider((ref) => 0); class HomeView extends ConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/provider_observer_logger.dart b/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/provider_observer_logger.dart index be4e325e5..1574317f9 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/provider_observer_logger.dart +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/provider_observer_logger.dart @@ -32,7 +32,7 @@ void main() { } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook.dart b/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook.dart index 2f998d0fd..2d38c4cfc 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook.dart +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook.dart @@ -6,7 +6,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'reading_counter.dart'; class HomeView extends HookConsumerWidget { - const HomeView({Key? key}) : super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook_widget.dart b/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook_widget.dart index 2e44af84c..27db84a16 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook_widget.dart +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook_widget.dart @@ -8,7 +8,7 @@ import 'reading_counter.dart'; /* SNIPPET START */ class HomeView extends HookConsumerWidget { - const HomeView({Key? key}) : super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/reading_consumer_stateful_widget.dart b/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/reading_consumer_stateful_widget.dart index 680a93b72..c545e9b17 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/reading_consumer_stateful_widget.dart +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/reading_consumer_stateful_widget.dart @@ -5,7 +5,7 @@ import 'reading_counter.dart'; /* SNIPPET START */ class HomeView extends ConsumerStatefulWidget { - const HomeView({Key? key}) : super(key: key); + const HomeView({super.key}); @override HomeViewState createState() => HomeViewState(); diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/reading_consumer_widget.dart b/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/reading_consumer_widget.dart index 7fcca6f14..ffa37a065 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/reading_consumer_widget.dart +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/reading_consumer_widget.dart @@ -5,7 +5,7 @@ import 'reading_counter.dart'; /* SNIPPET START */ class HomeView extends ConsumerWidget { - const HomeView({Key? key}) : super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/reading_listen.dart b/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/reading_listen.dart index 37121f87c..4ed90e7af 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/reading_listen.dart +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/reading_listen.dart @@ -5,7 +5,7 @@ import 'reading_counter.dart'; /* SNIPPET START */ -final counterProvider = StateNotifierProvider((ref) => Counter(ref)); +final counterProvider = StateNotifierProvider(Counter.new); final anotherProvider = Provider((ref) { ref.listen(counterProvider, (int? previousCount, int newCount) { diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/reading_listen_build.dart b/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/reading_listen_build.dart index 2449c763e..066565b67 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/reading_listen_build.dart +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/reading_listen_build.dart @@ -6,10 +6,10 @@ import 'reading_counter.dart'; /* SNIPPET START */ -final counterProvider = StateNotifierProvider((ref) => Counter(ref)); +final counterProvider = StateNotifierProvider(Counter.new); class HomeView extends ConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/reading_read.dart b/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/reading_read.dart index bfdcce443..b3573a256 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/reading_read.dart +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/reading_read.dart @@ -8,10 +8,10 @@ import 'reading_counter.dart'; /* SNIPPET START */ final counterProvider = - StateNotifierProvider((ref) => Counter(ref)); + StateNotifierProvider(Counter.new); class HomeView extends ConsumerWidget { - const HomeView({Key? key}) : super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/reading_watch_build.dart b/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/reading_watch_build.dart index 73f86e6e4..6ace027ca 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/reading_watch_build.dart +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/reading_watch_build.dart @@ -21,7 +21,7 @@ class TodoList extends StateNotifier> { final counterProvider = StateProvider((ref) => 0); class HomeView extends ConsumerWidget { - const HomeView({Key? key}) : super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/cookbooks/testing_flutter.dart b/website/i18n/ko/docusaurus-plugin-content-docs/current/cookbooks/testing_flutter.dart index fdc3a12df..eb475ff23 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/cookbooks/testing_flutter.dart +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/cookbooks/testing_flutter.dart @@ -4,7 +4,7 @@ import 'package:flutter_test/flutter_test.dart'; class MyApp extends StatelessWidget { // ignore: prefer_const_constructors_in_immutables - MyApp({Key? key}) : super(key: key); + MyApp({super.key}); @override Widget build(BuildContext context) { diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/cookbooks/testing_full.dart b/website/i18n/ko/docusaurus-plugin-content-docs/current/cookbooks/testing_full.dart index fd6ea0fbf..8b290d56d 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/cookbooks/testing_full.dart +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/cookbooks/testing_full.dart @@ -42,7 +42,7 @@ class FakeRepository implements Repository { } class TodoItem extends StatelessWidget { - const TodoItem({Key? key, required this.todo}) : super(key: key); + const TodoItem({super.key, required this.todo}); final Todo todo; @override Widget build(BuildContext context) { diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/cookbooks/testing_override_info.dart b/website/i18n/ko/docusaurus-plugin-content-docs/current/cookbooks/testing_override_info.dart index bb80b87c4..8ad1eca93 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/cookbooks/testing_override_info.dart +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/cookbooks/testing_override_info.dart @@ -17,7 +17,7 @@ class Todo { } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/providers/provider/optimized_previous_button.dart b/website/i18n/ko/docusaurus-plugin-content-docs/current/providers/provider/optimized_previous_button.dart index b4093708b..b7c497a43 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/providers/provider/optimized_previous_button.dart +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/providers/provider/optimized_previous_button.dart @@ -14,7 +14,7 @@ final canGoToPreviousPageProvider = Provider((ref) { }); class PreviousButton extends ConsumerWidget { - const PreviousButton({Key? key}) : super(key: key); + const PreviousButton({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/providers/provider/unoptimized_previous_button.dart b/website/i18n/ko/docusaurus-plugin-content-docs/current/providers/provider/unoptimized_previous_button.dart index a415f6b6c..e5f56b568 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/providers/provider/unoptimized_previous_button.dart +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/providers/provider/unoptimized_previous_button.dart @@ -7,7 +7,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; final pageIndexProvider = StateProvider((ref) => 0); class PreviousButton extends ConsumerWidget { - const PreviousButton({Key? key}) : super(key: key); + const PreviousButton({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/providers/state_notifier_provider/todos_consumer.dart b/website/i18n/ko/docusaurus-plugin-content-docs/current/providers/state_notifier_provider/todos_consumer.dart index 1b98eb780..8722a542f 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/providers/state_notifier_provider/todos_consumer.dart +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/providers/state_notifier_provider/todos_consumer.dart @@ -8,7 +8,7 @@ import 'todos.dart'; /* SNIPPET START */ class TodoListView extends ConsumerWidget { - const TodoListView({Key? key}): super(key: key); + const TodoListView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/providers/state_provider/full.dart b/website/i18n/ko/docusaurus-plugin-content-docs/current/providers/state_provider/full.dart index 74a0c7c72..4c598055f 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/providers/state_provider/full.dart +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/providers/state_provider/full.dart @@ -11,7 +11,7 @@ void main() { } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { @@ -56,7 +56,7 @@ final productsProvider = Provider>((ref) { }); class MyHomePage extends ConsumerWidget { - const MyHomePage({Key? key}) : super(key: key); + const MyHomePage({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_once.dart b/website/i18n/ko/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_once.dart index 1c99c21ee..825df6d0f 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_once.dart +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_once.dart @@ -6,7 +6,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; final counterProvider = StateProvider((ref) => 0); class HomeView extends ConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_twice.dart b/website/i18n/ko/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_twice.dart index af6d060a8..c029e0730 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_twice.dart +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_twice.dart @@ -6,7 +6,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; final counterProvider = StateProvider((ref) => 0); class HomeView extends ConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/provider_observer_logger.dart b/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/provider_observer_logger.dart index c058b2482..da15a3a50 100644 --- a/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/provider_observer_logger.dart +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/provider_observer_logger.dart @@ -32,7 +32,7 @@ void main() { } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook.dart b/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook.dart index 4ae8388a0..ac6d3ef63 100644 --- a/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook.dart +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook.dart @@ -7,7 +7,7 @@ import 'reading_counter.dart'; class HomeView extends HookConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook_widget.dart b/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook_widget.dart index 9df46339c..69b5c71ce 100644 --- a/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook_widget.dart +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/reading_consumer_hook_widget.dart @@ -8,7 +8,7 @@ import 'reading_counter.dart'; /* SNIPPET START */ class HomeView extends HookConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/reading_consumer_stateful_widget.dart b/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/reading_consumer_stateful_widget.dart index c05217472..d176a287a 100644 --- a/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/reading_consumer_stateful_widget.dart +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/reading_consumer_stateful_widget.dart @@ -5,7 +5,7 @@ import 'reading_counter.dart'; /* SNIPPET START */ class HomeView extends ConsumerStatefulWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override HomeViewState createState() => HomeViewState(); diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/reading_consumer_widget.dart b/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/reading_consumer_widget.dart index 845f0c56a..234a266ba 100644 --- a/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/reading_consumer_widget.dart +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/reading_consumer_widget.dart @@ -5,7 +5,7 @@ import 'reading_counter.dart'; /* SNIPPET START */ class HomeView extends ConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/reading_listen.dart b/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/reading_listen.dart index 37121f87c..4ed90e7af 100644 --- a/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/reading_listen.dart +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/reading_listen.dart @@ -5,7 +5,7 @@ import 'reading_counter.dart'; /* SNIPPET START */ -final counterProvider = StateNotifierProvider((ref) => Counter(ref)); +final counterProvider = StateNotifierProvider(Counter.new); final anotherProvider = Provider((ref) { ref.listen(counterProvider, (int? previousCount, int newCount) { diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/reading_listen_build.dart b/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/reading_listen_build.dart index 2449c763e..066565b67 100644 --- a/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/reading_listen_build.dart +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/reading_listen_build.dart @@ -6,10 +6,10 @@ import 'reading_counter.dart'; /* SNIPPET START */ -final counterProvider = StateNotifierProvider((ref) => Counter(ref)); +final counterProvider = StateNotifierProvider(Counter.new); class HomeView extends ConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/reading_read.dart b/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/reading_read.dart index e9b04fee1..957ccc2cc 100644 --- a/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/reading_read.dart +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/reading_read.dart @@ -7,10 +7,10 @@ import 'reading_counter.dart'; /* SNIPPET START */ -final counterProvider = StateNotifierProvider((ref) => Counter(ref)); +final counterProvider = StateNotifierProvider(Counter.new); class HomeView extends ConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/reading_stateful_hook_consumer_widget.dart b/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/reading_stateful_hook_consumer_widget.dart index da8854428..fa21a6f45 100644 --- a/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/reading_stateful_hook_consumer_widget.dart +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/reading_stateful_hook_consumer_widget.dart @@ -8,7 +8,7 @@ import 'reading_counter.dart'; /* SNIPPET START */ class HomeView extends StatefulHookConsumerWidget { - const HomeView({Key? key}) : super(key: key); + const HomeView({super.key}); @override HomeViewState createState() => HomeViewState(); diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/reading_watch_build.dart b/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/reading_watch_build.dart index 41b861272..779ffb0a1 100644 --- a/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/reading_watch_build.dart +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/concepts/reading_watch_build.dart @@ -21,7 +21,7 @@ class TodoList extends StateNotifier> { final counterProvider = StateProvider((ref) => 0); class HomeView extends ConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/cookbooks/testing_flutter.dart b/website/i18n/ru/docusaurus-plugin-content-docs/current/cookbooks/testing_flutter.dart index cc799ea51..35b35a589 100644 --- a/website/i18n/ru/docusaurus-plugin-content-docs/current/cookbooks/testing_flutter.dart +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/cookbooks/testing_flutter.dart @@ -4,7 +4,7 @@ import 'package:flutter_test/flutter_test.dart'; class MyApp extends StatelessWidget { // ignore: prefer_const_constructors_in_immutables - MyApp({Key? key}) : super(key: key); + MyApp({super.key}); @override Widget build(BuildContext context) { diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/cookbooks/testing_full.dart b/website/i18n/ru/docusaurus-plugin-content-docs/current/cookbooks/testing_full.dart index d80d48758..fdd7f1e04 100644 --- a/website/i18n/ru/docusaurus-plugin-content-docs/current/cookbooks/testing_full.dart +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/cookbooks/testing_full.dart @@ -43,7 +43,7 @@ class FakeRepository implements Repository { } class TodoItem extends StatelessWidget { - const TodoItem({Key? key, required this.todo}) : super(key: key); + const TodoItem({super.key, required this.todo}); final Todo todo; @override Widget build(BuildContext context) { diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/cookbooks/testing_override_info.dart b/website/i18n/ru/docusaurus-plugin-content-docs/current/cookbooks/testing_override_info.dart index bde97547a..dbdc85b26 100644 --- a/website/i18n/ru/docusaurus-plugin-content-docs/current/cookbooks/testing_override_info.dart +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/cookbooks/testing_override_info.dart @@ -17,7 +17,7 @@ class Todo { } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/providers/change_notifier_provider/todos_consumer.dart b/website/i18n/ru/docusaurus-plugin-content-docs/current/providers/change_notifier_provider/todos_consumer.dart index b65b34143..e04cbd9e2 100644 --- a/website/i18n/ru/docusaurus-plugin-content-docs/current/providers/change_notifier_provider/todos_consumer.dart +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/providers/change_notifier_provider/todos_consumer.dart @@ -8,7 +8,7 @@ import 'todos.dart'; /* SNIPPET START */ class TodoListView extends ConsumerWidget { - const TodoListView({Key? key}) : super(key: key); + const TodoListView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/providers/provider/optimized_previous_button.dart b/website/i18n/ru/docusaurus-plugin-content-docs/current/providers/provider/optimized_previous_button.dart index 10ccd75d1..f1a86304d 100644 --- a/website/i18n/ru/docusaurus-plugin-content-docs/current/providers/provider/optimized_previous_button.dart +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/providers/provider/optimized_previous_button.dart @@ -15,7 +15,7 @@ final canGoToPreviousPageProvider = Provider((ref) { }); class PreviousButton extends ConsumerWidget { - const PreviousButton({Key? key}): super(key: key); + const PreviousButton({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/providers/provider/unoptimized_previous_button.dart b/website/i18n/ru/docusaurus-plugin-content-docs/current/providers/provider/unoptimized_previous_button.dart index 3218e222f..106bdd5af 100644 --- a/website/i18n/ru/docusaurus-plugin-content-docs/current/providers/provider/unoptimized_previous_button.dart +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/providers/provider/unoptimized_previous_button.dart @@ -7,7 +7,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; final pageIndexProvider = StateProvider((ref) => 0); class PreviousButton extends ConsumerWidget { - const PreviousButton({Key? key}): super(key: key); + const PreviousButton({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/providers/state_notifier_provider/todos_consumer.dart b/website/i18n/ru/docusaurus-plugin-content-docs/current/providers/state_notifier_provider/todos_consumer.dart index a7c5078ae..bc1163af4 100644 --- a/website/i18n/ru/docusaurus-plugin-content-docs/current/providers/state_notifier_provider/todos_consumer.dart +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/providers/state_notifier_provider/todos_consumer.dart @@ -8,7 +8,7 @@ import 'todos.dart'; /* SNIPPET START */ class TodoListView extends ConsumerWidget { - const TodoListView({Key? key}): super(key: key); + const TodoListView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/providers/state_provider/full.dart b/website/i18n/ru/docusaurus-plugin-content-docs/current/providers/state_provider/full.dart index 659a93c7f..f96b8f7d3 100644 --- a/website/i18n/ru/docusaurus-plugin-content-docs/current/providers/state_provider/full.dart +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/providers/state_provider/full.dart @@ -11,7 +11,7 @@ void main() { } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { @@ -56,7 +56,7 @@ final productsProvider = Provider>((ref) { }); class MyHomePage extends ConsumerWidget { - const MyHomePage({Key? key}) : super(key: key); + const MyHomePage({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_once.dart b/website/i18n/ru/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_once.dart index 1c99c21ee..825df6d0f 100644 --- a/website/i18n/ru/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_once.dart +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_once.dart @@ -6,7 +6,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; final counterProvider = StateProvider((ref) => 0); class HomeView extends ConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_twice.dart b/website/i18n/ru/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_twice.dart index bc802acf4..80c4b2505 100644 --- a/website/i18n/ru/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_twice.dart +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/providers/state_provider/update_read_twice.dart @@ -6,7 +6,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; final counterProvider = StateProvider((ref) => 0); class HomeView extends ConsumerWidget { - const HomeView({Key? key}): super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/website/pubspec.yaml b/website/pubspec.yaml index a9485e943..2c49c0695 100644 --- a/website/pubspec.yaml +++ b/website/pubspec.yaml @@ -2,7 +2,7 @@ name: website_snippets publish_to: "none" environment: - sdk: ">=2.12.0-0 <3.0.0" + sdk: ">=3.0.0 <4.0.0" dependencies: collection: ^1.15.0 @@ -18,7 +18,6 @@ dependencies: path: ../packages/riverpod dev_dependencies: - build_verify: ^3.0.0 flutter_test: sdk: flutter diff --git a/website/test/ensuire_build_test.dart b/website/test/ensuire_build_test.dart deleted file mode 100644 index 103e08276..000000000 --- a/website/test/ensuire_build_test.dart +++ /dev/null @@ -1,10 +0,0 @@ -import 'package:build_verify/build_verify.dart'; -import 'package:flutter_test/flutter_test.dart'; - -void main() { - test('ensure_build', () { - expectBuildClean( - packageRelativeDirectory: 'packages/riverpod_graph/test/integration/generated/golden', - ); - }); -}