simple_splash_view 0.2.7
simple_splash_view: ^0.2.7 copied to clipboard
Native splash generator (Android/iOS) with Kotlin/Swift using config from pubspec.yaml.
simple_splash_view #
Native splash screen generator for Flutter apps. Configure the splash once in pubspec.yaml, then generate Android and iOS native code, resources, themes, and documentation from one command.
Features #
- Android and iOS native splash screens generated from one config block.
- Lottie animation, static image, startup sound, text, background colors, and dark-mode variants.
- Loader styles:
circular,linear,dots,pulse, and custom Lottie loaders. - Independent placement for loader and text with
indicator_positionandtext_position. - Platform targeting from the CLI: generate Android only, iOS only, or both.
- Cleanup command to remove generated splash files and native integrations.
- Idempotent output: rerunning updates the same generated files instead of duplicating them.
Installation #
dependencies:
simple_splash_view: ^0.2.0
Declare every Flutter asset you use:
flutter:
assets:
- assets/splash/splash_light.json
- assets/splash/splash_dark.json
- assets/images/logo_light.png
- assets/images/logo_dark.png
- assets/loaders/loader.json
- assets/audio/intro.mp3
Configuration #
simple_splash_view:
lottie: assets/splash/splash_light.json
lottie_dark: assets/splash/splash_dark.json
image: assets/images/logo_light.png
image_dark: assets/images/logo_dark.png
sound: assets/audio/intro.mp3
text: "Loading..."
ios_bundle_identifier: com.yourcompany.yourapp
background_color: "#F4F5F7"
background_color_dark: "#050505"
text_color: "#1E1E1E"
text_color_dark: "#FAFAFA"
indicator: true
indicator_style: dots
indicator_color: "#FF5722"
indicator_color_dark: "#FFC107"
indicator_position: below_visual
text_position: bottom
duration: 3200
theme:
mode: system
app_theme: "Theme.App"
splash_theme: "Theme.Splash"
Loader Styles #
| Style | Description |
|---|---|
circular |
Native spinning activity indicator. |
linear |
Native horizontal loading bar. |
dots |
Three animated dots tinted from indicator_color. |
pulse |
Animated pulsing dot. |
lottie |
Custom Lottie loader from indicator_lottie. |
Custom Lottie loader example:
simple_splash_view:
indicator: true
indicator_style: lottie
indicator_lottie: assets/loaders/loader_light.json
indicator_lottie_dark: assets/loaders/loader_dark.json
Placement #
| Key | Values | Behavior |
|---|---|---|
indicator_position |
auto, below_visual, above_text |
Controls where the loader appears relative to the main visual and text. |
text_position |
auto, below_visual, bottom |
Controls whether text follows the visual/loader or stays pinned near the bottom. |
Set indicator: false to remove the loader from the next generated Android/iOS splash files. Set text to null or remove it to hide the splash text.
CLI #
Generate both platforms:
dart run simple_splash_view
Generate one platform:
dart run simple_splash_view --platform android
dart run simple_splash_view --platform ios
Skip CocoaPods during iOS generation:
dart run simple_splash_view --platform ios --skip-pod-install
Remove generated splash integration:
dart run simple_splash_view --remove --platform all
dart run simple_splash_view --remove --platform android
dart run simple_splash_view --remove --platform ios
The remove command deletes generated splash files and removes launcher/AppDelegate integration. It intentionally preserves shared Gradle and CocoaPods dependencies because they may be used elsewhere in your app.
What Gets Generated #
Android #
SplashActivity.ktactivity_splash.xml- Generated color/style resources
- Generated drawable/raw assets, including dark-mode variants
- Manifest launcher integration
- Optional ProGuard keep rules
iOS #
SplashViewController.swift- AppDelegate splash coordinator integration
- Embedded AppDelegate support for generated Swift coordinator/config code
- Resources copied under
ios/Runner/Resources pod 'lottie-ios'when a main or loader Lottie file is configured- Podfile validation and repair for Flutter-compatible CocoaPods hooks
- Automatic minimum iOS deployment target repair to
13.0 - Automatic
flutter pub getbefore CocoaPods when generated Flutter config is missing
iOS Signing Note #
If your app still uses a default com.example.* Bundle Identifier, the generator updates it automatically to a unique package-style identifier. For production apps, set ios_bundle_identifier explicitly in pubspec.yaml, then rerun dart run simple_splash_view.
If Apple signing still fails, open ios/Runner.xcworkspace, select Runner, and confirm that the Bundle Identifier is available for your development team.
Publishing A New Version #
- Update
versioninpubspec.yaml. - Update
CHANGELOG.md. - Run:
dart format bin lib test
dart analyze
dart test
dart pub publish --dry-run
dart pub publish
Use dart pub publish --dry-run first and fix every warning that affects package score or publishing validation.
License #
MIT. See LICENSE.