From cc2ad325e38d14ad22b22829c079f0f70f6b7e9e Mon Sep 17 00:00:00 2001 From: Jon Hanson Date: Wed, 9 Jun 2021 09:07:54 -0400 Subject: [PATCH] Added path argument to command line. Thanks [@lyledean1](https://github.com/lyledean1) for PR [#180](https://github.com/jonbhanson/flutter_native_splash/pull/180). --- CHANGELOG.md | 4 ++++ README.md | 2 +- bin/create.dart | 2 +- bin/remove.dart | 2 +- example/README.md | 7 +++++++ example/pubspec.lock | 28 +++++++++++++++++++++------- example/pubspec.yaml | 2 +- example/red.yaml | 4 ++++ lib/flutter_native_splash.dart | 4 ++-- pubspec.yaml | 6 +++--- 10 files changed, 45 insertions(+), 16 deletions(-) create mode 100644 example/red.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c92235..ad16ca3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## [1.1.9] - (2021-Jun-09) + +* Added path argument to command line. Thanks [@lyledean1](https://github.com/lyledean1) for PR [#180](https://github.com/jonbhanson/flutter_native_splash/pull/180). + ## [1.1.8+4] - (2021-Apr-20) * Fixed bug that was preventing copying of dark background. Fixes [#163](https://github.com/jonbhanson/flutter_native_splash/issues/163). diff --git a/README.md b/README.md index 46942be..3e7d881 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ First, add `flutter_native_splash` as a dev dependency in your pubspec.yaml file ```yaml dev_dependencies: - flutter_native_splash: ^1.1.8+4 + flutter_native_splash: ^1.1.9 ``` Don't forget to `flutter pub get`. diff --git a/bin/create.dart b/bin/create.dart index 4efa854..b54350a 100644 --- a/bin/create.dart +++ b/bin/create.dart @@ -5,6 +5,6 @@ import 'package:flutter_native_splash/flutter_native_splash.dart' void main(List args) { var parser = ArgParser(); parser.addOption('path', - callback: (path) => {flutter_native_splash.createSplash(path)}); + callback: (path) => {flutter_native_splash.createSplash(path: path)}); parser.parse(args); } diff --git a/bin/remove.dart b/bin/remove.dart index 3786011..8b57b51 100644 --- a/bin/remove.dart +++ b/bin/remove.dart @@ -5,6 +5,6 @@ import 'package:flutter_native_splash/flutter_native_splash.dart' void main(List args) { var parser = ArgParser(); parser.addOption('path', - callback: (path) => {flutter_native_splash.removeSplash(path)}); + callback: (path) => {flutter_native_splash.removeSplash(path: path)}); parser.parse(args); } diff --git a/example/README.md b/example/README.md index ce73bef..7f085fd 100644 --- a/example/README.md +++ b/example/README.md @@ -13,6 +13,13 @@ flutter pub get flutter pub run flutter_native_splash:create ``` +Or, to try specifying a config by setting the path, run the following command in the terminal: + +``` +flutter pub get +flutter pub run flutter_native_splash:create --path=red.yaml +``` + The updated splash screen will now appear when you run the app. A few resources to get you started if this is your first Flutter project: diff --git a/example/pubspec.lock b/example/pubspec.lock index 24d343f..5019d51 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -8,13 +8,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "3.1.2" + args: + dependency: transitive + description: + name: args + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" async: dependency: transitive description: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.5.0" + version: "2.6.1" boolean_selector: dependency: transitive description: @@ -63,7 +70,7 @@ packages: name: cupertino_icons url: "https://pub.dartlang.org" source: hosted - version: "1.0.2" + version: "1.0.3" fake_async: dependency: transitive description: @@ -82,7 +89,7 @@ packages: path: ".." relative: true source: path - version: "1.1.7" + version: "1.1.9" flutter_test: dependency: "direct dev" description: flutter @@ -122,7 +129,7 @@ packages: name: petitparser url: "https://pub.dartlang.org" source: hosted - version: "4.0.2" + version: "4.1.0" sky_engine: dependency: transitive description: flutter @@ -134,7 +141,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" stack_trace: dependency: transitive description: @@ -169,7 +176,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.19" + version: "0.3.0" typed_data: dependency: transitive description: @@ -177,6 +184,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.3.0" + universal_io: + dependency: transitive + description: + name: universal_io + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.4" vector_math: dependency: transitive description: @@ -190,7 +204,7 @@ packages: name: xml url: "https://pub.dartlang.org" source: hosted - version: "5.0.2" + version: "5.1.2" yaml: dependency: transitive description: diff --git a/example/pubspec.yaml b/example/pubspec.yaml index dfb966b..e363505 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -27,7 +27,7 @@ dependencies: # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^1.0.2 + cupertino_icons: ^1.0.3 dev_dependencies: flutter_test: diff --git a/example/red.yaml b/example/red.yaml new file mode 100644 index 0000000..ad482af --- /dev/null +++ b/example/red.yaml @@ -0,0 +1,4 @@ +flutter_native_splash: + color: "#ff6666" + color_dark: "#660000" + fullscreen: true \ No newline at end of file diff --git a/lib/flutter_native_splash.dart b/lib/flutter_native_splash.dart index c6d7b84..a49d593 100644 --- a/lib/flutter_native_splash.dart +++ b/lib/flutter_native_splash.dart @@ -16,7 +16,7 @@ part 'templates.dart'; part 'web.dart'; /// Create splash screens for Android and iOS -void createSplash(String? path) { +void createSplash({String? path}) { var config = getConfig(configFile: path); checkConfig(config); createSplashByConfig(config); @@ -83,7 +83,7 @@ void createSplashByConfig(Map config) { } /// Remove any splash screen by setting the default white splash -void removeSplash(String? path) { +void removeSplash({String? path}) { print('Restoring Flutter\'s default white native splash screen...'); var config = getConfig(configFile: path); diff --git a/pubspec.yaml b/pubspec.yaml index 1dabc8a..a145ea7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,17 +1,17 @@ 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.1.8+4 +version: 1.1.9 homepage: https://github.com/jonbhanson/flutter_native_splash environment: sdk: '>=2.12.0 <3.0.0' dependencies: - args: ^2.0.0 + args: ^2.1.1 image: ^3.0.2 meta: ^1.3.0 path: ^1.8.0 - xml: ^5.1.0 + xml: ^5.1.2 yaml: ^3.1.0 universal_io: ^2.0.4