Skip to content

Commit

Permalink
Added exception for missing/renamed splash image in LaunchScreen.stor…
Browse files Browse the repository at this point in the history
…yboard.
  • Loading branch information
jonbhanson committed Mar 4, 2021
1 parent e97c4de commit 2494fde
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 7 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
## [1.0.2] - (2021-Mar-04)

* Added exception for missing/renamed splash image in LaunchScreen.storyboard.

## [1.0.1+1] - (2021-Mar-02)

* Corrected location of `picture` tag in web to ensure that splash disappears. Thanks [Dawid Dziurla](https://github.com/dawidd6).
* 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)

Expand Down
2 changes: 1 addition & 1 deletion 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.1+1
flutter_native_splash: <latest-version>
```

Don't forget to `flutter pub get`.
Expand Down
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class MyApp extends StatelessWidget {
}

class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
MyHomePage({Key? key, required this.title}) : super(key: key);

// This widget is the home page of your application. It is stateful, meaning
// that it has a State object (defined below) that contains fields that affect
Expand Down
6 changes: 4 additions & 2 deletions lib/ios.dart
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ Future _updateLaunchScreenStoryboard(
final subViews = view.getElement('subviews');
final imageView = subViews?.children.whereType<XmlElement>().firstWhere(
(element) => (element.name.qualified == 'imageView' &&
element.getAttribute('image') == 'LaunchImage'));
element.getAttribute('image') == 'LaunchImage'),
orElse: () => throw _LaunchScreenStoryboardModified(
"Not able to find 'LaunchImage' in LaunchScreen.storyboard. Image for splash screen not updated. Did you modify your default LaunchScreen.storyboard file?"));
subViews?.children.whereType<XmlElement>().firstWhere(
(element) => (element.name.qualified == 'imageView' &&
element.getAttribute('image') == 'LaunchBackground'), orElse: () {
Expand All @@ -161,7 +163,7 @@ Future _updateLaunchScreenStoryboard(
(element) => (element.name.qualified == 'image' &&
element.getAttribute('name') == 'LaunchImage'),
orElse: () => throw _LaunchScreenStoryboardModified(
"Not able to find 'LaunchImage' image tag in LaunchScreen.storyboard. Image for splash screen not updated. Did you modify your default LaunchScreen.storyboard file?"));
"Not able to find 'LaunchImage' in LaunchScreen.storyboard. Image for splash screen not updated. Did you modify your default LaunchScreen.storyboard file?"));

resources?.children.whereType<XmlElement>().firstWhere(
(element) => (element.name.qualified == 'image' &&
Expand Down
2 changes: 1 addition & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ packages:
name: pedantic
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0"
version: "1.11.0"
petitparser:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
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.1+1
version: 1.0.2
homepage: https://github.com/jonbhanson/flutter_native_splash

environment:
Expand Down

0 comments on commit 2494fde

Please sign in to comment.