diff --git a/CHANGELOG.md b/CHANGELOG.md index 842bf54..95055f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## [2.3.8] + +- Make functions private that should not be public. + ## [2.3.7] - (2023-Dec-06) - Roll back web fade as it was a breaking change. Fixes [#628](https://github.com/jonbhanson/flutter_native_splash/issues/628). Fixes [#627](https://github.com/jonbhanson/flutter_native_splash/issues/627). Fixes [#622](https://github.com/jonbhanson/flutter_native_splash/issues/622). diff --git a/README.md b/README.md index f711c4a..854c75d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -# **Need a great Flutter developer? [I'm available](https://www.linkedin.com/in/hansonjon/)!** - When your app is opened, there is a brief time while the native app loads Flutter. By default, during this time, the native app displays a white splash screen. This package automatically generates iOS, Android, and Web-native code for customizing this native splash screen background color and splash image. Supports dark mode, full screen, and platform-specific options.

@@ -21,7 +19,7 @@ First, add `flutter_native_splash` as a dependency in your pubspec.yaml file. ```yaml dependencies: - flutter_native_splash: ^2.3.7 + flutter_native_splash: ^2.3.8 ``` Don't forget to `flutter pub get`. @@ -417,7 +415,7 @@ This is caused by an [iOS splash caching bug](https://stackoverflow.com/question ## I see a white screen between splash screen and app 1. It may be caused by an [iOS splash caching bug](https://stackoverflow.com/questions/33002829/ios-keeping-old-launch-screen-and-app-icon-after-update), which can be solved by uninstalling your app, powering off your device, power back on, and then try reinstalling. -2. It may be caused by the delay due to initialization in your app. To solve this, put any initialization code in the `removeAfter` method. +2. It may be caused by the delay due to initialization in your app. To solve this, use the `preserve` and `remove` calls to keep the splash on screen while your app initializes. ## Can I base light/dark mode on app settings? diff --git a/example/pubspec.lock b/example/pubspec.lock index cbd7797..3dab907 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -114,17 +114,17 @@ packages: dependency: "direct dev" description: name: flutter_lints - sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04 + sha256: e2a421b7e59244faef694ba7b30562e489c2b489866e505074eb005cd7060db7 url: "https://pub.dev" source: hosted - version: "2.0.3" + version: "3.0.1" flutter_native_splash: dependency: "direct main" description: path: ".." relative: true source: path - version: "2.3.7" + version: "2.3.8" flutter_test: dependency: "direct dev" description: flutter @@ -163,10 +163,10 @@ packages: dependency: transitive description: name: lints - sha256: "6b0206b0bf4f04961fc5438198ccb3a885685cd67d4d4a32cc20ad7f8adbe015" + sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "3.0.0" matcher: dependency: transitive description: @@ -203,10 +203,10 @@ packages: dependency: transitive description: name: petitparser - sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 + sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27 url: "https://pub.dev" source: hosted - version: "5.4.0" + version: "6.0.2" pointycastle: dependency: transitive description: @@ -304,10 +304,10 @@ packages: dependency: transitive description: name: xml - sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" + sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 url: "https://pub.dev" source: hosted - version: "6.3.0" + version: "6.5.0" yaml: dependency: transitive description: @@ -317,5 +317,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.2.0-194.0.dev <4.0.0" + dart: ">=3.2.0 <4.0.0" flutter: ">=2.5.0" diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 60ee61d..816bef9 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -47,7 +47,7 @@ dev_dependencies: # activated in the `analysis_options.yaml` file located at the root of your # package. See that file for information about deactivating specific lint # rules and activating additional ones. - flutter_lints: ^2.0.3 + flutter_lints: ^3.0.1 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/lib/android.dart b/lib/android.dart index eddb07a..e15d884 100644 --- a/lib/android.dart +++ b/lib/android.dart @@ -415,24 +415,24 @@ Future _updateStylesFile({ return; } - replaceElement( + _replaceElement( launchTheme: launchTheme, name: 'android:forceDarkAllowed', value: "false", ); - replaceElement( + _replaceElement( launchTheme: launchTheme, name: 'android:windowFullscreen', value: fullScreen.toString(), ); - replaceElement( + _replaceElement( launchTheme: launchTheme, name: 'android:windowDrawsSystemBarBackgrounds', value: fullScreen.toString()); - replaceElement( + _replaceElement( launchTheme: launchTheme, name: 'android:windowLayoutInDisplayCutoutMode', value: 'shortEdges', @@ -440,12 +440,12 @@ Future _updateStylesFile({ // In Android 12, the color must be set directly in the styles.xml if (android12BackgroundColor == null) { - removeElement( + _removeElement( launchTheme: launchTheme, name: 'android:windowSplashScreenBackground', ); } else { - replaceElement( + _replaceElement( launchTheme: launchTheme, name: 'android:windowSplashScreenBackground', value: '#$android12BackgroundColor', @@ -453,12 +453,12 @@ Future _updateStylesFile({ } if (android12BrandingImagePath == null) { - removeElement( + _removeElement( launchTheme: launchTheme, name: 'android:windowSplashScreenBrandingImage', ); } else { - replaceElement( + _replaceElement( launchTheme: launchTheme, name: 'android:windowSplashScreenBrandingImage', value: '@drawable/android12branding', @@ -466,12 +466,12 @@ Future _updateStylesFile({ } if (android12ImagePath == null) { - removeElement( + _removeElement( launchTheme: launchTheme, name: 'android:windowSplashScreenAnimatedIcon', ); } else { - replaceElement( + _replaceElement( launchTheme: launchTheme, name: 'android:windowSplashScreenAnimatedIcon', value: '@drawable/android12splash', @@ -479,12 +479,12 @@ Future _updateStylesFile({ } if (android12IconBackgroundColor == null) { - removeElement( + _removeElement( launchTheme: launchTheme, name: 'android:windowSplashScreenIconBackgroundColor', ); } else { - replaceElement( + _replaceElement( launchTheme: launchTheme, name: 'android:windowSplashScreenIconBackgroundColor', value: '#$android12IconBackgroundColor', @@ -496,7 +496,7 @@ Future _updateStylesFile({ ); } -void replaceElement({ +void _replaceElement({ required XmlElement launchTheme, required String name, required String value, @@ -517,7 +517,7 @@ void replaceElement({ ); } -void removeElement({required XmlElement launchTheme, required String name}) { +void _removeElement({required XmlElement launchTheme, required String name}) { launchTheme.children.removeWhere( (element) => element.attributes.any( (attribute) => diff --git a/lib/cli_commands.dart b/lib/cli_commands.dart index da5c563..683f459 100644 --- a/lib/cli_commands.dart +++ b/lib/cli_commands.dart @@ -40,11 +40,11 @@ void createSplash({ } final config = getConfig(configFile: path, flavor: flavor); - createSplashByConfig(config); + _createSplashByConfig(config); } /// Create splash screens for Android and iOS based on a config argument -void createSplashByConfig(Map config) { +void _createSplashByConfig(Map config) { // Preparing all the data for later usage final String? image = _checkImageExists(config: config, parameter: _Parameter.image); @@ -227,15 +227,7 @@ Now go finish building something awesome! 💪 You rock! 🤘🤩 Like the package? Please give it a 👍 here: https://pub.dev/packages/flutter_native_splash '''; - const String whatsNew = ''' -╔════════════════════════════════════════════════════════════════════════════╗ -║ NEED A GREAT FLUTTER DEVELOPER? ║ -╠════════════════════════════════════════════════════════════════════════════╣ -║ ║ -║ I am available! Find me at https://www.linkedin.com/in/hansonjon/ ║ -║ ║ -╚════════════════════════════════════════════════════════════════════════════╝ -'''; + const String whatsNew = ''; print(whatsNew + greet); } @@ -269,7 +261,7 @@ void removeSplash({ if (config.containsKey(_Parameter.plistFiles)) { removeConfig[_Parameter.plistFiles] = config[_Parameter.plistFiles]; } - createSplashByConfig(removeConfig); + _createSplashByConfig(removeConfig); } String? _checkImageExists({ diff --git a/lib/web.dart b/lib/web.dart index d865e6c..85e1b8a 100644 --- a/lib/web.dart +++ b/lib/web.dart @@ -156,7 +156,7 @@ void _createWebSplash({ ], ); - createBackgroundImages( + _createBackgroundImages( backgroundImage: backgroundImage, darkBackgroundImage: darkBackgroundImage, ); @@ -176,7 +176,7 @@ void _createWebSplash({ ); } -void createBackgroundImages({ +void _createBackgroundImages({ required String? backgroundImage, required String? darkBackgroundImage, }) { diff --git a/pubspec.yaml b/pubspec.yaml index 1ac5e99..e845deb 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ 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.3.7 +version: 2.3.8 repository: https://github.com/jonbhanson/flutter_native_splash issue_tracker: https://github.com/jonbhanson/flutter_native_splash/issues @@ -18,17 +18,17 @@ dependencies: js: ^0.6.7 html: ^0.15.4 image: ^4.1.3 - meta: ^1.9.1 + meta: ^1.10.0 path: ^1.8.3 universal_io: ^2.2.2 - xml: ^6.3.0 + xml: ^6.5.0 yaml: ^3.1.2 ansicolor: ^2.0.2 dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^2.0.3 + flutter_lints: ^3.0.1 screenshots: - description: 'Examples of the splash screen on iOS.'