diff --git a/.github/workflows/examples.yaml b/.github/workflows/examples.yaml index f0cbe16..f4d28e4 100644 --- a/.github/workflows/examples.yaml +++ b/.github/workflows/examples.yaml @@ -1,18 +1,16 @@ name: examples -on: - push: - pull_request: +on: [push, pull_request] jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: subosito/flutter-action@v1.5.3 + - uses: actions/checkout@v3 + - uses: subosito/flutter-action@v2 with: - flutter-version: 2.8.0-3.2.pre - channel: "beta" + flutter-version: '2.10.5' + channel: 'stable' - name: Install Tools run: | @@ -24,11 +22,10 @@ jobs: - name: Run CI workflow (format, analyze, test) run: melos run WF:ci - - name: Check 95% code coverage - uses: VeryGoodOpenSource/very_good_coverage@v1.2.0 + - name: Check code coverage + uses: VeryGoodOpenSource/very_good_coverage@v1.2.1 with: path: "./coverage/merged.lcov.info" - min_coverage: 95 exclude: "**/*.freezed.dart **/*.g.dart **/*.gr.dart" - name: Upload coverage data to codecov.io diff --git a/cli/pubspec.yaml b/cli/pubspec.yaml index 78a2527..d117b99 100644 --- a/cli/pubspec.yaml +++ b/cli/pubspec.yaml @@ -3,10 +3,11 @@ description: A set of utility commands. version: 0.1.0+1 environment: - sdk: ">=2.13.0 <3.0.0" + sdk: ">=2.16.2 <3.0.0" -dev_dependencies: - test: ^1.17.12 - very_good_analysis: ^2.3.0 dependencies: path: ^1.8.0 + +dev_dependencies: + test: ^1.17.12 + very_good_analysis: ^2.4.0 diff --git a/examples/form_flow/packages/formz_inputs/lib/src/biography.dart b/examples/form_flow/packages/formz_inputs/lib/src/biography.dart index f373abd..a101787 100644 --- a/examples/form_flow/packages/formz_inputs/lib/src/biography.dart +++ b/examples/form_flow/packages/formz_inputs/lib/src/biography.dart @@ -23,5 +23,6 @@ class BiographyFormInput extends FormzInput { BiographyValidationError? validator(String value) { if (value.isEmpty) return BiographyValidationError.empty; if (value.length > 140) return BiographyValidationError.tooLong; + return null; } } diff --git a/examples/form_flow/packages/formz_inputs/lib/src/name.dart b/examples/form_flow/packages/formz_inputs/lib/src/name.dart index b4abd0d..503f2c8 100644 --- a/examples/form_flow/packages/formz_inputs/lib/src/name.dart +++ b/examples/form_flow/packages/formz_inputs/lib/src/name.dart @@ -19,5 +19,6 @@ class NameFormInput extends FormzInput { @override NameValidationError? validator(String value) { if (value.isEmpty || value.length < 2) return NameValidationError.tooShort; + return null; } } diff --git a/examples/form_flow/packages/formz_inputs/lib/src/pin.dart b/examples/form_flow/packages/formz_inputs/lib/src/pin.dart index c2944b7..b3988ad 100644 --- a/examples/form_flow/packages/formz_inputs/lib/src/pin.dart +++ b/examples/form_flow/packages/formz_inputs/lib/src/pin.dart @@ -42,5 +42,6 @@ class PinFormInput extends FormzInput { if (value.isEmpty || value.length != maxLength) { return PinValidationError.invalid; } + return null; } } diff --git a/examples/form_flow/packages/formz_inputs/pubspec.yaml b/examples/form_flow/packages/formz_inputs/pubspec.yaml index c958f48..fa2deb9 100644 --- a/examples/form_flow/packages/formz_inputs/pubspec.yaml +++ b/examples/form_flow/packages/formz_inputs/pubspec.yaml @@ -4,7 +4,7 @@ version: 1.0.0+1 publish_to: none environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.16.2 <3.0.0" dependencies: formz: ^0.4.0 diff --git a/examples/form_flow/packages/profile/pubspec.yaml b/examples/form_flow/packages/profile/pubspec.yaml index 0cce139..7f7b471 100644 --- a/examples/form_flow/packages/profile/pubspec.yaml +++ b/examples/form_flow/packages/profile/pubspec.yaml @@ -4,7 +4,7 @@ version: 1.0.0+1 publish_to: none environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.16.2 <3.0.0" dependencies: equatable: ^2.0.3 diff --git a/examples/form_flow/pubspec.lock b/examples/form_flow/pubspec.lock index bcefb84..835b4d6 100644 --- a/examples/form_flow/pubspec.lock +++ b/examples/form_flow/pubspec.lock @@ -7,42 +7,42 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "21.0.0" + version: "31.0.0" analyzer: dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "1.5.0" + version: "2.8.0" args: dependency: transitive description: name: args url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.3.0" async: dependency: transitive description: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.1" + version: "2.8.2" bloc: dependency: "direct main" description: name: bloc url: "https://pub.dartlang.org" source: hosted - version: "8.0.1" + version: "8.0.3" bloc_test: dependency: "direct dev" description: name: bloc_test url: "https://pub.dartlang.org" source: hosted - version: "9.0.1" + version: "9.0.3" boolean_selector: dependency: transitive description: @@ -56,7 +56,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: @@ -70,7 +70,7 @@ packages: name: cli_util url: "https://pub.dartlang.org" source: hosted - version: "0.3.0" + version: "0.3.5" clock: dependency: transitive description: @@ -91,21 +91,21 @@ packages: name: convert url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "3.0.1" coverage: dependency: transitive description: name: coverage url: "https://pub.dartlang.org" source: hosted - version: "1.0.2" + version: "1.0.3" crypto: dependency: transitive description: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "3.0.2" diff_match_patch: dependency: transitive description: @@ -133,7 +133,7 @@ packages: name: file url: "https://pub.dartlang.org" source: hosted - version: "6.1.0" + version: "6.1.2" flow_builder: dependency: "direct main" description: @@ -152,7 +152,7 @@ packages: name: flutter_bloc url: "https://pub.dartlang.org" source: hosted - version: "8.0.0" + version: "8.0.1" flutter_localizations: dependency: "direct main" description: flutter @@ -169,7 +169,7 @@ packages: name: formz url: "https://pub.dartlang.org" source: hosted - version: "0.4.0" + version: "0.4.1" formz_inputs: dependency: "direct main" description: @@ -190,14 +190,14 @@ packages: name: glob url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.2" http_multi_server: dependency: transitive description: name: http_multi_server url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "3.2.0" http_parser: dependency: transitive description: @@ -218,28 +218,35 @@ packages: name: io url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.0.3" js: dependency: transitive description: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3" + version: "0.6.4" logging: dependency: transitive description: name: logging url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.0.2" matcher: dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" meta: dependency: transitive description: @@ -253,14 +260,14 @@ packages: name: mime url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.0.1" mocktail: dependency: "direct dev" description: name: mocktail url: "https://pub.dartlang.org" source: hosted - version: "0.2.0" + version: "0.3.0" nested: dependency: transitive description: @@ -274,14 +281,14 @@ packages: name: node_preamble url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.1" package_config: dependency: transitive description: name: package_config url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.2" path: dependency: transitive description: @@ -289,13 +296,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.8.0" - pedantic: - dependency: transitive - description: - name: pedantic - url: "https://pub.dartlang.org" - source: hosted - version: "1.11.0" pool: dependency: transitive description: @@ -316,21 +316,21 @@ packages: name: provider url: "https://pub.dartlang.org" source: hosted - version: "6.0.0" + version: "6.0.2" pub_semver: dependency: transitive description: name: pub_semver url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.1.1" shelf: dependency: transitive description: name: shelf url: "https://pub.dartlang.org" source: hosted - version: "1.1.4" + version: "1.3.0" shelf_packages_handler: dependency: transitive description: @@ -344,7 +344,7 @@ packages: name: shelf_static url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.1.0" shelf_web_socket: dependency: transitive description: @@ -412,21 +412,21 @@ packages: name: test url: "https://pub.dartlang.org" source: hosted - version: "1.17.10" + version: "1.19.5" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.8" test_core: dependency: transitive description: name: test_core url: "https://pub.dartlang.org" source: hosted - version: "0.4.0" + version: "0.4.9" typed_data: dependency: transitive description: @@ -440,7 +440,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" very_good_analysis: dependency: "direct dev" description: @@ -454,21 +454,21 @@ packages: name: vm_service url: "https://pub.dartlang.org" source: hosted - version: "6.2.0" + version: "7.5.0" watcher: dependency: transitive description: name: watcher url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.0.1" web_socket_channel: dependency: transitive description: name: web_socket_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.2.0" webkit_inspection_protocol: dependency: transitive description: @@ -484,5 +484,5 @@ packages: source: hosted version: "3.1.0" sdks: - dart: ">=2.12.0 <3.0.0" - flutter: ">=1.16.0" + dart: ">=2.16.2 <3.0.0" + flutter: ">=2.10.5" diff --git a/examples/form_flow/pubspec.yaml b/examples/form_flow/pubspec.yaml index ece1f8a..e6583c1 100644 --- a/examples/form_flow/pubspec.yaml +++ b/examples/form_flow/pubspec.yaml @@ -4,15 +4,16 @@ version: 1.0.0+1 publish_to: none environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.16.2 <3.0.0" + flutter: "2.10.5" dependencies: - bloc: ^8.0.1 + bloc: ^8.0.3 equatable: ^2.0.3 flow_builder: ^0.0.6 flutter: sdk: flutter - flutter_bloc: ^8.0.0 + flutter_bloc: ^8.0.1 flutter_localizations: sdk: flutter formz_inputs: @@ -22,10 +23,10 @@ dependencies: path: packages/profile dev_dependencies: - bloc_test: ^9.0.1 + bloc_test: ^9.0.3 flutter_test: sdk: flutter - mocktail: ^0.2.0 + mocktail: ^0.3.0 very_good_analysis: ^2.4.0 flutter: diff --git a/examples/form_flow/test/app/bloc/app_bloc_test.dart b/examples/form_flow/test/app/bloc/app_bloc_test.dart index 38e444a..120d9d5 100644 --- a/examples/form_flow/test/app/bloc/app_bloc_test.dart +++ b/examples/form_flow/test/app/bloc/app_bloc_test.dart @@ -10,14 +10,14 @@ void main() { blocTest( 'emits [AppAuthenticated] when AppSignUpComplete is added.', - build: () => AppBloc(), + build: AppBloc.new, act: (bloc) => bloc.add(AppSignUpCompleted(user)), expect: () => [AppAuthenticated(user)], ); blocTest( 'emits [AppUnauthenticated] when AppLogoutRequested is added.', - build: () => AppBloc(), + build: AppBloc.new, act: (bloc) => bloc.add(AppLogoutRequested()), expect: () => [AppUnauthenticated()], ); diff --git a/examples/form_flow/test/signup/biography/cubit/biography_cubit_test.dart b/examples/form_flow/test/signup/biography/cubit/biography_cubit_test.dart index 596be31..a9880da 100644 --- a/examples/form_flow/test/signup/biography/cubit/biography_cubit_test.dart +++ b/examples/form_flow/test/signup/biography/cubit/biography_cubit_test.dart @@ -7,7 +7,7 @@ void main() { group('BiographyCubit', () { blocTest( 'emits state with new biography when changeBiography is called.', - build: () => BiographyCubit(), + build: BiographyCubit.new, act: (bloc) => bloc.changeBiography('value'), expect: () => const [ BiographyState( diff --git a/examples/form_flow/test/signup/bloc/sign_up_bloc_test.dart b/examples/form_flow/test/signup/bloc/sign_up_bloc_test.dart index 91cb276..56e7606 100644 --- a/examples/form_flow/test/signup/bloc/sign_up_bloc_test.dart +++ b/examples/form_flow/test/signup/bloc/sign_up_bloc_test.dart @@ -13,7 +13,7 @@ void main() { blocTest( 'emits [SignUpState] with [email, name] ' 'when SignUpCredentialsSubmitted is added.', - build: () => SignUpBloc(), + build: SignUpBloc.new, act: (bloc) { bloc.add(const SignUpCredentialsSubmitted(email: email, name: name)); }, @@ -27,7 +27,7 @@ void main() { blocTest( 'emits [SignUpState] with [email, name, biography] ' 'when SignUpBiographySubmitted is added.', - build: () => SignUpBloc(), + build: SignUpBloc.new, seed: () => const SignUpState( user: User(email: email, name: name, biography: '', pin: ''), ), @@ -42,7 +42,7 @@ void main() { blocTest( 'emits [SignUpState] with [email, name, biography, pin] ' 'and complete: true when SignUpBiographySubmitted is added.', - build: () => SignUpBloc(), + build: SignUpBloc.new, seed: () => const SignUpState( user: User(email: email, name: name, biography: biography, pin: ''), ), diff --git a/examples/form_flow/test/signup/credentials/cubit/credentials_cubit_test.dart b/examples/form_flow/test/signup/credentials/cubit/credentials_cubit_test.dart index 78bb130..a79251f 100644 --- a/examples/form_flow/test/signup/credentials/cubit/credentials_cubit_test.dart +++ b/examples/form_flow/test/signup/credentials/cubit/credentials_cubit_test.dart @@ -10,7 +10,7 @@ void main() { group('CredentialsCubit', () { blocTest( 'emits state with new email when changeEmail is called.', - build: () => CredentialsCubit(), + build: CredentialsCubit.new, act: (bloc) => bloc.changeEmail(email), expect: () => const [ CredentialsState( @@ -22,7 +22,7 @@ void main() { blocTest( 'emits state with new name when changeName is called.', - build: () => CredentialsCubit(), + build: CredentialsCubit.new, act: (bloc) => bloc.changeName(name), expect: () => const [ CredentialsState( diff --git a/examples/form_flow/test/signup/pin/cubit/pin_cubit_test.dart b/examples/form_flow/test/signup/pin/cubit/pin_cubit_test.dart index 3a16faa..0d455aa 100644 --- a/examples/form_flow/test/signup/pin/cubit/pin_cubit_test.dart +++ b/examples/form_flow/test/signup/pin/cubit/pin_cubit_test.dart @@ -7,7 +7,7 @@ void main() { group('PinCubit', () { blocTest( 'emits state with new biography when changeBiography is called.', - build: () => PinCubit(), + build: PinCubit.new, act: (bloc) => bloc.changePin('02'), expect: () => const [ PinState( diff --git a/examples/launch_analytics/lib/app/bloc/app_bloc.dart b/examples/launch_analytics/lib/app/bloc/app_bloc.dart index fa700e6..b17dab1 100644 --- a/examples/launch_analytics/lib/app/bloc/app_bloc.dart +++ b/examples/launch_analytics/lib/app/bloc/app_bloc.dart @@ -31,7 +31,6 @@ class AppBloc extends HydratedBloc { @override AppState? fromJson(Map json) { final runtimeType = json['runtimeType'] as String; - switch (runtimeType) { case 'AppInitial': return const AppInitial(); @@ -39,19 +38,17 @@ class AppBloc extends HydratedBloc { return AppAnalyticsLoaded.fromJson(json); case 'AppAnalyticsError': return const AppAnalyticsError(); + default: + return null; } } @override Map? toJson(AppState state) { - final map = { - 'runtimeType': '${state.runtimeType}', - }; - + final map = {'runtimeType': '${state.runtimeType}'}; if (state is AppAnalyticsLoaded) { map.addAll(state.toJson()); } - return map; } } diff --git a/examples/launch_analytics/packages/analytics_repository/pubspec.yaml b/examples/launch_analytics/packages/analytics_repository/pubspec.yaml index eec4a2b..7e1a634 100644 --- a/examples/launch_analytics/packages/analytics_repository/pubspec.yaml +++ b/examples/launch_analytics/packages/analytics_repository/pubspec.yaml @@ -4,13 +4,13 @@ version: 1.0.0+1 publish_to: none environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.16.2 <3.0.0" dependencies: local_analytics_api: path: ../local_analytics_api dev_dependencies: - mocktail: ^0.1.4 + mocktail: ^0.3.0 test: ^1.17.0 very_good_analysis: ^2.4.0 diff --git a/examples/launch_analytics/packages/local_analytics_api/pubspec.yaml b/examples/launch_analytics/packages/local_analytics_api/pubspec.yaml index 653db0f..a898547 100644 --- a/examples/launch_analytics/packages/local_analytics_api/pubspec.yaml +++ b/examples/launch_analytics/packages/local_analytics_api/pubspec.yaml @@ -4,12 +4,12 @@ version: 1.0.0+1 publish_to: none environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.16.2 <3.0.0" dependencies: hive: ^2.0.4 dev_dependencies: - mocktail: ^0.1.4 + mocktail: ^0.3.0 test: ^1.17.0 very_good_analysis: ^2.4.0 diff --git a/examples/launch_analytics/pubspec.lock b/examples/launch_analytics/pubspec.lock deleted file mode 100644 index ade283b..0000000 --- a/examples/launch_analytics/pubspec.lock +++ /dev/null @@ -1,581 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - _fe_analyzer_shared: - dependency: transitive - description: - name: _fe_analyzer_shared - url: "https://pub.dartlang.org" - source: hosted - version: "25.0.0" - analytics_repository: - dependency: "direct main" - description: - path: "packages/analytics_repository" - relative: true - source: path - version: "1.0.0+1" - analyzer: - dependency: transitive - description: - name: analyzer - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.0" - args: - dependency: transitive - description: - name: args - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.0" - async: - dependency: transitive - description: - name: async - url: "https://pub.dartlang.org" - source: hosted - version: "2.8.1" - bloc: - dependency: "direct main" - description: - name: bloc - url: "https://pub.dartlang.org" - source: hosted - version: "8.0.1" - bloc_test: - dependency: "direct dev" - description: - name: bloc_test - url: "https://pub.dartlang.org" - source: hosted - version: "9.0.1" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - characters: - dependency: transitive - description: - name: characters - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.1" - cli_util: - dependency: transitive - description: - name: cli_util - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.3" - clock: - dependency: transitive - description: - name: clock - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - collection: - dependency: transitive - description: - name: collection - url: "https://pub.dartlang.org" - source: hosted - version: "1.15.0" - convert: - dependency: transitive - description: - name: convert - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.1" - coverage: - dependency: transitive - description: - name: coverage - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.3" - crypto: - dependency: transitive - description: - name: crypto - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.1" - cupertino_icons: - dependency: "direct main" - description: - name: cupertino_icons - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.3" - diff_match_patch: - dependency: transitive - description: - name: diff_match_patch - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.1" - equatable: - dependency: "direct main" - description: - name: equatable - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.3" - fake_async: - dependency: transitive - description: - name: fake_async - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - ffi: - dependency: transitive - description: - name: ffi - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.2" - file: - dependency: transitive - description: - name: file - url: "https://pub.dartlang.org" - source: hosted - version: "6.1.2" - flutter: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_bloc: - dependency: "direct main" - description: - name: flutter_bloc - url: "https://pub.dartlang.org" - source: hosted - version: "8.0.0" - flutter_services_binding: - dependency: "direct main" - description: - name: flutter_services_binding - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.0" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - frontend_server_client: - dependency: transitive - description: - name: frontend_server_client - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.2" - glob: - dependency: transitive - description: - name: glob - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - hive: - dependency: transitive - description: - name: hive - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.4" - hive_flutter: - dependency: "direct main" - description: - name: hive_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - http_multi_server: - dependency: transitive - description: - name: http_multi_server - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.1" - http_parser: - dependency: transitive - description: - name: http_parser - url: "https://pub.dartlang.org" - source: hosted - version: "4.0.0" - hydrated_bloc: - dependency: "direct main" - description: - name: hydrated_bloc - url: "https://pub.dartlang.org" - source: hosted - version: "8.0.0" - io: - dependency: transitive - description: - name: io - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.3" - js: - dependency: transitive - description: - name: js - url: "https://pub.dartlang.org" - source: hosted - version: "0.6.3" - local_analytics_api: - dependency: "direct main" - description: - path: "packages/local_analytics_api" - relative: true - source: path - version: "1.0.0+1" - logging: - dependency: transitive - description: - name: logging - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" - matcher: - dependency: transitive - description: - name: matcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.10" - meta: - dependency: transitive - description: - name: meta - url: "https://pub.dartlang.org" - source: hosted - version: "1.7.0" - mime: - dependency: transitive - description: - name: mime - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" - mocktail: - dependency: "direct dev" - description: - name: mocktail - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - nested: - dependency: transitive - description: - name: nested - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" - node_preamble: - dependency: transitive - description: - name: node_preamble - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - package_config: - dependency: transitive - description: - name: package_config - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - path: - dependency: transitive - description: - name: path - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.0" - path_provider: - dependency: "direct main" - description: - name: path_provider - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.3" - path_provider_linux: - dependency: transitive - description: - name: path_provider_linux - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.2" - path_provider_macos: - dependency: transitive - description: - name: path_provider_macos - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.2" - path_provider_platform_interface: - dependency: transitive - description: - name: path_provider_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - path_provider_windows: - dependency: transitive - description: - name: path_provider_windows - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.3" - pedantic: - dependency: transitive - description: - name: pedantic - url: "https://pub.dartlang.org" - source: hosted - version: "1.11.1" - platform: - dependency: transitive - description: - name: platform - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.2" - plugin_platform_interface: - dependency: transitive - description: - name: plugin_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - pool: - dependency: transitive - description: - name: pool - url: "https://pub.dartlang.org" - source: hosted - version: "1.5.0" - process: - dependency: transitive - description: - name: process - url: "https://pub.dartlang.org" - source: hosted - version: "4.2.3" - provider: - dependency: transitive - description: - name: provider - url: "https://pub.dartlang.org" - source: hosted - version: "6.0.0" - pub_semver: - dependency: transitive - description: - name: pub_semver - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - shelf: - dependency: transitive - description: - name: shelf - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - shelf_packages_handler: - dependency: transitive - description: - name: shelf_packages_handler - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.0" - shelf_static: - dependency: transitive - description: - name: shelf_static - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - shelf_web_socket: - dependency: transitive - description: - name: shelf_web_socket - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.99" - source_map_stack_trace: - dependency: transitive - description: - name: source_map_stack_trace - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - source_maps: - dependency: transitive - description: - name: source_maps - url: "https://pub.dartlang.org" - source: hosted - version: "0.10.10" - source_span: - dependency: transitive - description: - name: source_span - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.1" - stack_trace: - dependency: transitive - description: - name: stack_trace - url: "https://pub.dartlang.org" - source: hosted - version: "1.10.0" - stream_channel: - dependency: transitive - description: - name: stream_channel - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - string_scanner: - dependency: transitive - description: - name: string_scanner - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - synchronized: - dependency: transitive - description: - name: synchronized - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.0" - term_glyph: - dependency: transitive - description: - name: term_glyph - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - test: - dependency: transitive - description: - name: test - url: "https://pub.dartlang.org" - source: hosted - version: "1.17.10" - test_api: - dependency: transitive - description: - name: test_api - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.2" - test_core: - dependency: transitive - description: - name: test_core - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.0" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" - vector_math: - dependency: transitive - description: - name: vector_math - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - very_good_analysis: - dependency: "direct dev" - description: - name: very_good_analysis - url: "https://pub.dartlang.org" - source: hosted - version: "2.4.0" - vm_service: - dependency: transitive - description: - name: vm_service - url: "https://pub.dartlang.org" - source: hosted - version: "6.2.0" - watcher: - dependency: transitive - description: - name: watcher - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" - web_socket_channel: - dependency: transitive - description: - name: web_socket_channel - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - webkit_inspection_protocol: - dependency: transitive - description: - name: webkit_inspection_protocol - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" - win32: - dependency: transitive - description: - name: win32 - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.8" - xdg_directories: - dependency: transitive - description: - name: xdg_directories - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - yaml: - dependency: transitive - description: - name: yaml - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.0" -sdks: - dart: ">=2.13.0 <3.0.0" - flutter: ">=2.0.0" diff --git a/examples/launch_analytics/pubspec.yaml b/examples/launch_analytics/pubspec.yaml index 14771bf..5f130e1 100644 --- a/examples/launch_analytics/pubspec.yaml +++ b/examples/launch_analytics/pubspec.yaml @@ -6,30 +6,31 @@ publish_to: "none" version: 1.0.0+1 environment: - sdk: ">=2.13.0 <3.0.0" + sdk: ">=2.16.2 <3.0.0" + flutter: "2.10.5" dependencies: analytics_repository: path: packages/analytics_repository - bloc: ^8.0.1 + bloc: ^8.0.3 cupertino_icons: ^1.0.2 equatable: ^2.0.3 flutter: sdk: flutter - flutter_bloc: ^8.0.0 + flutter_bloc: ^8.0.1 # https://github.com/flutter/flutter/issues/94123 flutter_services_binding: ^0.1.0 hive_flutter: ^1.1.0 - hydrated_bloc: ^8.0.0 + hydrated_bloc: ^8.1.0 local_analytics_api: path: packages/local_analytics_api path_provider: ^2.0.2 dev_dependencies: - bloc_test: ^9.0.1 + bloc_test: ^9.0.3 flutter_test: sdk: flutter - mocktail: ^0.2.0 + mocktail: ^0.3.0 very_good_analysis: ^2.4.0 flutter: diff --git a/examples/preference_navigation/packages/preferences/hive_preferences_repository/pubspec.yaml b/examples/preference_navigation/packages/preferences/hive_preferences_repository/pubspec.yaml index fd76956..a2ef5dd 100644 --- a/examples/preference_navigation/packages/preferences/hive_preferences_repository/pubspec.yaml +++ b/examples/preference_navigation/packages/preferences/hive_preferences_repository/pubspec.yaml @@ -4,7 +4,7 @@ version: 1.0.0+1 publish_to: none environment: - sdk: ">=2.13.0 <3.0.0" + sdk: ">=2.16.2 <3.0.0" dependencies: hive: ^2.0.4 @@ -12,6 +12,6 @@ dependencies: path: ../preferences_repository dev_dependencies: - mocktail: ^0.1.4 + mocktail: ^0.3.0 test: ^1.17.0 very_good_analysis: ^2.4.0 diff --git a/examples/preference_navigation/packages/preferences/hive_preferences_repository/test/hive_preferences_repository_test.dart b/examples/preference_navigation/packages/preferences/hive_preferences_repository/test/hive_preferences_repository_test.dart index 8fceb27..3504017 100644 --- a/examples/preference_navigation/packages/preferences/hive_preferences_repository/test/hive_preferences_repository_test.dart +++ b/examples/preference_navigation/packages/preferences/hive_preferences_repository/test/hive_preferences_repository_test.dart @@ -149,7 +149,7 @@ void main() { }); test('returns value correctly', () { - when(() => mockBox.get(any())).thenReturn(testValue); + when(() => mockBox.get('key')).thenReturn(testValue); expect(hiveRepository.getValue('key'), testValue); }); @@ -198,7 +198,7 @@ void main() { group('clearValues', () { test('clears correctly', () async { - when(() => mockBox.clear()).thenAnswer((_) async => 1); + when(mockBox.clear).thenAnswer((_) async => 1); await expectLater(hiveRepository.clearValues(), completes); }); diff --git a/examples/preference_navigation/packages/preferences/preferences_repository/pubspec.yaml b/examples/preference_navigation/packages/preferences/preferences_repository/pubspec.yaml index 69b9a2b..77b65af 100644 --- a/examples/preference_navigation/packages/preferences/preferences_repository/pubspec.yaml +++ b/examples/preference_navigation/packages/preferences/preferences_repository/pubspec.yaml @@ -4,7 +4,7 @@ version: 1.0.0+1 publish_to: none environment: - sdk: ">=2.13.0 <3.0.0" + sdk: ">=2.16.2 <3.0.0" dev_dependencies: test: ^1.17.0 diff --git a/examples/preference_navigation/packages/preferences/shared_preferences_repository/pubspec.yaml b/examples/preference_navigation/packages/preferences/shared_preferences_repository/pubspec.yaml index 6f988b9..d76a2ac 100644 --- a/examples/preference_navigation/packages/preferences/shared_preferences_repository/pubspec.yaml +++ b/examples/preference_navigation/packages/preferences/shared_preferences_repository/pubspec.yaml @@ -4,7 +4,7 @@ version: 1.0.0+1 publish_to: none environment: - sdk: ">=2.13.0 <3.0.0" + sdk: ">=2.16.2 <3.0.0" dependencies: flutter: @@ -16,5 +16,5 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - mocktail: ^0.1.4 + mocktail: ^0.3.0 very_good_analysis: ^2.4.0 diff --git a/examples/preference_navigation/pubspec.yaml b/examples/preference_navigation/pubspec.yaml index 29479cd..544d9f2 100644 --- a/examples/preference_navigation/pubspec.yaml +++ b/examples/preference_navigation/pubspec.yaml @@ -4,15 +4,16 @@ publish_to: "none" version: 1.0.0+1 environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.16.2 <3.0.0" + flutter: "2.10.5" dependencies: - bloc: ^8.0.1 + bloc: ^8.0.3 cupertino_icons: ^1.0.2 equatable: ^2.0.3 flutter: sdk: flutter - flutter_bloc: ^8.0.0 + flutter_bloc: ^8.0.1 # https://github.com/flutter/flutter/issues/94123 flutter_services_binding: ^0.1.0 hive: ^2.0.4 @@ -26,11 +27,11 @@ dependencies: path: packages/preferences/shared_preferences_repository dev_dependencies: - bloc_test: ^9.0.1 + bloc_test: ^9.0.3 flutter_test: sdk: flutter - mockingjay: ^0.2.0-dev.3 - mocktail: ^0.2.0 + mockingjay: ^0.3.0 + mocktail: ^0.3.0 very_good_analysis: ^2.4.0 flutter: diff --git a/examples/preference_navigation/test/home/view/home_page_test.dart b/examples/preference_navigation/test/home/view/home_page_test.dart index 78d576b..3dc04e2 100644 --- a/examples/preference_navigation/test/home/view/home_page_test.dart +++ b/examples/preference_navigation/test/home/view/home_page_test.dart @@ -45,7 +45,7 @@ void main() { 'navigates when PreferencesEmpty is emitted', (tester) async { final navigator = MockNavigator(); - when(() => navigator.push(any())).thenAnswer((_) async {}); + when(() => navigator.push(any())).thenAnswer((_) async {}); final preferencesBloc = MockPreferencesBloc(); whenListen( @@ -61,7 +61,9 @@ void main() { ), preferencesBloc: preferencesBloc, ); - verify(() => navigator.push(any(that: isRoute()))).called(1); + verify( + () => navigator.push(any(that: isRoute())), + ).called(1); }, ); diff --git a/examples/preference_navigation/test/preferences/view/preferences_page_test.dart b/examples/preference_navigation/test/preferences/view/preferences_page_test.dart index 01c1a19..1eb1637 100644 --- a/examples/preference_navigation/test/preferences/view/preferences_page_test.dart +++ b/examples/preference_navigation/test/preferences/view/preferences_page_test.dart @@ -21,7 +21,7 @@ void main() { testWidgets('navigates when PreferencesLoaded is emitted', (tester) async { final navigator = MockNavigator(); - when(() => navigator.push(any())).thenAnswer((_) async {}); + when(() => navigator.push(any())).thenAnswer((_) async {}); final preferencesBloc = MockPreferencesBloc(); whenListen( @@ -39,14 +39,16 @@ void main() { ), preferencesBloc: preferencesBloc, ); - verify(() => navigator.push(any(that: isRoute()))).called(1); + verify(() => navigator.push(any(that: isRoute()))).called(1); }); testWidgets( 'replaces route when PreferencesError is emitted', (tester) async { final navigator = MockNavigator(); - when(() => navigator.pushReplacement(any())).thenAnswer((_) async {}); + when( + () => navigator.pushReplacement(any()), + ).thenAnswer((_) async {}); final preferencesBloc = MockPreferencesBloc(); whenListen( @@ -63,7 +65,9 @@ void main() { preferencesBloc: preferencesBloc, ); verify( - () => navigator.pushReplacement(any(that: isRoute())), + () => navigator.pushReplacement( + any(that: isRoute()), + ), ).called(1); }, ); diff --git a/examples/preference_navigation/test/start/view/start_page_test.dart b/examples/preference_navigation/test/start/view/start_page_test.dart index a9d9016..39b3eb5 100644 --- a/examples/preference_navigation/test/start/view/start_page_test.dart +++ b/examples/preference_navigation/test/start/view/start_page_test.dart @@ -26,7 +26,9 @@ void main() { 'replaces route when PreferencesLoaded is emitted', (tester) async { final navigator = MockNavigator(); - when(() => navigator.pushReplacement(any())).thenAnswer((_) async {}); + when( + () => navigator.pushReplacement(any()), + ).thenAnswer((_) async {}); final preferencesBloc = MockPreferencesBloc(); whenListen( @@ -45,7 +47,9 @@ void main() { preferencesBloc: preferencesBloc, ); verify( - () => navigator.pushReplacement(any(that: isRoute())), + () => navigator.pushReplacement( + any(that: isRoute()), + ), ).called(1); }, ); @@ -72,7 +76,7 @@ void main() { 'navigates to PreferencesPage when TextButton is tapped', (tester) async { final navigator = MockNavigator(); - when(() => navigator.push(any())).thenAnswer((_) async {}); + when(() => navigator.push(any())).thenAnswer((_) async {}); await tester.pumpApp( MockNavigatorProvider( @@ -83,7 +87,9 @@ void main() { await tester.ensureVisible(find.byKey(noPreferencesGoButtonKey)); await tester.tap(find.byKey(noPreferencesGoButtonKey)); - verify(() => navigator.push(any(that: isRoute()))).called(1); + verify( + () => navigator.push(any(that: isRoute())), + ).called(1); }, ); }); diff --git a/examples/profile_accounts/packages/profile_core/pubspec.yaml b/examples/profile_accounts/packages/profile_core/pubspec.yaml index 7af5f03..e6c3b13 100644 --- a/examples/profile_accounts/packages/profile_core/pubspec.yaml +++ b/examples/profile_accounts/packages/profile_core/pubspec.yaml @@ -4,7 +4,7 @@ version: 1.0.0+1 publish_to: none environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.16.2 <3.0.0" dependencies: equatable: ^2.0.3 diff --git a/examples/profile_accounts/pubspec.yaml b/examples/profile_accounts/pubspec.yaml index f9c64f0..f787f98 100644 --- a/examples/profile_accounts/pubspec.yaml +++ b/examples/profile_accounts/pubspec.yaml @@ -4,23 +4,24 @@ publish_to: "none" version: 1.0.0+1 environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.16.2 <3.0.0" + flutter: "2.10.5" dependencies: - bloc: ^8.0.1 + bloc: ^8.0.3 cupertino_icons: ^1.0.2 equatable: ^2.0.3 flutter: sdk: flutter - flutter_bloc: ^8.0.0 + flutter_bloc: ^8.0.1 profile_core: path: packages/profile_core dev_dependencies: - bloc_test: ^9.0.1 + bloc_test: ^9.0.3 flutter_test: sdk: flutter - mocktail: ^0.2.0 + mocktail: ^0.3.0 very_good_analysis: ^2.4.0 flutter: diff --git a/examples/profile_accounts/test/profile/bloc/profile_bloc_test.dart b/examples/profile_accounts/test/profile/bloc/profile_bloc_test.dart index e3631a9..60ba5f5 100644 --- a/examples/profile_accounts/test/profile/bloc/profile_bloc_test.dart +++ b/examples/profile_accounts/test/profile/bloc/profile_bloc_test.dart @@ -20,7 +20,7 @@ void main() { group('ProfileAccountAdded', () { blocTest( 'emits [ProfileLoaded] when ProfileAccountAdded is added.', - build: () => ProfileBloc(), + build: ProfileBloc.new, act: (bloc) => bloc.add(ProfileAccountAdded(user)), expect: () => [ ProfileLoaded(current: user, accounts: [user]), @@ -30,7 +30,7 @@ void main() { blocTest( 'emits [ProfileLoaded] when ProfileAccountAdded is added ' 'and state is ProfileLoaded.', - build: () => ProfileBloc(), + build: ProfileBloc.new, seed: () => ProfileLoaded(current: user, accounts: [user]), act: (bloc) => bloc.add(ProfileAccountAdded(currentUser)), expect: () => [ @@ -41,8 +41,8 @@ void main() { blocTest( 'emits [ProfileError] when ProfileAccountAdded ' 'and state is FakeProfileState.', - build: () => ProfileBloc(), - seed: () => FakeProfileState(), + build: ProfileBloc.new, + seed: FakeProfileState.new, act: (bloc) => bloc.add(ProfileAccountAdded(user)), expect: () => const [ProfileError()], ); @@ -51,7 +51,7 @@ void main() { group('ProfileCurrentAccountChanged', () { blocTest( 'emits [ProfileLoaded] when ProfileCurrentAccountChanged is added.', - build: () => ProfileBloc(), + build: ProfileBloc.new, seed: () => ProfileLoaded(current: user, accounts: [user, currentUser]), act: (bloc) => bloc.add(ProfileCurrentAccountChanged(currentUser)), expect: () => [ @@ -62,8 +62,8 @@ void main() { blocTest( 'emits [ProfileLoaded] when ProfileCurrentAccountChanged is added ' 'and state is FakeProfileState.', - build: () => ProfileBloc(), - seed: () => FakeProfileState(), + build: ProfileBloc.new, + seed: FakeProfileState.new, act: (bloc) => bloc.add(ProfileCurrentAccountChanged(currentUser)), expect: () => const [ProfileError()], );