diff --git a/pubspec.lock b/pubspec.lock index 78aa478..62af8c9 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,42 +7,42 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "26.0.0" + version: "40.0.0" analyzer: dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "2.3.0" + version: "4.1.0" args: dependency: transitive description: name: args url: "https://pub.dartlang.org" source: hosted - version: "2.3.0" + version: "2.3.1" 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: "7.2.1" + version: "8.0.3" bloc_test: dependency: "direct dev" description: name: bloc_test url: "https://pub.dartlang.org" source: hosted - version: "8.2.0" + 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: @@ -64,13 +64,6 @@ packages: 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.4" clock: dependency: transitive description: @@ -84,7 +77,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" convert: dependency: transitive description: @@ -98,7 +91,7 @@ packages: name: coverage url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.3.2" crew_member_repository: dependency: "direct main" description: @@ -112,7 +105,14 @@ packages: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "3.0.2" + diff_match_patch: + dependency: transitive + description: + name: diff_match_patch + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.1" equatable: dependency: transitive description: @@ -126,7 +126,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" file: dependency: transitive description: @@ -145,7 +145,7 @@ packages: name: flutter_bloc url: "https://pub.dartlang.org" source: hosted - version: "7.3.0" + version: "8.0.1" flutter_localizations: dependency: "direct main" description: flutter @@ -167,7 +167,7 @@ packages: name: frontend_server_client url: "https://pub.dartlang.org" source: hosted - version: "2.1.2" + version: "2.1.3" glob: dependency: transitive description: @@ -181,21 +181,21 @@ packages: name: http url: "https://pub.dartlang.org" source: hosted - version: "0.13.3" + version: "0.13.4" 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: name: http_parser url: "https://pub.dartlang.org" source: hosted - version: "4.0.0" + version: "4.0.1" intl: dependency: "direct main" description: @@ -216,14 +216,14 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3" + version: "0.6.4" json_annotation: dependency: transitive description: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "4.1.0" + version: "4.5.0" logging: dependency: transitive description: @@ -237,7 +237,14 @@ packages: 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.4" meta: dependency: transitive description: @@ -251,28 +258,28 @@ packages: name: mime url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.0.2" mockingjay: dependency: "direct dev" description: name: mockingjay url: "https://pub.dartlang.org" source: hosted - version: "0.1.1" + version: "0.3.0" mocktail: dependency: "direct dev" description: name: mocktail url: "https://pub.dartlang.org" source: hosted - version: "0.1.4" + version: "0.3.0" mocktail_image_network: dependency: "direct dev" description: name: mocktail_image_network url: "https://pub.dartlang.org" source: hosted - version: "0.1.0" + version: "0.3.1" nested: dependency: transitive description: @@ -300,21 +307,14 @@ packages: name: path 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.1" + version: "1.8.1" plugin_platform_interface: dependency: "direct dev" description: name: plugin_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.1.2" pool: dependency: transitive description: @@ -328,14 +328,14 @@ packages: name: provider url: "https://pub.dartlang.org" source: hosted - version: "6.0.1" + version: "6.0.3" pub_semver: dependency: transitive description: name: pub_semver url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" rocket_repository: dependency: "direct main" description: @@ -349,7 +349,7 @@ packages: name: shelf url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" shelf_packages_handler: dependency: transitive description: @@ -396,7 +396,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" spacex_api: dependency: "direct main" description: @@ -438,91 +438,105 @@ packages: name: test url: "https://pub.dartlang.org" source: hosted - version: "1.17.10" + version: "1.21.1" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.9" test_core: dependency: transitive description: name: test_core url: "https://pub.dartlang.org" source: hosted - version: "0.4.0" + version: "0.4.13" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.3.1" url_launcher: dependency: "direct main" description: name: url_launcher url: "https://pub.dartlang.org" source: hosted - version: "6.0.12" + version: "6.1.2" + url_launcher_android: + dependency: transitive + description: + name: url_launcher_android + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.17" + url_launcher_ios: + dependency: transitive + description: + name: url_launcher_ios + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.17" url_launcher_linux: dependency: transitive description: name: url_launcher_linux url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "3.0.1" url_launcher_macos: dependency: transitive description: name: url_launcher_macos url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "3.0.1" url_launcher_platform_interface: dependency: "direct dev" description: name: url_launcher_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "2.0.5" url_launcher_web: dependency: transitive description: name: url_launcher_web url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "2.0.11" url_launcher_windows: dependency: transitive description: name: url_launcher_windows url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "3.0.1" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.2" very_good_analysis: dependency: "direct dev" description: name: very_good_analysis url: "https://pub.dartlang.org" source: hosted - version: "2.4.0" + version: "3.0.0" vm_service: dependency: transitive description: name: vm_service url: "https://pub.dartlang.org" source: hosted - version: "6.2.0" + version: "8.3.0" watcher: dependency: transitive description: @@ -536,21 +550,21 @@ packages: 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: name: webkit_inspection_protocol url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.1.0" yaml: dependency: transitive description: name: yaml url: "https://pub.dartlang.org" source: hosted - version: "3.1.0" + version: "3.1.1" sdks: - dart: ">=2.14.0 <3.0.0" - flutter: ">=2.5.0" + dart: ">=2.17.0 <3.0.0" + flutter: ">=3.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 2a8dcc1..1f26772 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -7,14 +7,15 @@ publish_to: none environment: sdk: ">=2.14.0-0 <3.0.0" + flutter: ">=3.0.0" dependencies: - bloc: ^7.2.1 + bloc: ^8.0.3 crew_member_repository: path: packages/crew_member_repository flutter: sdk: flutter - flutter_bloc: ^7.3.0 + flutter_bloc: ^8.0.1 flutter_localizations: sdk: flutter intl: ^0.17.0 @@ -22,18 +23,18 @@ dependencies: path: packages/rocket_repository spacex_api: path: packages/spacex_api - url_launcher: ^6.0.12 + url_launcher: ^6.0.0-nullsafety.6 dev_dependencies: - bloc_test: ^8.2.0 + bloc_test: ^9.0.3 flutter_test: sdk: flutter - mockingjay: ^0.1.1 - mocktail: ^0.1.4 - mocktail_image_network: ^0.1.0 - plugin_platform_interface: ^2.0.2 - url_launcher_platform_interface: ^2.0.4 - very_good_analysis: ^2.4.0 + mockingjay: ^0.3.0 + mocktail: ^0.3.0 + mocktail_image_network: ^0.3.1 + plugin_platform_interface: ^2.1.2 + url_launcher_platform_interface: ^2.0.5 + very_good_analysis: ^3.0.0 flutter: uses-material-design: true diff --git a/test/crew/view/crew_page_test.dart b/test/crew/view/crew_page_test.dart index 79cb09a..15ef14d 100644 --- a/test/crew/view/crew_page_test.dart +++ b/test/crew/view/crew_page_test.dart @@ -14,6 +14,8 @@ class MockCrewMemberRepository extends Mock implements CrewMemberRepository {} class MockCrewCubit extends MockCubit implements CrewCubit {} +class FakeRoute extends Fake implements Route {} + void main() { final crewMembers = List.generate( 3, @@ -66,13 +68,13 @@ void main() { crewCubit = MockCrewCubit(); navigator = MockNavigator(); - when(() => navigator.push(any(that: isRoute()))) + when(() => navigator.push(any(that: isRoute()))) .thenAnswer((_) async {}); }); setUpAll(() { - registerFallbackValue(const CrewState()); - registerFallbackValue(Uri()); + registerFallbackValue(const CrewState()); + registerFallbackValue(Uri()); }); testWidgets('renders empty page when status is initial', (tester) async { @@ -184,7 +186,7 @@ void main() { await tester.tap(find.text(crewMembers.first.name)); verify( - () => navigator.push(any(that: isRoute())), + () => navigator.push(any(that: isRoute())), ).called(1); }, ); diff --git a/test/crew_member_details/view/crew_member_details_page_test.dart b/test/crew_member_details/view/crew_member_details_page_test.dart index f956947..873d1d7 100644 --- a/test/crew_member_details/view/crew_member_details_page_test.dart +++ b/test/crew_member_details/view/crew_member_details_page_test.dart @@ -58,7 +58,7 @@ void main() { }); setUpAll(() { - registerFallbackValue( + registerFallbackValue( const CrewMemberDetailsState(crewMember: crewMember), ); }); diff --git a/test/helpers/pump_app.dart b/test/helpers/pump_app.dart index ff82dd3..07869ff 100644 --- a/test/helpers/pump_app.dart +++ b/test/helpers/pump_app.dart @@ -1,11 +1,9 @@ import 'package:crew_member_repository/crew_member_repository.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/widgets.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockingjay/mockingjay.dart'; -import 'package:mocktail/mocktail.dart'; import 'package:rocket_repository/rocket_repository.dart'; import 'package:spacex_demo/l10n/l10n.dart'; diff --git a/test/home/view/home_page_test.dart b/test/home/view/home_page_test.dart index f307540..462bc05 100644 --- a/test/home/view/home_page_test.dart +++ b/test/home/view/home_page_test.dart @@ -1,6 +1,5 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:spacex_demo/home/home.dart'; -import 'package:spacex_demo/home/widgets/home_page_content.dart'; import '../../helpers/pump_app.dart'; diff --git a/test/home/widgets/home_page_content_test.dart b/test/home/widgets/home_page_content_test.dart index 2cf354b..1c3fae5 100644 --- a/test/home/widgets/home_page_content_test.dart +++ b/test/home/widgets/home_page_content_test.dart @@ -1,24 +1,32 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockingjay/mockingjay.dart'; -import 'package:mocktail/mocktail.dart'; +import 'package:spacex_demo/crew/crew.dart'; import 'package:spacex_demo/home/widgets/home_page_content.dart'; import 'package:spacex_demo/home/widgets/spacex_category_card.dart'; +import 'package:spacex_demo/rockets/rockets.dart'; import '../../helpers/pump_app.dart'; +class FakeRoute extends Fake implements Route {} + void main() { group('HomePageContent', () { late MockNavigator navigator; + setUpAll(() { + registerFallbackValue(FakeRoute()); + registerFallbackValue(FakeRoute()); + }); + setUp(() { navigator = MockNavigator(); - when(() => navigator.push(any(that: isRoute()))) - .thenAnswer((_) async {}); + when(() => navigator.push(any(that: isRoute()))) + .thenAnswer((_) async => null); - when(() => navigator.push(any(that: isRoute()))) - .thenAnswer((_) async {}); + when(() => navigator.push(any(that: isRoute()))) + .thenAnswer((_) async => null); }); testWidgets( @@ -63,7 +71,9 @@ void main() { ), ); - verify(() => navigator.push(any(that: isRoute()))).called(1); + verify(() => + navigator.push(any(that: isRoute()))) + .called(1); }, ); @@ -82,7 +92,8 @@ void main() { ), ); - verify(() => navigator.push(any(that: isRoute()))).called(1); + verify(() => navigator.push(any(that: isRoute()))) + .called(1); }, ); }); diff --git a/test/rocket_details/view/rocket_details_page_test.dart b/test/rocket_details/view/rocket_details_page_test.dart index 1324246..d90feac 100644 --- a/test/rocket_details/view/rocket_details_page_test.dart +++ b/test/rocket_details/view/rocket_details_page_test.dart @@ -60,7 +60,7 @@ void main() { }); setUpAll(() { - registerFallbackValue( + registerFallbackValue( RocketDetailsState(rocket: rocket), ); }); diff --git a/test/rockets/view/rockets_page_test.dart b/test/rockets/view/rockets_page_test.dart index c5cb415..6c39de4 100644 --- a/test/rockets/view/rockets_page_test.dart +++ b/test/rockets/view/rockets_page_test.dart @@ -14,6 +14,8 @@ class MockRocketRepository extends Mock implements RocketRepository {} class MockRocketsCubit extends MockCubit implements RocketsCubit { } +class FakeRoute extends Fake implements Route {} + void main() { final rockets = List.generate( 3, @@ -63,12 +65,13 @@ void main() { rocketsCubit = MockRocketsCubit(); navigator = MockNavigator(); - when(() => navigator.push(any(that: isRoute()))) + when(() => navigator.push(any(that: isRoute()))) .thenAnswer((_) async {}); }); setUpAll(() { - registerFallbackValue(const RocketsState()); + registerFallbackValue(const RocketsState()); + registerFallbackValue(FakeRoute()); }); testWidgets('renders empty page when status is initial', (tester) async { @@ -176,7 +179,8 @@ void main() { await tester.tap(find.text(rockets.first.name)); - verify(() => navigator.push(any(that: isRoute()))).called(1); + verify(() => navigator.push(any(that: isRoute()))) + .called(1); }, ); });