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. Closes 136.
  • Loading branch information
jonbhanson committed Mar 4, 2021
1 parent b47972a commit 46e5562
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 129 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@
**/doc/api/
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
build/
pubspec.lock

# Android related
**/android/**/gradle-wrapper.jar
Expand Down Expand Up @@ -57,10 +59,12 @@ build/
**/ios/.generated/
**/ios/Flutter/App.framework
**/ios/Flutter/Flutter.framework
**/ios/Flutter/Flutter.podspec
**/ios/Flutter/Generated.xcconfig
**/ios/Flutter/app.flx
**/ios/Flutter/app.zip
**/ios/Flutter/flutter_assets/
**/ios/Flutter/flutter_export_environment.sh
**/ios/ServiceDefinitions.json
**/ios/Runner/GeneratedPluginRegistrant.*

Expand All @@ -69,4 +73,3 @@ build/
!**/ios/**/default.mode2v3
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [0.3.2] - (2021-Mar-04)

* Added exception for missing/renamed splash image in LaunchScreen.storyboard. Closes [136](https://github.com/jonbhanson/flutter_native_splash/issues/136).

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

* Corrected location of `picture` tag in web to ensure that splash disappears. Thanks [Dawid Dziurla](https://github.com/dawidd6).
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: ^0.3.1+1
flutter_native_splash: ^0.3.2
```
Don't forget to `flutter pub get`.
Expand Down
7 changes: 5 additions & 2 deletions lib/ios.dart
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,10 @@ 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?"));

final backgroundView = subViews.children.whereType<XmlElement>().firstWhere(
(element) => (element.name.qualified == 'imageView' &&
element.getAttribute('image') == 'LaunchBackground'),
Expand All @@ -156,7 +159,7 @@ Future _updateLaunchScreenStoryboard(
orElse: () => null);
if (launchImageResource == null) {
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?");
}
final launchBackgroundResource = resources.children
.whereType<XmlElement>()
Expand Down
124 changes: 0 additions & 124 deletions pubspec.lock

This file was deleted.

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: 0.3.1+1
version: 0.3.2
homepage: https://github.com/jonbhanson/flutter_native_splash

environment:
Expand Down

0 comments on commit 46e5562

Please sign in to comment.