flare_splash_screen 2.1.3

flare_splash_screen #

pub package

Facilitator for having a Splash screen with a Flare animation until some work has been done for the initialization of the app

Usage #

The splash screen will show the animation and push the new route you gave once it's finish, by default it does a fade animation but you can customize it by using transitionsBuilder

SplashScreen.navigate(
    name: 'intro.flr',
    next: MyHomePage(title: 'Flutter Demo Home Page'),
    until: () => Future.delayed(Duration(seconds: 5)),
    startAnimation: '1',
),

Callback #

The splash screen will show the animation and call the onFinished callback when it's finish.

SplashScreen.callback(
    name: 'intro.flr',    
    onFinished: () {
      Navigator.of(context).pushReplacement(PageRouteBuilder(pageBuilder: (_,__,___) => MyHomePage(title: 'Flutter Demo Home Page')));
    },
    loopAnimation: '1',
    until: () => Future.delayed(Duration(seconds: 1)),
    endAnimation: '1',
),

API #

name : path/name of the flare animation

next : screen to show once animation is finished

loopAnimation: animation name to run, default same as first param

startAnimation: animation name to run once before going into loop

endAnimation: animation name to run once until is complete

until: callback that return a future to process your initialization

isLoading: alternative to until if you want to manage loading state with a boolean

height: force the height of the flare animation, by default it take the all place available

width: force the width of the flare animation, by default it take the all place available

alignment: alignment of the flare animation, center by default

transitionsBuilder transition to apply when showing next

Available animation mode #

Only one animation #

Basically you have one animation to show and then just need to stay at last frame. In order to do that only specify the startAnimation

Start and loop animation #

Your animation have an intro and a loop state, in order to do that only specify the startAnimation and loopAnimation

End and loop animation #

Your animation have a finish and a loop state, in order to do that only specify the endAnimation and loopAnimation

Start and end animation #

Your animation have an intro and a finish that should stay on the last frame, in order to do that only startAnimation and endAnimation

Start, end and loop animation #

Your animation have an intro, a finish and a loop state, in order to do that specify the startAnimation, endAnimation and loopAnimation

[2.1.3]

  • upgrade flare deps to be compatible with last flutter stable

[2.1.2]

  • fix transition builder on navigate

[2.1.1]

  • fix callbacks when only loop animation set

[2.1.0]

  • refactor finish callback with success error

[2.0.1+2]

  • fix startAnimation only not working

[2.0.1+1]

  • update deps

[2.0.1]

  • Add background color capability

[2.0.0]

  • Refactoring to use flare_loading that allow more animation capabilities

[1.1.1]

  • When endAnimation is not set, go directly to next page

[1.1.0]

  • Add until, endAnimation, width, height, alignment and transitionsBuilder capabilities.

[1.0.0]

  • initial release.

example/README.md

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: SplashScreen('intro.flr', MyHomePage(title: 'Flutter Demo Home Page'), animation: '1',),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flare_splash_screen: ^2.1.3

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flare_splash_screen/flare_splash_screen.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
95
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
97
Learn more about scoring.

We analyzed this package on Sep 16, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.0
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.2

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flare_loading ^2.0.2 2.0.2
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
flare_dart 1.4.6
flare_flutter 1.5.8
meta 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test