Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Update Dependencies with new flutter version 3.0.0 #16

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 75 additions & 61 deletions pubspec.lock

Large diffs are not rendered by default.

21 changes: 11 additions & 10 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,34 @@ 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
rocket_repository:
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
Expand Down
10 changes: 6 additions & 4 deletions test/crew/view/crew_page_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ class MockCrewMemberRepository extends Mock implements CrewMemberRepository {}

class MockCrewCubit extends MockCubit<CrewState> implements CrewCubit {}

class FakeRoute<T> extends Fake implements Route<T> {}

void main() {
final crewMembers = List.generate(
3,
Expand Down Expand Up @@ -66,13 +68,13 @@ void main() {
crewCubit = MockCrewCubit();
navigator = MockNavigator();

when(() => navigator.push(any(that: isRoute<void>())))
when(() => navigator.push<void>(any(that: isRoute<void>())))
.thenAnswer((_) async {});
});

setUpAll(() {
registerFallbackValue<CrewState>(const CrewState());
registerFallbackValue<Uri>(Uri());
registerFallbackValue(const CrewState());
registerFallbackValue(Uri());
});

testWidgets('renders empty page when status is initial', (tester) async {
Expand Down Expand Up @@ -184,7 +186,7 @@ void main() {
await tester.tap(find.text(crewMembers.first.name));

verify(
() => navigator.push(any(that: isRoute<void>())),
() => navigator.push<void>(any(that: isRoute<void>())),
).called(1);
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void main() {
});

setUpAll(() {
registerFallbackValue<CrewMemberDetailsState>(
registerFallbackValue(
const CrewMemberDetailsState(crewMember: crewMember),
);
});
Expand Down
2 changes: 0 additions & 2 deletions test/helpers/pump_app.dart
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
1 change: 0 additions & 1 deletion test/home/view/home_page_test.dart
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
25 changes: 18 additions & 7 deletions test/home/widgets/home_page_content_test.dart
Original file line number Diff line number Diff line change
@@ -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<T> extends Fake implements Route<T> {}

void main() {
group('HomePageContent', () {
late MockNavigator navigator;

setUpAll(() {
registerFallbackValue(FakeRoute<RocketsPage>());
registerFallbackValue(FakeRoute<CrewPage>());
});

setUp(() {
navigator = MockNavigator();

when(() => navigator.push(any(that: isRoute<void>())))
.thenAnswer((_) async {});
when(() => navigator.push<RocketsPage>(any(that: isRoute<RocketsPage>())))
.thenAnswer((_) async => null);

when(() => navigator.push(any(that: isRoute<void>())))
.thenAnswer((_) async {});
when(() => navigator.push<CrewPage>(any(that: isRoute<CrewPage>())))
.thenAnswer((_) async => null);
});

testWidgets(
Expand Down Expand Up @@ -63,7 +71,9 @@ void main() {
),
);

verify(() => navigator.push(any(that: isRoute<void>()))).called(1);
verify(() =>
navigator.push<RocketsPage>(any(that: isRoute<RocketsPage>())))
.called(1);
},
);

Expand All @@ -82,7 +92,8 @@ void main() {
),
);

verify(() => navigator.push(any(that: isRoute<void>()))).called(1);
verify(() => navigator.push<CrewPage>(any(that: isRoute<CrewPage>())))
.called(1);
},
);
});
Expand Down
2 changes: 1 addition & 1 deletion test/rocket_details/view/rocket_details_page_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void main() {
});

setUpAll(() {
registerFallbackValue<RocketDetailsState>(
registerFallbackValue(
RocketDetailsState(rocket: rocket),
);
});
Expand Down
10 changes: 7 additions & 3 deletions test/rockets/view/rockets_page_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ class MockRocketRepository extends Mock implements RocketRepository {}
class MockRocketsCubit extends MockCubit<RocketsState> implements RocketsCubit {
}

class FakeRoute<T> extends Fake implements Route<T> {}

void main() {
final rockets = List.generate(
3,
Expand Down Expand Up @@ -63,12 +65,13 @@ void main() {
rocketsCubit = MockRocketsCubit();

navigator = MockNavigator();
when(() => navigator.push(any(that: isRoute<void>())))
when(() => navigator.push<void>(any(that: isRoute<void>())))
.thenAnswer((_) async {});
});

setUpAll(() {
registerFallbackValue<RocketsState>(const RocketsState());
registerFallbackValue(const RocketsState());
registerFallbackValue(FakeRoute<void>());
});

testWidgets('renders empty page when status is initial', (tester) async {
Expand Down Expand Up @@ -176,7 +179,8 @@ void main() {

await tester.tap(find.text(rockets.first.name));

verify(() => navigator.push(any(that: isRoute<void>()))).called(1);
verify(() => navigator.push<void>(any(that: isRoute<void>())))
.called(1);
},
);
});
Expand Down