Skip to content

Commit

Permalink
Corrected location of picture tag in web to ensure that splash disa…
Browse files Browse the repository at this point in the history
…ppears. Thanks Dawid Dziurla.
  • Loading branch information
jonbhanson committed Mar 2, 2021
1 parent 477005d commit c99b06d
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [1.0.1] - (2021-Mar-02)

* Corrected location of `picture` tag in web to ensure that splash disappears. Thanks [Dawid Dziurla](https://github.com/dawidd6).

## [1.0.0] - (2021-Feb-19)

* Adds null safety. Closes [#127](https://github.com/jonbhanson/flutter_native_splash/issues/127).
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ First, add `flutter_native_splash` as a dev dependency in your pubspec.yaml file

```yaml
dev_dependencies:
flutter_native_splash: ^1.0.0
flutter_native_splash: ^1.0.1
```
Don't forget to `flutter pub get`.
Expand Down Expand Up @@ -94,7 +94,10 @@ After adding your settings, run the following command in the terminal:
flutter pub run flutter_native_splash:create
```

When the package finishes running your splash screen is ready.
When the package finishes running, your splash screen is ready.

## 3. Like the package
Did you find this package useful? Please hit the <img height="18" width="18" src="https://pub.dev/static/img/like-inactive.svg?hash=107p369br29frvj1k7giq3qfai6fni37" class="mdc-icon-button__icon"> <a href="#detail-like">above</a>!

# Recommendations
## Secondary splash screen:
Expand Down
10 changes: 5 additions & 5 deletions lib/web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Future<void> updateIndex(

var foundExistingStyleSheet = false;
var headCloseTagLine = 0;
var bodyCloseTagLine = 0;
var dartScriptTagLine = 0;
var existingPictureLine = 0;

final styleSheetLink =
Expand All @@ -99,8 +99,8 @@ Future<void> updateIndex(
foundExistingStyleSheet = true;
} else if (line.contains('</head>')) {
headCloseTagLine = x;
} else if (line.contains('</body>')) {
bodyCloseTagLine = x;
} else if (line.contains('src="main.dart.js"')) {
dartScriptTagLine = x;
} else if (line.contains('<picture id="splash">')) {
existingPictureLine = x;
}
Expand All @@ -113,10 +113,10 @@ Future<void> updateIndex(
if (existingPictureLine == 0) {
if (showImages) {
for (var x = _indexHtmlPicture.length - 1; x >= 0; x--) {
lines[bodyCloseTagLine] =
lines[dartScriptTagLine] =
_indexHtmlPicture[x].replaceFirst('[IMAGEMODE]', imageMode) +
'\n' +
lines[bodyCloseTagLine];
lines[dartScriptTagLine];
}
}
} else {
Expand Down
6 changes: 3 additions & 3 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ packages:
name: archive
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0"
version: "3.1.2"
charcode:
dependency: transitive
description:
Expand Down Expand Up @@ -35,7 +35,7 @@ packages:
name: image
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0-nullsafety.0"
version: "3.0.1"
meta:
dependency: transitive
description:
Expand Down Expand Up @@ -105,6 +105,6 @@ packages:
name: yaml
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0"
version: "3.1.0"
sdks:
dart: ">=2.12.0-0.0 <3.0.0"
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: flutter_native_splash
description: Generates native code to customize Flutter's default white native splash screen with background color and splash image. Supports dark mode, full screen, and more.
version: 1.0.0
version: 1.0.1
homepage: https://github.com/jonbhanson/flutter_native_splash

environment:
sdk: '>=2.12.0-0 <3.0.0'

dependencies:
yaml: ^3.0.0
image: ^3.0.0-nullsafety.0
yaml: ^3.1.0
image: ^3.0.1
xml: ^5.0.2

dev_dependencies:
Expand Down

0 comments on commit c99b06d

Please sign in to comment.