From 78c3a7043a917cef286c6c8ddc8e5fe71a4dcc60 Mon Sep 17 00:00:00 2001 From: Jon Hanson Date: Sun, 4 Jun 2023 04:43:19 -0400 Subject: [PATCH] Fix fullscreen switch not working for Android <12v in System.dark mode. Fixes #559. --- CHANGELOG.md | 6 +++-- README.md | 2 +- example/pubspec.lock | 6 ++--- lib/android.dart | 64 ++++++++++++++++---------------------------- pubspec.yaml | 4 +-- 5 files changed, 33 insertions(+), 49 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 11d5754..a6dae0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ -## Unreleased -- Package speed up using Isolates to generate files at the same time +## [2.3.1] - (2023-Jun-04) +- Package speed up using Isolates to generate files at the same time. Thanks [Vladimir](https://github.com/vlazdra) for [PR #558](https://github.com/jonbhanson/flutter_native_splash/pull/558). - New command for generating all flavors at once: --flavors +- Replaced deprecated 'flutter pub run' with 'dart run'. Thanks [Aditya](https://github.com/adityar224) for [PR #554](https://github.com/jonbhanson/flutter_native_splash/pull/554). +- Fix fullscreen switch not working for Android <12v in System.dark mode. Fixes [#559](https://github.com/jonbhanson/flutter_native_splash/issues/559). ## [2.3.0] - (2023-May-15) - Support for GIFs in splash screen for web. Thanks [OutdatedGuy](https://github.com/OutdatedGuy) for [PR #547](https://github.com/jonbhanson/flutter_native_splash/pull/547). diff --git a/README.md b/README.md index c7802fe..d2a487f 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ First, add `flutter_native_splash` as a dependency in your pubspec.yaml file. ```yaml dependencies: - flutter_native_splash: ^2.3.0 + flutter_native_splash: ^2.3.1 ``` Don't forget to `flutter pub get`. diff --git a/example/pubspec.lock b/example/pubspec.lock index 256794e..bb7898f 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -116,7 +116,7 @@ packages: path: ".." relative: true source: path - version: "2.3.0" + version: "2.3.1" flutter_test: dependency: "direct dev" description: flutter @@ -272,10 +272,10 @@ packages: dependency: transitive description: name: universal_io - sha256: "06866290206d196064fd61df4c7aea1ffe9a4e7c4ccaa8fcded42dd41948005d" + sha256: "1722b2dcc462b4b2f3ee7d188dad008b6eb4c40bbd03a3de451d82c78bba9aad" url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.2.2" vector_math: dependency: transitive description: diff --git a/lib/android.dart b/lib/android.dart index 70078cf..3d90ec0 100644 --- a/lib/android.dart +++ b/lib/android.dart @@ -171,41 +171,25 @@ void _createAndroidSplash({ } print('[Android] Updating styles...'); - if (android12BackgroundColor != null || - android12ImagePath != null || - android12IconBackgroundColor != null || - android12BrandingImagePath != null) { - _applyStylesXml( - fullScreen: fullscreen, - file: _flavorHelper.androidV31StylesFile, - template: _androidV31StylesXml, - android12BackgroundColor: android12BackgroundColor, - android12ImagePath: android12ImagePath, - android12IconBackgroundColor: android12IconBackgroundColor, - android12BrandingImagePath: android12BrandingImagePath, - ); - } else { - File file = File(_flavorHelper.androidV31StylesFile); - if (file.existsSync()) file.deleteSync(); - } + _applyStylesXml( + fullScreen: fullscreen, + file: _flavorHelper.androidV31StylesFile, + template: _androidV31StylesXml, + android12BackgroundColor: android12BackgroundColor, + android12ImagePath: android12ImagePath, + android12IconBackgroundColor: android12IconBackgroundColor, + android12BrandingImagePath: android12BrandingImagePath, + ); - if (android12DarkBackgroundColor != null || - android12DarkImagePath != null || - darkAndroid12IconBackgroundColor != null || - brandingDarkImagePath != null) { - _applyStylesXml( - fullScreen: fullscreen, - file: _flavorHelper.androidV31StylesNightFile, - template: _androidV31StylesNightXml, - android12BackgroundColor: android12DarkBackgroundColor, - android12ImagePath: android12DarkImagePath, - android12IconBackgroundColor: darkAndroid12IconBackgroundColor, - android12BrandingImagePath: android12DarkBrandingImagePath, - ); - } else { - File file = File(_flavorHelper.androidV31StylesNightFile); - if (file.existsSync()) file.deleteSync(); - } + _applyStylesXml( + fullScreen: fullscreen, + file: _flavorHelper.androidV31StylesNightFile, + template: _androidV31StylesNightXml, + android12BackgroundColor: android12DarkBackgroundColor, + android12ImagePath: android12DarkImagePath, + android12IconBackgroundColor: darkAndroid12IconBackgroundColor, + android12BrandingImagePath: android12DarkBrandingImagePath, + ); _applyStylesXml( fullScreen: fullscreen, @@ -213,13 +197,11 @@ void _createAndroidSplash({ template: _androidStylesXml, ); - if (darkColor != null || darkBackgroundImage != null) { - _applyStylesXml( - fullScreen: fullscreen, - file: _flavorHelper.androidNightStylesFile, - template: _androidStylesNightXml, - ); - } + _applyStylesXml( + fullScreen: fullscreen, + file: _flavorHelper.androidNightStylesFile, + template: _androidStylesNightXml, + ); _applyOrientation(orientation: screenOrientation); } diff --git a/pubspec.yaml b/pubspec.yaml index ba10512..6f992ae 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: flutter_native_splash description: Customize Flutter's default white native splash screen with background color and splash image. Supports dark mode, full screen, and more. -version: 2.3.0 +version: 2.3.1 repository: https://github.com/jonbhanson/flutter_native_splash issue_tracker: https://github.com/jonbhanson/flutter_native_splash/issues @@ -20,7 +20,7 @@ dependencies: image: ^4.0.17 meta: ^1.9.1 path: ^1.8.3 - universal_io: ^2.2.0 + universal_io: ^2.2.2 xml: ^6.3.0 yaml: ^3.1.2