From 4e19545963a6d2641f071f3b2aa42e1fd6785d5a Mon Sep 17 00:00:00 2001 From: Filip Hracek Date: Thu, 12 May 2022 17:24:02 +0200 Subject: [PATCH] Upgrade to latest (#1262) --- .../lib/src/ads/banner_ad_widget.dart | 6 ++- .../lib/src/app_lifecycle/app_lifecycle.dart | 2 +- game_template/pubspec.lock | 46 +++++++++---------- game_template/pubspec.yaml | 2 +- 4 files changed, 30 insertions(+), 26 deletions(-) diff --git a/game_template/lib/src/ads/banner_ad_widget.dart b/game_template/lib/src/ads/banner_ad_widget.dart index 39301c7d5..3d4ea90c6 100644 --- a/game_template/lib/src/ads/banner_ad_widget.dart +++ b/game_template/lib/src/ads/banner_ad_widget.dart @@ -34,7 +34,7 @@ class BannerAdWidget extends StatefulWidget { const BannerAdWidget({Key? key}) : super(key: key); @override - _BannerAdWidgetState createState() => _BannerAdWidgetState(); + State createState() => _BannerAdWidgetState(); } class _BannerAdWidgetState extends State { @@ -111,6 +111,8 @@ class _BannerAdWidgetState extends State { _adLoadingState = _LoadingState.disposing; await _bannerAd?.dispose(); _log.fine('_bannerAd disposed'); + if (!mounted) return; + setState(() { _bannerAd = null; _adLoadingState = _LoadingState.loading; @@ -133,6 +135,8 @@ class _BannerAdWidgetState extends State { size = AdSize.mediumRectangle; } + if (!mounted) return; + assert(Platform.isAndroid || Platform.isIOS, 'AdMob currently does not support ${Platform.operatingSystem}'); _bannerAd = BannerAd( diff --git a/game_template/lib/src/app_lifecycle/app_lifecycle.dart b/game_template/lib/src/app_lifecycle/app_lifecycle.dart index b52d83431..52dd1f30a 100644 --- a/game_template/lib/src/app_lifecycle/app_lifecycle.dart +++ b/game_template/lib/src/app_lifecycle/app_lifecycle.dart @@ -12,7 +12,7 @@ class AppLifecycleObserver extends StatefulWidget { const AppLifecycleObserver({required this.child, Key? key}) : super(key: key); @override - _AppLifecycleObserverState createState() => _AppLifecycleObserverState(); + State createState() => _AppLifecycleObserverState(); } class _AppLifecycleObserverState extends State diff --git a/game_template/pubspec.lock b/game_template/pubspec.lock index 434156df3..edc0510b1 100644 --- a/game_template/pubspec.lock +++ b/game_template/pubspec.lock @@ -28,7 +28,7 @@ packages: name: args url: "https://pub.dartlang.org" source: hosted - version: "2.3.0" + version: "2.3.1" async: dependency: transitive description: @@ -91,7 +91,7 @@ packages: name: coverage url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" crypto: dependency: transitive description: @@ -180,7 +180,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_test: dependency: "direct dev" description: flutter @@ -267,14 +267,14 @@ packages: name: in_app_purchase url: "https://pub.dartlang.org" source: hosted - version: "3.0.2" + version: "3.0.4" in_app_purchase_android: dependency: transitive description: name: in_app_purchase_android url: "https://pub.dartlang.org" source: hosted - version: "0.2.2+2" + version: "0.2.2+5" in_app_purchase_platform_interface: dependency: transitive description: @@ -288,7 +288,7 @@ packages: name: in_app_purchase_storekit url: "https://pub.dartlang.org" source: hosted - version: "0.3.0+4" + version: "0.3.0+7" io: dependency: transitive description: @@ -316,7 +316,7 @@ packages: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" logging: dependency: "direct main" description: @@ -386,49 +386,49 @@ packages: name: path_provider url: "https://pub.dartlang.org" source: hosted - version: "2.0.9" + version: "2.0.10" path_provider_android: dependency: transitive description: name: path_provider_android url: "https://pub.dartlang.org" source: hosted - version: "2.0.13" + version: "2.0.14" path_provider_ios: dependency: transitive description: name: path_provider_ios url: "https://pub.dartlang.org" source: hosted - version: "2.0.8" + version: "2.0.9" path_provider_linux: dependency: transitive description: name: path_provider_linux url: "https://pub.dartlang.org" source: hosted - version: "2.1.5" + version: "2.1.6" path_provider_macos: dependency: transitive description: name: path_provider_macos url: "https://pub.dartlang.org" source: hosted - version: "2.0.5" + version: "2.0.6" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "2.0.4" path_provider_windows: dependency: transitive description: name: path_provider_windows url: "https://pub.dartlang.org" source: hosted - version: "2.0.5" + version: "2.0.6" petitparser: dependency: transitive description: @@ -484,35 +484,35 @@ packages: name: shared_preferences url: "https://pub.dartlang.org" source: hosted - version: "2.0.13" + version: "2.0.15" shared_preferences_android: dependency: transitive description: name: shared_preferences_android url: "https://pub.dartlang.org" source: hosted - version: "2.0.11" + version: "2.0.12" shared_preferences_ios: dependency: transitive description: name: shared_preferences_ios url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" shared_preferences_linux: dependency: transitive description: name: shared_preferences_linux url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" shared_preferences_macos: dependency: transitive description: name: shared_preferences_macos url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "2.0.4" shared_preferences_platform_interface: dependency: transitive description: @@ -526,14 +526,14 @@ packages: name: shared_preferences_web url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "2.0.4" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" shelf: dependency: transitive description: @@ -664,7 +664,7 @@ packages: name: vm_service url: "https://pub.dartlang.org" source: hosted - version: "8.2.2" + version: "8.3.0" watcher: dependency: transitive description: @@ -715,5 +715,5 @@ packages: source: hosted version: "3.1.0" sdks: - dart: ">=2.17.0-0 <3.0.0" + dart: ">=2.17.0-206.0.dev <3.0.0" flutter: ">=2.8.1" diff --git a/game_template/pubspec.yaml b/game_template/pubspec.yaml index 22816e177..d5ebd7a9b 100644 --- a/game_template/pubspec.yaml +++ b/game_template/pubspec.yaml @@ -34,7 +34,7 @@ dev_dependencies: sdk: flutter flutter_launcher_icons: ^0.9.2 - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 test: ^1.19.0 flutter: