diff --git a/CHANGELOG.md b/CHANGELOG.md index e0ab3e6..fd62842 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [2.2.8] - (2022-Aug-21) +- Use Theme.Light.NoTitleBar. Fixes [#402](https://github.com/jonbhanson/flutter_native_splash/issues/402). +- Correct android spelling in readme. Thanks [Muhammad](https://github.com/itsahmed-dev) for [PR #407](https://github.com/jonbhanson/flutter_native_splash/pull/407). +- Use html parser. Thanks [OutdatedGuy](https://github.com/OutdatedGuy) for [PR #396](https://github.com/jonbhanson/flutter_native_splash/pull/396). +- Separate branding property for Android 12. Closes [#405](https://github.com/jonbhanson/flutter_native_splash/issues/405). + ## [2.2.7] - (2022-July-31) - Remove branding on Android 12 if branding is not specified. Fixes [#399](https://github.com/jonbhanson/flutter_native_splash/issues/399). diff --git a/README.md b/README.md index 29821c4..f30b2c4 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.2.7 + flutter_native_splash: ^2.2.8 ``` Don't forget to `flutter pub get`. @@ -52,7 +52,8 @@ flutter_native_splash: #image: assets/splash.png # The branding property allows you to specify an image used as branding in the splash screen. - # It must be a png file. It is supported for Android < v12, iOS and the Web. + # It must be a png file. It is supported for Android, iOS and the Web. For Android 12, + # see the Android 12 section below. #branding: assets/dart.png # To position the branding image at the bottom of the screen you can use bottom, bottomRight, @@ -88,8 +89,11 @@ flutter_native_splash: # App icon background color. #icon_background_color: "#111111" - # The image_dark parameter and icon_background_color_dark set the image and icon background - # color when the device is in dark mode. If they are not specified, the app will use the + # The branding property allows you to specify an image used as branding in the splash screen. + #branding: assets/dart.png + + # The image_dark, color_dark, icon_background_color_dark, and branding_dark set values that + # apply when the device is in dark mode. If they are not specified, the app will use the # parameters from above. #image_dark: assets/android12splash-invert.png #color_dark: "#042a49" diff --git a/lib/android.dart b/lib/android.dart index 2a00fac..597673e 100644 --- a/lib/android.dart +++ b/lib/android.dart @@ -63,6 +63,8 @@ void _createAndroidSplash({ required String? android12IconBackgroundColor, required String? darkAndroid12IconBackgroundColor, required String? screenOrientation, + String? android12BrandingImagePath, + String? android12DarkBrandingImagePath, }) { if (imagePath != null) { _applyImageAndroid(imagePath: imagePath); @@ -170,7 +172,7 @@ void _createAndroidSplash({ android12BackgroundColor: android12BackgroundColor, android12ImagePath: android12ImagePath, android12IconBackgroundColor: android12IconBackgroundColor, - android12BrandingImagePath: brandingImagePath, + android12BrandingImagePath: android12BrandingImagePath, ); if (android12DarkBackgroundColor != null || @@ -184,7 +186,7 @@ void _createAndroidSplash({ android12BackgroundColor: android12DarkBackgroundColor, android12ImagePath: android12DarkImagePath, android12IconBackgroundColor: darkAndroid12IconBackgroundColor, - android12BrandingImagePath: brandingDarkImagePath, + android12BrandingImagePath: android12DarkBrandingImagePath, ); } diff --git a/lib/cli_commands.dart b/lib/cli_commands.dart index d4d6307..84e6fea 100644 --- a/lib/cli_commands.dart +++ b/lib/cli_commands.dart @@ -115,6 +115,8 @@ void createSplashByConfig(Map config) { String? darkAndroid12IconBackgroundColor; String? android12Color; String? android12DarkColor; + String? android12BrandingImage; + String? android12DarkBrandingImage; if (config['android_12'] != null) { final android12Config = config['android_12'] as Map; @@ -128,6 +130,10 @@ void createSplashByConfig(Map config) { parseColor(android12Config['icon_background_color_dark']); android12Color = parseColor(android12Config['color']) ?? color; android12DarkColor = parseColor(android12Config['color_dark']) ?? darkColor; + android12BrandingImage = + _checkImageExists(config: android12Config, parameter: 'branding'); + android12DarkBrandingImage = + _checkImageExists(config: android12Config, parameter: 'branding_dark'); } if (!config.containsKey('android') || config['android'] as bool) { @@ -141,6 +147,8 @@ void createSplashByConfig(Map config) { android12DarkImagePath: android12DarkImage, android12IconBackgroundColor: android12IconBackgroundColor, darkAndroid12IconBackgroundColor: darkAndroid12IconBackgroundColor, + android12BrandingImagePath: android12BrandingImage, + android12DarkBrandingImagePath: android12DarkBrandingImage, backgroundImage: backgroundImageAndroid ?? backgroundImage, darkBackgroundImage: darkBackgroundImageAndroid ?? darkBackgroundImage, color: android12Color ?? color, diff --git a/lib/templates.dart b/lib/templates.dart index 9d39ea3..818ac77 100644 --- a/lib/templates.dart +++ b/lib/templates.dart @@ -26,20 +26,20 @@ const String _androidLaunchBackgroundXml = ''' const String _androidStylesXml = ''' - - - '''; @@ -50,7 +50,7 @@ const String _androidStylesNightXml = ''' @@ -58,7 +58,7 @@ const String _androidStylesNightXml = ''' This theme determines the color of the Android Window while your Flutter UI initializes, as well as behind your Flutter UI while its running. - + This Theme is only used starting with V2 of Flutter's Android embedding. -->