Skip to content

Commit 0239914

Browse files
committed
Don't update values-31 if there is no android_12 section in the config. Closes #447.
Additional fix for index.html getting extra blank lines. Fixes #430.
1 parent a91dc4b commit 0239914

File tree

6 files changed

+26
-18
lines changed

6 files changed

+26
-18
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## [2.2.14] - (2022-Nov-07)
2+
3+
- Don't update `values-31` if there is no `android_12` section in the config. Closes [#447](https://github.com/jonbhanson/flutter_native_splash/issues/447).
4+
- Additional fix for index.html getting extra blank lines. Fixes [#430](https://github.com/jonbhanson/flutter_native_splash/issues/430).
5+
16
## [2.2.13] - (2022-Oct-30)
27

38
- Corrected Android 12 dark parameters not defaulting to light parameters. Thanks [elliotrtd](https://github.com/elliotrtd) for the [heads up](https://github.com/jonbhanson/flutter_native_splash/issues/400#issuecomment-1235100173) on this issue.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ First, add `flutter_native_splash` as a dependency in your pubspec.yaml file.
1919

2020
```yaml
2121
dependencies:
22-
flutter_native_splash: ^2.2.13
22+
flutter_native_splash: ^2.2.14
2323
```
2424
2525
Don't forget to `flutter pub get`.

example/pubspec.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ packages:
9696
path: ".."
9797
relative: true
9898
source: path
99-
version: "2.2.10"
99+
version: "2.2.14"
100100
flutter_test:
101101
dependency: "direct dev"
102102
description: flutter
@@ -113,14 +113,14 @@ packages:
113113
name: html
114114
url: "https://pub.dartlang.org"
115115
source: hosted
116-
version: "0.15.0"
116+
version: "0.15.1"
117117
image:
118118
dependency: transitive
119119
description:
120120
name: image
121121
url: "https://pub.dartlang.org"
122122
source: hosted
123-
version: "3.2.0"
123+
version: "3.2.2"
124124
js:
125125
dependency: transitive
126126
description:

lib/android.dart

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -171,15 +171,20 @@ void _createAndroidSplash({
171171
}
172172

173173
print('[Android] Updating styles...');
174-
_applyStylesXml(
175-
fullScreen: fullscreen,
176-
file: _flavorHelper.androidV31StylesFile,
177-
template: _androidV31StylesXml,
178-
android12BackgroundColor: android12BackgroundColor,
179-
android12ImagePath: android12ImagePath,
180-
android12IconBackgroundColor: android12IconBackgroundColor,
181-
android12BrandingImagePath: android12BrandingImagePath,
182-
);
174+
if (android12BackgroundColor != null ||
175+
android12ImagePath != null ||
176+
android12IconBackgroundColor != null ||
177+
android12BrandingImagePath != null) {
178+
_applyStylesXml(
179+
fullScreen: fullscreen,
180+
file: _flavorHelper.androidV31StylesFile,
181+
template: _androidV31StylesXml,
182+
android12BackgroundColor: android12BackgroundColor,
183+
android12ImagePath: android12ImagePath,
184+
android12IconBackgroundColor: android12IconBackgroundColor,
185+
android12BrandingImagePath: android12BrandingImagePath,
186+
);
187+
}
183188

184189
if (android12DarkBackgroundColor != null ||
185190
android12DarkImagePath != null ||

lib/templates.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -501,18 +501,16 @@ body {
501501
}
502502
''';
503503

504-
// XML's insertBefore needs a blank line at the start and not newline at the end:
504+
// XML's insertBefore can't have a newline at the end:
505505
const String _indexHtmlPicture = '''
506-
507506
<picture id="splash">
508507
<source srcset="splash/img/light-1x.png 1x, splash/img/light-2x.png 2x, splash/img/light-3x.png 3x, splash/img/light-4x.png 4x" media="(prefers-color-scheme: light)">
509508
<source srcset="splash/img/dark-1x.png 1x, splash/img/dark-2x.png 2x, splash/img/dark-3x.png 3x, splash/img/dark-4x.png 4x" media="(prefers-color-scheme: dark)">
510509
<img class="[IMAGEMODE]" aria-hidden="true" src="splash/img/light-1x.png" alt=""/>
511510
</picture>''';
512511

513-
// XML's insertBefore needs a blank line at the start and not newline at the end:
512+
// XML's insertBefore can't have a newline at the end:
514513
const String _indexHtmlBrandingPicture = '''
515-
516514
<picture id="splash-branding">
517515
<source srcset="splash/img/branding-1x.png 1x, splash/img/branding-2x.png 2x, splash/img/branding-3x.png 3x, splash/img/branding-4x.png 4x" media="(prefers-color-scheme: light)">
518516
<source srcset="splash/img/branding-dark-1x.png 1x, splash/img/branding-dark-2x.png 2x, splash/img/branding-dark-3x.png 3x, splash/img/branding-dark-4x.png 4x" media="(prefers-color-scheme: dark)">

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: flutter_native_splash
22
description: Customize Flutter's default white native splash screen with
33
background color and splash image. Supports dark mode, full screen, and more.
4-
version: 2.2.13
4+
version: 2.2.14
55
repository: https://github.com/jonbhanson/flutter_native_splash
66
issue_tracker: https://github.com/jonbhanson/flutter_native_splash/issues
77

0 commit comments

Comments
 (0)