Skip to content

Commit

Permalink
Fixed Android 11 color issue. Fixes #429. Fix index.html getting extr…
Browse files Browse the repository at this point in the history
…a blank lines. Fixes #430. Update the readme.  Closes #431.
  • Loading branch information
jonbhanson committed Oct 9, 2022
1 parent 3e62d81 commit 7d1472b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 11 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
@@ -1,4 +1,10 @@
## [2.2.10] - (2022-Sep-25)
## [2.2.11] - (2022-Oct-09)

- Fixed Android 11 color issue. Fixes [#429](https://github.com/jonbhanson/flutter_native_splash/issues/429).
- Fix index.html getting extra blank lines. Fixes [#430](https://github.com/jonbhanson/flutter_native_splash/issues/430).
- Update the readme. Closes [#431](https://github.com/jonbhanson/flutter_native_splash/issues/431).

## [2.2.10+1] - (2022-Sep-25)

- Update bug report template.
- Package housekeeping to stay up to date with Flutter.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -19,7 +19,7 @@ First, add `flutter_native_splash` as a dependency in your pubspec.yaml file.

```yaml
dependencies:
flutter_native_splash: ^2.2.10
flutter_native_splash: ^2.2.11
```

Don't forget to `flutter pub get`.
Expand Down Expand Up @@ -197,7 +197,7 @@ void main() {
```

NOTE: In order to use this method, the `flutter_native_splash` dependency must be in the `dependencies` section of `pubspec.yaml`, not in the `dev_dependencies` as was the case in previous versions of this package.
NOTE: If you do not need to use the `preserve()` and `remove()` methods, you can place the `flutter_native_splash` dependency in the `dev_dependencies` section of `pubspec.yaml`.

## 4. Support the package (optional)

Expand Down
4 changes: 2 additions & 2 deletions lib/cli_commands.dart
Expand Up @@ -151,8 +151,8 @@ void createSplashByConfig(Map<String, dynamic> config) {
android12DarkBrandingImagePath: android12DarkBrandingImage,
backgroundImage: backgroundImageAndroid ?? backgroundImage,
darkBackgroundImage: darkBackgroundImageAndroid ?? darkBackgroundImage,
color: android12Color ?? color,
darkColor: android12DarkColor ?? darkColor,
color: color,
darkColor: darkColor,
gravity: gravity,
brandingGravity: brandingGravity,
fullscreen: fullscreen,
Expand Down
10 changes: 6 additions & 4 deletions lib/templates.dart
Expand Up @@ -501,21 +501,23 @@ body {
}
''';

// XML's insertBefore needs a blank line at the start and not newline at the end:
const String _indexHtmlPicture = '''
<picture id="splash">
<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)">
<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)">
<img class="[IMAGEMODE]" aria-hidden="true" src="splash/img/light-1x.png" alt=""/>
</picture>
''';
</picture>''';

// XML's insertBefore needs a blank line at the start and not newline at the end:
const String _indexHtmlBrandingPicture = '''
<picture id="splash-branding">
<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)">
<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)">
<img class="[BRANDINGMODE]" aria-hidden="true" src="splash/img/branding-1x.png" alt=""/>
</picture>
''';
</picture>''';

const String _webJS = '''
function removeSplashFromWeb() {
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
@@ -1,12 +1,12 @@
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.2.10
version: 2.2.11
repository: https://github.com/jonbhanson/flutter_native_splash
issue_tracker: https://github.com/jonbhanson/flutter_native_splash/issues

environment:
sdk: '>=2.18.1 <3.0.0'
sdk: '>=2.18.0 <3.0.0'
flutter: ">=2.5.0"

dependencies:
Expand Down

0 comments on commit 7d1472b

Please sign in to comment.