diff --git a/analysis_options.yaml b/analysis_options.yaml index 07aa1da..c4321c1 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1,4 +1,4 @@ -include: package:very_good_analysis/analysis_options.2.4.0.yaml +include: package:very_good_analysis/analysis_options.5.0.0.yaml linter: rules: public_member_api_docs: false diff --git a/android/app/build.gradle b/android/app/build.gradle index da58ee7..6c36bb6 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -32,7 +32,9 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 30 + namespace "com.example.spacexDemo" + compileSdkVersion flutter.compileSdkVersion + ndkVersion flutter.ndkVersion sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -41,8 +43,10 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.example.spacexDemo" - minSdkVersion 16 - targetSdkVersion 30 + // You can update the following values to match your application needs. + // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. + minSdkVersion flutter.minSdkVersion + targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName } @@ -70,14 +74,17 @@ android { production { dimension "default" applicationIdSuffix "" + manifestPlaceholders = [appName: "SpaceX Demo"] } staging { dimension "default" applicationIdSuffix ".stg" + manifestPlaceholders = [appName: "[STG] SpaceX Demo"] } development { dimension "default" applicationIdSuffix ".dev" + manifestPlaceholders = [appName: "[DEV] SpaceX Demo"] } } @@ -85,7 +92,6 @@ android { release { signingConfig signingConfigs.release minifyEnabled true - useProguard true proguardFiles getDefaultProguardFile('proguard-android.txt') } debug { diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 08639a4..dde6deb 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,10 +1,19 @@ - + + + + + + + - - diff --git a/android/build.gradle b/android/build.gradle index e7e0b02..f7eb7f6 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.3.50' + ext.kotlin_version = '1.7.10' repositories { google() - jcenter() + mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:3.6.3' + classpath 'com.android.tools.build:gradle:7.3.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -14,7 +14,7 @@ buildscript { allprojects { repositories { google() - jcenter() + mavenCentral() } } @@ -26,6 +26,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } diff --git a/android/gradle.properties b/android/gradle.properties index e30ec9d..94adc3a 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,3 +1,3 @@ -org.gradle.jvmargs=-Xmx1024M +org.gradle.jvmargs=-Xmx1536M android.useAndroidX=true android.enableJetifier=true diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index bc6a58a..cfe88f6 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist index f2872cf..4f8d4d2 100644 --- a/ios/Flutter/AppFrameworkInfo.plist +++ b/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 9.0 + 11.0 diff --git a/ios/Podfile b/ios/Podfile index 1e8c3c9..88359b2 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -# platform :ios, '9.0' +# platform :ios, '11.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index febcef1..817a35f 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -168,7 +168,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1210; + LastUpgradeCheck = 1300; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { @@ -212,10 +212,12 @@ /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( @@ -248,6 +250,7 @@ }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 8605956..c87d15a 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ UIViewControllerBasedStatusBarAppearance + LSApplicationQueriesSchemes + + https + + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + diff --git a/lib/app/app.dart b/lib/app/app.dart index 6c8533a..49d833f 100644 --- a/lib/app/app.dart +++ b/lib/app/app.dart @@ -8,12 +8,11 @@ import 'package:spacex_demo/l10n/l10n.dart'; class App extends StatelessWidget { const App({ - Key? key, required RocketRepository rocketRepository, required CrewMemberRepository crewMemberRepository, + super.key, }) : _rocketRepository = rocketRepository, - _crewMemberRepository = crewMemberRepository, - super(key: key); + _crewMemberRepository = crewMemberRepository; final RocketRepository _rocketRepository; final CrewMemberRepository _crewMemberRepository; @@ -31,7 +30,7 @@ class App extends StatelessWidget { } class AppView extends StatelessWidget { - const AppView({Key? key}) : super(key: key); + const AppView({super.key}); @override Widget build(BuildContext context) { @@ -49,8 +48,8 @@ class AppView extends StatelessWidget { ), elevatedButtonTheme: ElevatedButtonThemeData( style: ElevatedButton.styleFrom( - primary: Colors.white, - onPrimary: Colors.black, + foregroundColor: Colors.black, + backgroundColor: Colors.white, ), ), ), diff --git a/lib/crew/view/crew_page.dart b/lib/crew/view/crew_page.dart index e63fb27..f636ee7 100644 --- a/lib/crew/view/crew_page.dart +++ b/lib/crew/view/crew_page.dart @@ -6,11 +6,11 @@ import 'package:spacex_demo/crew_member_details/crew_member_details.dart'; import 'package:spacex_demo/l10n/l10n.dart'; class CrewPage extends StatelessWidget { - const CrewPage({Key? key}) : super(key: key); + const CrewPage({super.key}); - static Route route() { + static Route route() { return MaterialPageRoute( - builder: (context) => const CrewPage(), + builder: (_) => const CrewPage(), ); } @@ -26,7 +26,7 @@ class CrewPage extends StatelessWidget { } class CrewView extends StatelessWidget { - const CrewView({Key? key}) : super(key: key); + const CrewView({super.key}); @override Widget build(BuildContext context) { @@ -44,7 +44,7 @@ class CrewView extends StatelessWidget { } class _Content extends StatelessWidget { - const _Content({Key? key}) : super(key: key); + const _Content(); @override Widget build(BuildContext context) { @@ -75,7 +75,7 @@ class _Content extends StatelessWidget { } class _CrewMembersList extends StatelessWidget { - const _CrewMembersList({Key? key}) : super(key: key); + const _CrewMembersList({super.key}); @override Widget build(BuildContext context) { diff --git a/lib/crew_member_details/view/crew_member_details_page.dart b/lib/crew_member_details/view/crew_member_details_page.dart index e97a90f..3282631 100644 --- a/lib/crew_member_details/view/crew_member_details_page.dart +++ b/lib/crew_member_details/view/crew_member_details_page.dart @@ -7,7 +7,7 @@ import 'package:spacex_demo/l10n/l10n.dart'; import 'package:url_launcher/url_launcher.dart'; class CrewMemberDetailsPage extends StatelessWidget { - const CrewMemberDetailsPage({Key? key}) : super(key: key); + const CrewMemberDetailsPage({super.key}); static Route route({required CrewMember crewMember}) { return MaterialPageRoute( @@ -25,7 +25,7 @@ class CrewMemberDetailsPage extends StatelessWidget { } class CrewMemberDetailsView extends StatelessWidget { - const CrewMemberDetailsView({Key? key}) : super(key: key); + const CrewMemberDetailsView({super.key}); @override Widget build(BuildContext context) { @@ -61,10 +61,10 @@ class CrewMemberDetailsView extends StatelessWidget { 'crewMemberDetailsPage_openWikipedia_elevatedButton', ), onPressed: () async { - final url = crewMember.wikipedia; + final uri = Uri.parse(crewMember.wikipedia); - if (await canLaunch(url)) { - await launch(url); + if (await canLaunchUrl(uri)) { + await launchUrl(uri); } }, child: Text(l10n.openWikipediaButtonText), diff --git a/lib/crew_member_details/widgets/image_header.dart b/lib/crew_member_details/widgets/image_header.dart index 572b27a..1bc9cf4 100644 --- a/lib/crew_member_details/widgets/image_header.dart +++ b/lib/crew_member_details/widgets/image_header.dart @@ -3,7 +3,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:spacex_demo/crew_member_details/cubit/crew_member_details_cubit.dart'; class ImageHeader extends StatelessWidget { - const ImageHeader({Key? key}) : super(key: key); + const ImageHeader({super.key}); @override Widget build(BuildContext context) { diff --git a/lib/crew_member_details/widgets/title_header.dart b/lib/crew_member_details/widgets/title_header.dart index 5eea8e5..caf3e2a 100644 --- a/lib/crew_member_details/widgets/title_header.dart +++ b/lib/crew_member_details/widgets/title_header.dart @@ -4,7 +4,7 @@ import 'package:spacex_demo/crew_member_details/cubit/crew_member_details_cubit. import 'package:spacex_demo/l10n/l10n.dart'; class TitleHeader extends StatelessWidget { - const TitleHeader({Key? key}) : super(key: key); + const TitleHeader({super.key}); @override Widget build(BuildContext context) { @@ -19,7 +19,7 @@ class TitleHeader extends StatelessWidget { children: [ Text( crewMember.name, - style: Theme.of(context).textTheme.headline5, + style: Theme.of(context).textTheme.headlineSmall, ), const SizedBox(width: 4), if (crewMember.status == 'active') diff --git a/lib/home/view/home_page.dart b/lib/home/view/home_page.dart index f9d9f11..8abce9a 100644 --- a/lib/home/view/home_page.dart +++ b/lib/home/view/home_page.dart @@ -3,7 +3,7 @@ import 'package:spacex_demo/home/widgets/home_page_content.dart'; import 'package:spacex_demo/l10n/l10n.dart'; class HomePage extends StatelessWidget { - const HomePage({Key? key}) : super(key: key); + const HomePage({super.key}); @override Widget build(BuildContext context) { diff --git a/lib/home/widgets/home_page_content.dart b/lib/home/widgets/home_page_content.dart index f5f0be3..ab5f262 100644 --- a/lib/home/widgets/home_page_content.dart +++ b/lib/home/widgets/home_page_content.dart @@ -5,7 +5,7 @@ import 'package:spacex_demo/l10n/l10n.dart'; import 'package:spacex_demo/rockets/rockets.dart'; class HomePageContent extends StatelessWidget { - const HomePageContent({Key? key}) : super(key: key); + const HomePageContent({super.key}); @override Widget build(BuildContext context) { diff --git a/lib/home/widgets/spacex_category_card.dart b/lib/home/widgets/spacex_category_card.dart index e10a595..b3578a2 100644 --- a/lib/home/widgets/spacex_category_card.dart +++ b/lib/home/widgets/spacex_category_card.dart @@ -2,11 +2,11 @@ import 'package:flutter/material.dart'; class SpaceXCategoryCard extends StatelessWidget { const SpaceXCategoryCard({ - Key? key, required this.onTap, required this.title, required this.imageUrl, - }) : super(key: key); + super.key, + }); final VoidCallback onTap; final Widget title; @@ -40,7 +40,7 @@ class SpaceXCategoryCard extends StatelessWidget { child: Align( alignment: Alignment.centerLeft, child: DefaultTextStyle.merge( - style: Theme.of(context).textTheme.headline4, + style: Theme.of(context).textTheme.headlineMedium, child: title, ), ), diff --git a/lib/rocket_details/view/rocket_details_page.dart b/lib/rocket_details/view/rocket_details_page.dart index 1b7cdb1..9662c1a 100644 --- a/lib/rocket_details/view/rocket_details_page.dart +++ b/lib/rocket_details/view/rocket_details_page.dart @@ -7,7 +7,7 @@ import 'package:spacex_demo/rocket_details/rocket_details.dart'; import 'package:url_launcher/url_launcher.dart'; class RocketDetailsPage extends StatelessWidget { - const RocketDetailsPage({Key? key}) : super(key: key); + const RocketDetailsPage({super.key}); static Route route({required Rocket rocket}) { return MaterialPageRoute( @@ -25,7 +25,7 @@ class RocketDetailsPage extends StatelessWidget { } class RocketDetailsView extends StatelessWidget { - const RocketDetailsView({Key? key}) : super(key: key); + const RocketDetailsView({super.key}); @override Widget build(BuildContext context) { @@ -75,10 +75,10 @@ class RocketDetailsView extends StatelessWidget { 'rocketDetailsPage_openWikipedia_elevatedButton', ), onPressed: () async { - final url = rocket.wikipedia!; + final uri = Uri.parse(rocket.wikipedia!); - if (await canLaunch(url)) { - await launch(url); + if (await canLaunchUrl(uri)) { + await launchUrl(uri); } }, child: Text(l10n.openWikipediaButtonText), @@ -92,7 +92,7 @@ class RocketDetailsView extends StatelessWidget { } class _ImageHeader extends StatelessWidget { - const _ImageHeader({Key? key}) : super(key: key); + const _ImageHeader({super.key}); @override Widget build(BuildContext context) { @@ -118,7 +118,7 @@ class _ImageHeader extends StatelessWidget { } class _TitleHeader extends StatelessWidget { - const _TitleHeader({Key? key}) : super(key: key); + const _TitleHeader({super.key}); @override Widget build(BuildContext context) { @@ -132,7 +132,7 @@ class _TitleHeader extends StatelessWidget { children: [ Text( rocket.name, - style: Theme.of(context).textTheme.headline5, + style: Theme.of(context).textTheme.headlineSmall, ), if (rocket.active != null) ...[ const SizedBox(width: 4), diff --git a/lib/rockets/view/rockets_page.dart b/lib/rockets/view/rockets_page.dart index 5df65d8..efe8972 100644 --- a/lib/rockets/view/rockets_page.dart +++ b/lib/rockets/view/rockets_page.dart @@ -6,11 +6,11 @@ import 'package:spacex_demo/rocket_details/rocket_details.dart'; import 'package:spacex_demo/rockets/rockets.dart'; class RocketsPage extends StatelessWidget { - const RocketsPage({Key? key}) : super(key: key); + const RocketsPage({super.key}); - static Route route() { + static Route route() { return MaterialPageRoute( - builder: (context) => const RocketsPage(), + builder: (_) => const RocketsPage(), ); } @@ -26,7 +26,7 @@ class RocketsPage extends StatelessWidget { } class RocketsView extends StatelessWidget { - const RocketsView({Key? key}) : super(key: key); + const RocketsView({super.key}); @override Widget build(BuildContext context) { @@ -44,38 +44,34 @@ class RocketsView extends StatelessWidget { } class _Content extends StatelessWidget { - const _Content({Key? key}) : super(key: key); + const _Content(); @override Widget build(BuildContext context) { final l10n = context.l10n; final status = context.select((RocketsCubit cubit) => cubit.state.status); - switch (status) { - case RocketsStatus.initial: - return const SizedBox( + return switch (status) { + RocketsStatus.initial => const SizedBox( key: Key('rocketsView_initial_sizedBox'), - ); - case RocketsStatus.loading: - return const Center( + ), + RocketsStatus.loading => const Center( key: Key('rocketsView_loading_indicator'), child: CircularProgressIndicator.adaptive(), - ); - case RocketsStatus.failure: - return Center( + ), + RocketsStatus.failure => Center( key: const Key('rocketsView_failure_text'), child: Text(l10n.rocketsFetchErrorMessage), - ); - case RocketsStatus.success: - return const _RocketList( + ), + RocketsStatus.success => const _RocketList( key: Key('rocketsView_success_rocketList'), - ); - } + ) + }; } } class _RocketList extends StatelessWidget { - const _RocketList({Key? key}) : super(key: key); + const _RocketList({super.key}); @override Widget build(BuildContext context) { diff --git a/packages/crew_member_repository/analysis_options.yaml b/packages/crew_member_repository/analysis_options.yaml index 4106956..b388541 100644 --- a/packages/crew_member_repository/analysis_options.yaml +++ b/packages/crew_member_repository/analysis_options.yaml @@ -1 +1 @@ -include: package:very_good_analysis/analysis_options.2.3.0.yaml \ No newline at end of file +include: package:very_good_analysis/analysis_options.5.0.0.yaml diff --git a/packages/crew_member_repository/lib/crew_member_repository.dart b/packages/crew_member_repository/lib/crew_member_repository.dart index 16023ea..014446b 100644 --- a/packages/crew_member_repository/lib/crew_member_repository.dart +++ b/packages/crew_member_repository/lib/crew_member_repository.dart @@ -1,3 +1 @@ -library crew_member_repository; - export 'src/crew_member_repository.dart'; diff --git a/packages/crew_member_repository/pubspec.yaml b/packages/crew_member_repository/pubspec.yaml index 57cd45d..432ad7e 100644 --- a/packages/crew_member_repository/pubspec.yaml +++ b/packages/crew_member_repository/pubspec.yaml @@ -4,14 +4,14 @@ version: 1.0.0+1 publish_to: none environment: - sdk: ">=2.13.0 <3.0.0" + sdk: '>=3.0.0 <4.0.0' dependencies: spacex_api: path: ../spacex_api dev_dependencies: - coverage: ^1.0.2 - mocktail: ^0.1.1 - test: ^1.17.0 - very_good_analysis: ^2.3.0 \ No newline at end of file + coverage: ^1.6.3 + mocktail: ^0.3.0 + test: ^1.24.4 + very_good_analysis: ^5.0.0+1 diff --git a/packages/rocket_repository/analysis_options.yaml b/packages/rocket_repository/analysis_options.yaml index 5323532..b388541 100644 --- a/packages/rocket_repository/analysis_options.yaml +++ b/packages/rocket_repository/analysis_options.yaml @@ -1 +1 @@ -include: package:very_good_analysis/analysis_options.2.3.0.yaml +include: package:very_good_analysis/analysis_options.5.0.0.yaml diff --git a/packages/rocket_repository/example/analysis_options.yaml b/packages/rocket_repository/example/analysis_options.yaml index b7d6ef8..0e6ebf7 100644 --- a/packages/rocket_repository/example/analysis_options.yaml +++ b/packages/rocket_repository/example/analysis_options.yaml @@ -1,4 +1,4 @@ -include: package:very_good_analysis/analysis_options.2.3.0.yaml +include: package:very_good_analysis/analysis_options.5.0.0.yaml linter: rules: public_member_api_docs: false diff --git a/packages/rocket_repository/example/pubspec.yaml b/packages/rocket_repository/example/pubspec.yaml index b994d4a..f19afc4 100644 --- a/packages/rocket_repository/example/pubspec.yaml +++ b/packages/rocket_repository/example/pubspec.yaml @@ -4,11 +4,11 @@ version: 1.0.0+1 publish_to: none environment: - sdk: ">=2.12.0-0 <3.0.0" + sdk: '>=3.0.0 <4.0.0' dependencies: rocket_repository: path: ../ dev_dependencies: - very_good_analysis: ^2.3.0 + very_good_analysis: ^5.0.0+1 diff --git a/packages/rocket_repository/lib/rocket_repository.dart b/packages/rocket_repository/lib/rocket_repository.dart index 660a26e..841a420 100644 --- a/packages/rocket_repository/lib/rocket_repository.dart +++ b/packages/rocket_repository/lib/rocket_repository.dart @@ -1,3 +1 @@ -library rocket_repository; - export 'src/rocket_repository.dart'; diff --git a/packages/rocket_repository/pubspec.yaml b/packages/rocket_repository/pubspec.yaml index f2f347e..ac72e43 100644 --- a/packages/rocket_repository/pubspec.yaml +++ b/packages/rocket_repository/pubspec.yaml @@ -4,14 +4,14 @@ version: 1.0.0+1 publish_to: none environment: - sdk: ">=2.12.0-0 <3.0.0" + sdk: '>=3.0.0 <4.0.0' dependencies: spacex_api: path: ../spacex_api dev_dependencies: - coverage: ^1.0.3 - mocktail: ^0.1.4 - test: ^1.17.12 - very_good_analysis: ^2.3.0 + coverage: ^1.6.3 + mocktail: ^0.3.0 + test: ^1.24.4 + very_good_analysis: ^5.0.0+1 diff --git a/packages/rocket_repository/test/rocket_repository_test.dart b/packages/rocket_repository/test/rocket_repository_test.dart index 4c946b1..02f1641 100644 --- a/packages/rocket_repository/test/rocket_repository_test.dart +++ b/packages/rocket_repository/test/rocket_repository_test.dart @@ -32,7 +32,7 @@ void main() { test('constructor returns normally', () { expect( - () => RocketRepository(), + RocketRepository.new, returnsNormally, ); }); diff --git a/packages/spacex_api/analysis_options.yaml b/packages/spacex_api/analysis_options.yaml index 0d6daf3..3ceb5c7 100644 --- a/packages/spacex_api/analysis_options.yaml +++ b/packages/spacex_api/analysis_options.yaml @@ -1,4 +1,4 @@ -include: package:very_good_analysis/analysis_options.2.3.0.yaml +include: package:very_good_analysis/analysis_options.5.0.0.yaml analyzer: exclude: - - lib/**/*.g.dart \ No newline at end of file + - lib/**/*.g.dart diff --git a/packages/spacex_api/example/analysis_options.yaml b/packages/spacex_api/example/analysis_options.yaml index b7d6ef8..0e6ebf7 100644 --- a/packages/spacex_api/example/analysis_options.yaml +++ b/packages/spacex_api/example/analysis_options.yaml @@ -1,4 +1,4 @@ -include: package:very_good_analysis/analysis_options.2.3.0.yaml +include: package:very_good_analysis/analysis_options.5.0.0.yaml linter: rules: public_member_api_docs: false diff --git a/packages/spacex_api/example/pubspec.yaml b/packages/spacex_api/example/pubspec.yaml index dc00a71..2d9eb5f 100644 --- a/packages/spacex_api/example/pubspec.yaml +++ b/packages/spacex_api/example/pubspec.yaml @@ -4,11 +4,11 @@ version: 1.0.0+1 publish_to: none environment: - sdk: ">=2.12.0-0 <3.0.0" + sdk: '>=3.0.0 <4.0.0' dependencies: spacex_api: path: ../ dev_dependencies: - very_good_analysis: ^2.3.0 + very_good_analysis: ^5.0.0+1 diff --git a/packages/spacex_api/lib/spacex_api.dart b/packages/spacex_api/lib/spacex_api.dart index 83b0b57..0de9c2c 100644 --- a/packages/spacex_api/lib/spacex_api.dart +++ b/packages/spacex_api/lib/spacex_api.dart @@ -1,4 +1,2 @@ -library spacex_api; - export 'src/models/models.dart'; export 'src/spacex_api_client.dart'; diff --git a/packages/spacex_api/lib/src/spacex_api_client.dart b/packages/spacex_api/lib/src/spacex_api_client.dart index 524fd7e..ddf4d19 100644 --- a/packages/spacex_api/lib/src/spacex_api_client.dart +++ b/packages/spacex_api/lib/src/spacex_api_client.dart @@ -66,8 +66,9 @@ class SpaceXApiClient { try { return responseBody - .map((dynamic item) => - CrewMember.fromJson(item as Map)) + .map( + (dynamic item) => CrewMember.fromJson(item as Map), + ) .toList(); } catch (_) { throw JsonDeserializationException(); diff --git a/packages/spacex_api/pubspec.yaml b/packages/spacex_api/pubspec.yaml index 5327b60..55f4c25 100644 --- a/packages/spacex_api/pubspec.yaml +++ b/packages/spacex_api/pubspec.yaml @@ -4,18 +4,18 @@ version: 1.0.0+1 publish_to: none environment: - sdk: ">=2.12.0-0 <3.0.0" + sdk: '>=3.0.0 <4.0.0' dependencies: - equatable: ^2.0.3 - http: ^0.13.3 - json_annotation: ^4.1.0 + equatable: ^2.0.5 + http: ^1.1.0 + json_annotation: ^4.8.1 + meta: ^1.9.1 dev_dependencies: - build_runner: ^2.1.2 - coverage: ^1.0.3 - json_serializable: ^4.1.4 - meta: ^1.7.0 - mocktail: ^0.1.4 - test: ^1.17.12 - very_good_analysis: ^2.3.0 + build_runner: ^2.4.6 + coverage: ^1.6.3 + json_serializable: ^6.7.1 + mocktail: ^0.3.0 + test: ^1.24.4 + very_good_analysis: ^5.0.0+1 diff --git a/packages/spacex_api/test/spacex_api_client_test.dart b/packages/spacex_api/test/spacex_api_client_test.dart index aa35b99..87cc73b 100644 --- a/packages/spacex_api/test/spacex_api_client_test.dart +++ b/packages/spacex_api/test/spacex_api_client_test.dart @@ -50,7 +50,7 @@ void main() { test('constructor returns normally', () { expect( - () => SpaceXApiClient(), + SpaceXApiClient.new, returnsNormally, ); }); diff --git a/pubspec.lock b/pubspec.lock index 78aa478..2947e41 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,100 +5,98 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - url: "https://pub.dartlang.org" + sha256: ae92f5d747aee634b87f89d9946000c2de774be1d6ac3e58268224348cd0101a + url: "https://pub.dev" source: hosted - version: "26.0.0" + version: "61.0.0" analyzer: dependency: transitive description: name: analyzer - url: "https://pub.dartlang.org" + sha256: ea3d8652bda62982addfd92fdc2d0214e5f82e43325104990d4f4c4a2a313562 + url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "5.13.0" args: dependency: transitive description: name: args - url: "https://pub.dartlang.org" + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.4.2" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.8.1" + version: "2.11.0" bloc: dependency: "direct main" description: name: bloc - url: "https://pub.dartlang.org" + sha256: "3820f15f502372d979121de1f6b97bfcf1630ebff8fe1d52fb2b0bfa49be5b49" + url: "https://pub.dev" source: hosted - version: "7.2.1" + version: "8.1.2" bloc_test: dependency: "direct dev" description: name: bloc_test - url: "https://pub.dartlang.org" + sha256: "43d5b2f3d09ba768d6b611151bdf20ca141ffb46e795eb9550a58c9c2f4eae3f" + url: "https://pub.dev" source: hosted - version: "8.2.0" + version: "9.1.3" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" 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" + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" 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" + version: "1.3.0" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + url: "https://pub.dev" source: hosted - version: "1.15.0" + version: "1.17.1" convert: dependency: transitive description: name: convert - url: "https://pub.dartlang.org" + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.1.1" coverage: dependency: transitive description: name: coverage - url: "https://pub.dartlang.org" + sha256: "2fb815080e44a09b85e0f2ca8a820b15053982b2e714b59267719e8a9ff17097" + url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.6.3" crew_member_repository: dependency: "direct main" description: @@ -110,30 +108,42 @@ packages: dependency: transitive description: name: crypto - url: "https://pub.dartlang.org" + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + url: "https://pub.dev" source: hosted - version: "3.0.1" - equatable: + version: "3.0.3" + diff_match_patch: dependency: transitive + description: + name: diff_match_patch + sha256: "2efc9e6e8f449d0abe15be240e2c2a3bcd977c8d126cfd70598aee60af35c0a4" + url: "https://pub.dev" + source: hosted + version: "0.4.1" + equatable: + dependency: "direct main" description: name: equatable - url: "https://pub.dartlang.org" + sha256: c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2 + url: "https://pub.dev" source: hosted - version: "2.0.3" + version: "2.0.5" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.1" file: dependency: transitive description: name: file - url: "https://pub.dartlang.org" + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + url: "https://pub.dev" source: hosted - version: "6.1.2" + version: "7.0.0" flutter: dependency: "direct main" description: flutter @@ -143,9 +153,10 @@ packages: dependency: "direct main" description: name: flutter_bloc - url: "https://pub.dartlang.org" + sha256: e74efb89ee6945bcbce74a5b3a5a3376b088e5f21f55c263fc38cbdc6237faae + url: "https://pub.dev" source: hosted - version: "7.3.0" + version: "8.1.3" flutter_localizations: dependency: "direct main" description: flutter @@ -165,177 +176,202 @@ packages: dependency: transitive description: name: frontend_server_client - url: "https://pub.dartlang.org" + sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" + url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "3.2.0" glob: dependency: transitive description: name: glob - url: "https://pub.dartlang.org" + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.1.2" http: dependency: transitive description: name: http - url: "https://pub.dartlang.org" + sha256: "759d1a329847dd0f39226c688d3e06a6b8679668e350e2891a6474f8b4bb8525" + url: "https://pub.dev" source: hosted - version: "0.13.3" + version: "1.1.0" http_multi_server: dependency: transitive description: name: http_multi_server - url: "https://pub.dartlang.org" + sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" + url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.2.1" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.dartlang.org" + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "4.0.2" intl: dependency: "direct main" description: name: intl - url: "https://pub.dartlang.org" + sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6 + url: "https://pub.dev" source: hosted - version: "0.17.0" + version: "0.18.0" io: dependency: transitive description: name: io - url: "https://pub.dartlang.org" + sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" + url: "https://pub.dev" source: hosted - version: "1.0.3" + version: "1.0.4" js: dependency: transitive description: name: js - url: "https://pub.dartlang.org" + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" source: hosted - version: "0.6.3" + version: "0.6.7" json_annotation: dependency: transitive description: name: json_annotation - url: "https://pub.dartlang.org" + sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 + url: "https://pub.dev" source: hosted - version: "4.1.0" + version: "4.8.1" logging: dependency: transitive description: name: logging - url: "https://pub.dartlang.org" + sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" + url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "1.2.0" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + url: "https://pub.dev" source: hosted - version: "0.12.10" + version: "0.12.15" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" + source: hosted + version: "0.2.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" source: hosted - version: "1.7.0" + version: "1.9.1" mime: dependency: transitive description: name: mime - url: "https://pub.dartlang.org" + sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e + url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.0.4" mockingjay: dependency: "direct dev" description: name: mockingjay - url: "https://pub.dartlang.org" + sha256: c31b9850139a2a54d6bcfa02af022a8b15bf7c0bb83b0d5881e001e396fa91de + url: "https://pub.dev" source: hosted - version: "0.1.1" + version: "0.3.0" mocktail: dependency: "direct dev" description: name: mocktail - url: "https://pub.dartlang.org" + sha256: "80a996cd9a69284b3dc521ce185ffe9150cde69767c2d3a0720147d93c0cef53" + url: "https://pub.dev" 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" + sha256: a13cb88a8e199c797ad9ddce80880821781c164a9693ddb58104c07915f60877 + url: "https://pub.dev" source: hosted - version: "0.1.0" + version: "0.3.1" nested: dependency: transitive description: name: nested - url: "https://pub.dartlang.org" + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" source: hosted version: "1.0.0" node_preamble: dependency: transitive description: name: node_preamble - url: "https://pub.dartlang.org" + sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db" + url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.0.2" package_config: dependency: transitive description: name: package_config - url: "https://pub.dartlang.org" + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.1.0" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" 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.3" plugin_platform_interface: dependency: "direct dev" description: name: plugin_platform_interface - url: "https://pub.dartlang.org" + sha256: "43798d895c929056255600343db8f049921cbec94d31ec87f1dc5c16c01935dd" + url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.1.5" pool: dependency: transitive description: name: pool - url: "https://pub.dartlang.org" + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" source: hosted - version: "1.5.0" + version: "1.5.1" provider: dependency: transitive description: name: provider - url: "https://pub.dartlang.org" + sha256: cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f + url: "https://pub.dev" source: hosted - version: "6.0.1" + version: "6.0.5" pub_semver: dependency: transitive description: name: pub_semver - url: "https://pub.dartlang.org" + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.4" rocket_repository: dependency: "direct main" description: @@ -347,30 +383,34 @@ packages: dependency: transitive description: name: shelf - url: "https://pub.dartlang.org" + sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.4.1" shelf_packages_handler: dependency: transitive description: name: shelf_packages_handler - url: "https://pub.dartlang.org" + sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e" + url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "3.0.2" shelf_static: dependency: transitive description: name: shelf_static - url: "https://pub.dartlang.org" + sha256: a41d3f53c4adf0f57480578c1d61d90342cd617de7fc8077b1304643c2d85c1e + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.2" shelf_web_socket: dependency: transitive description: name: shelf_web_socket - url: "https://pub.dartlang.org" + sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" + url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.0.4" sky_engine: dependency: transitive description: flutter @@ -380,23 +420,26 @@ packages: dependency: transitive description: name: source_map_stack_trace - url: "https://pub.dartlang.org" + sha256: "84cf769ad83aa6bb61e0aa5a18e53aea683395f196a6f39c4c881fb90ed4f7ae" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" source_maps: dependency: transitive description: name: source_maps - url: "https://pub.dartlang.org" + sha256: "708b3f6b97248e5781f493b765c3337db11c5d2c81c3094f10904bfa8004c703" + url: "https://pub.dev" source: hosted - version: "0.10.10" + version: "0.10.12" source_span: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" source: hosted - version: "1.8.1" + version: "1.9.1" spacex_api: dependency: "direct main" description: @@ -408,149 +451,186 @@ packages: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.2.1" test: dependency: transitive description: name: test - url: "https://pub.dartlang.org" + sha256: "3dac9aecf2c3991d09b9cdde4f98ded7b30804a88a0d7e4e7e1678e78d6b97f4" + url: "https://pub.dev" source: hosted - version: "1.17.10" + version: "1.24.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + url: "https://pub.dev" source: hosted - version: "0.4.2" + version: "0.5.1" test_core: dependency: transitive description: name: test_core - url: "https://pub.dartlang.org" + sha256: "5138dbffb77b2289ecb12b81c11ba46036590b72a64a7a90d6ffb880f1a29e93" + url: "https://pub.dev" source: hosted - version: "0.4.0" + version: "0.5.1" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.3.2" url_launcher: dependency: "direct main" description: name: url_launcher - url: "https://pub.dartlang.org" + sha256: "781bd58a1eb16069412365c98597726cd8810ae27435f04b3b4d3a470bacd61e" + url: "https://pub.dev" source: hosted - version: "6.0.12" + version: "6.1.12" + url_launcher_android: + dependency: transitive + description: + name: url_launcher_android + sha256: "78cb6dea3e93148615109e58e42c35d1ffbf5ef66c44add673d0ab75f12ff3af" + url: "https://pub.dev" + source: hosted + version: "6.0.37" + url_launcher_ios: + dependency: transitive + description: + name: url_launcher_ios + sha256: "9af7ea73259886b92199f9e42c116072f05ff9bea2dcb339ab935dfc957392c2" + url: "https://pub.dev" + source: hosted + version: "6.1.4" url_launcher_linux: dependency: transitive description: name: url_launcher_linux - url: "https://pub.dartlang.org" + sha256: "207f4ddda99b95b4d4868320a352d374b0b7e05eefad95a4a26f57da413443f5" + url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "3.0.5" url_launcher_macos: dependency: transitive description: name: url_launcher_macos - url: "https://pub.dartlang.org" + sha256: "1c4fdc0bfea61a70792ce97157e5cc17260f61abbe4f39354513f39ec6fd73b1" + url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "3.0.6" url_launcher_platform_interface: dependency: "direct dev" description: name: url_launcher_platform_interface - url: "https://pub.dartlang.org" + sha256: bfdfa402f1f3298637d71ca8ecfe840b4696698213d5346e9d12d4ab647ee2ea + url: "https://pub.dev" source: hosted - version: "2.0.4" + version: "2.1.3" url_launcher_web: dependency: transitive description: name: url_launcher_web - url: "https://pub.dartlang.org" + sha256: cc26720eefe98c1b71d85f9dc7ef0cada5132617046369d9dc296b3ecaa5cbb4 + url: "https://pub.dev" source: hosted - version: "2.0.4" + version: "2.0.18" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - url: "https://pub.dartlang.org" + sha256: "7967065dd2b5fccc18c653b97958fdf839c5478c28e767c61ee879f4e7882422" + url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "3.0.7" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.4" very_good_analysis: dependency: "direct dev" description: name: very_good_analysis - url: "https://pub.dartlang.org" + sha256: "5e4ea72d2a9188630f0dd8f120a541de730090ef8863243fedca8267a84508b8" + url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "5.0.0+1" vm_service: dependency: transitive description: name: vm_service - url: "https://pub.dartlang.org" + sha256: ada49637c27973c183dad90beb6bd781eea4c9f5f955d35da172de0af7bd3440 + url: "https://pub.dev" source: hosted - version: "6.2.0" + version: "11.8.0" watcher: dependency: transitive description: name: watcher - url: "https://pub.dartlang.org" + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.1.0" web_socket_channel: dependency: transitive description: name: web_socket_channel - url: "https://pub.dartlang.org" + sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.4.0" webkit_inspection_protocol: dependency: transitive description: name: webkit_inspection_protocol - url: "https://pub.dartlang.org" + sha256: "67d3a8b6c79e1987d19d848b0892e582dbb0c66c57cc1fef58a177dd2aa2823d" + url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.2.0" yaml: dependency: transitive description: name: yaml - url: "https://pub.dartlang.org" + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.1.2" sdks: - dart: ">=2.14.0 <3.0.0" - flutter: ">=2.5.0" + dart: ">=3.0.0 <4.0.0" + flutter: ">=3.10.0" diff --git a/pubspec.yaml b/pubspec.yaml index 2a8dcc1..5b432d2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -6,34 +6,35 @@ homepage: https://github.com/VGVentures/spacex_demo publish_to: none environment: - sdk: ">=2.14.0-0 <3.0.0" + sdk: '>=3.0.0 <4.0.0' dependencies: - bloc: ^7.2.1 + bloc: ^8.1.2 crew_member_repository: path: packages/crew_member_repository + equatable: ^2.0.5 flutter: sdk: flutter - flutter_bloc: ^7.3.0 + flutter_bloc: ^8.1.3 flutter_localizations: sdk: flutter - intl: ^0.17.0 + intl: ^0.18.0 rocket_repository: path: packages/rocket_repository spacex_api: path: packages/spacex_api - url_launcher: ^6.0.12 + url_launcher: ^6.1.12 dev_dependencies: - bloc_test: ^8.2.0 + bloc_test: ^9.1.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.5 + url_launcher_platform_interface: ^2.1.3 + very_good_analysis: ^5.0.0+1 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..346680a 100644 --- a/test/crew/view/crew_page_test.dart +++ b/test/crew/view/crew_page_test.dart @@ -66,13 +66,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 +184,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..09c494d 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 @@ -15,7 +15,7 @@ import '../../helpers/helpers.dart'; class MockCrewMemberDetailsCubit extends MockCubit implements CrewMemberDetailsCubit {} -class MockUrlLauncherPlatorm extends Mock +class MockUrlLauncherPlatform extends Mock with MockPlatformInterfaceMixin implements UrlLauncherPlatform {} @@ -39,28 +39,18 @@ void main() { when(() => crewMemberDetailsCubit.state) .thenReturn(const CrewMemberDetailsState(crewMember: crewMember)); - urlLauncherPlatform = MockUrlLauncherPlatorm(); + urlLauncherPlatform = MockUrlLauncherPlatform(); UrlLauncherPlatform.instance = urlLauncherPlatform; when(() => urlLauncherPlatform.canLaunch(any())) .thenAnswer((_) async => true); when( - () => urlLauncherPlatform.launch( - any(), - useSafariVC: any(named: 'useSafariVC'), - useWebView: any(named: 'useWebView'), - enableJavaScript: any(named: 'enableJavaScript'), - enableDomStorage: any(named: 'enableDomStorage'), - universalLinksOnly: any(named: 'universalLinksOnly'), - headers: any(named: 'headers'), - webOnlyWindowName: any(named: 'webOnlyWindowName'), - ), + () => urlLauncherPlatform.launchUrl(any(), any()), ).thenAnswer((_) async => true); }); setUpAll(() { - registerFallbackValue( - const CrewMemberDetailsState(crewMember: crewMember), - ); + registerFallbackValue(const CrewMemberDetailsState(crewMember: crewMember)); + registerFallbackValue(const LaunchOptions()); }); group('CrewMemberDetailsPage', () { @@ -236,14 +226,9 @@ void main() { verify(() => urlLauncherPlatform.canLaunch(crewMember.wikipedia)) .called(1); verify( - () => urlLauncherPlatform.launch( + () => urlLauncherPlatform.launchUrl( crewMember.wikipedia, - useSafariVC: true, - useWebView: false, - enableJavaScript: false, - enableDomStorage: false, - universalLinksOnly: false, - headers: const {}, + any(), ), ).called(1); }, 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..bc26c27 100644 --- a/test/home/widgets/home_page_content_test.dart +++ b/test/home/widgets/home_page_content_test.dart @@ -1,7 +1,6 @@ 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/home/widgets/home_page_content.dart'; import 'package:spacex_demo/home/widgets/spacex_category_card.dart'; @@ -15,9 +14,11 @@ void main() { navigator = MockNavigator(); when(() => navigator.push(any(that: isRoute()))) - .thenAnswer((_) async {}); + .thenAnswer((_) async { + return null; + }); - when(() => navigator.push(any(that: isRoute()))) + when(() => navigator.push(any(that: isRoute()))) .thenAnswer((_) async {}); }); @@ -63,7 +64,8 @@ void main() { ), ); - verify(() => navigator.push(any(that: isRoute()))).called(1); + verify(() => navigator.push(any(that: isRoute()))) + .called(1); }, ); @@ -82,7 +84,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..147c02f 100644 --- a/test/rocket_details/view/rocket_details_page_test.dart +++ b/test/rocket_details/view/rocket_details_page_test.dart @@ -14,7 +14,7 @@ import '../../helpers/helpers.dart'; class MockRocketDetailsCubit extends MockCubit implements RocketDetailsCubit {} -class MockUrlLauncherPlatorm extends Mock +class MockUrlLauncherPlatform extends Mock with MockPlatformInterfaceMixin implements UrlLauncherPlatform {} @@ -41,28 +41,18 @@ void main() { RocketDetailsState(rocket: rocket), ); - urlLauncherPlatform = MockUrlLauncherPlatorm(); + urlLauncherPlatform = MockUrlLauncherPlatform(); UrlLauncherPlatform.instance = urlLauncherPlatform; when(() => urlLauncherPlatform.canLaunch(any())) .thenAnswer((_) async => true); when( - () => urlLauncherPlatform.launch( - any(), - useSafariVC: any(named: 'useSafariVC'), - useWebView: any(named: 'useWebView'), - enableJavaScript: any(named: 'enableJavaScript'), - enableDomStorage: any(named: 'enableDomStorage'), - universalLinksOnly: any(named: 'universalLinksOnly'), - headers: any(named: 'headers'), - webOnlyWindowName: any(named: 'webOnlyWindowName'), - ), + () => urlLauncherPlatform.launchUrl(any(), any()), ).thenAnswer((_) async => true); }); setUpAll(() { - registerFallbackValue( - RocketDetailsState(rocket: rocket), - ); + registerFallbackValue(RocketDetailsState(rocket: rocket)); + registerFallbackValue(const LaunchOptions()); }); group('RocketDetailsPage', () { @@ -259,15 +249,7 @@ void main() { verify(() => urlLauncherPlatform.canLaunch(rocket.wikipedia!)) .called(1); verify( - () => urlLauncherPlatform.launch( - rocket.wikipedia!, - useSafariVC: true, - useWebView: false, - enableJavaScript: false, - enableDomStorage: false, - universalLinksOnly: false, - headers: const {}, - ), + () => urlLauncherPlatform.launchUrl(rocket.wikipedia!, any()), ).called(1); }, ); diff --git a/test/rockets/view/rockets_page_test.dart b/test/rockets/view/rockets_page_test.dart index c5cb415..bb6b3cf 100644 --- a/test/rockets/view/rockets_page_test.dart +++ b/test/rockets/view/rockets_page_test.dart @@ -11,8 +11,8 @@ import '../../helpers/helpers.dart'; class MockRocketRepository extends Mock implements RocketRepository {} -class MockRocketsCubit extends MockCubit implements RocketsCubit { -} +class MockRocketsCubit extends MockCubit + implements RocketsCubit {} void main() { final rockets = List.generate( @@ -63,12 +63,12 @@ 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()); }); testWidgets('renders empty page when status is initial', (tester) async { @@ -176,7 +176,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); }, ); }); diff --git a/web/index.html b/web/index.html index f2bfbf1..42a47b6 100644 --- a/web/index.html +++ b/web/index.html @@ -1,45 +1,107 @@ - - - - - - - - - - - - - - - - - - SpaceX Demo - - - - - - - - + scriptLoaded = true; + var scriptTag = document.createElement('script'); + scriptTag.src = 'main.dart.js'; + scriptTag.type = 'application/javascript'; + document.body.append(scriptTag); + } + + if ('serviceWorker' in navigator) { + // Service workers are supported. Use them. + window.addEventListener('load', function () { + // Wait for registration to finish before dropping the + + + \ No newline at end of file