Giter Site home page Giter Site logo

lomski / flare_splash_screen Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alexjdeath/flare_splash_screen

0.0 0.0 0.0 73 KB

Facilitator for having a Splash Screen with a Flare animation

License: MIT License

Objective-C 6.74% Java 3.26% Dart 90.00%

flare_splash_screen's Introduction

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

Navigation

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 as widget builder

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

flare_splash_screen's People

Contributors

jaumard avatar nasirkhalid24 avatar lomski avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.