GithubHelp home page GithubHelp logo

thomasecalle / delayed_display Goto Github PK

View Code? Open in Web Editor NEW
31.0 2.0 7.0 602 KB

A widget that enables you to display a child after a delay and with beautiful fading and sliding animation.

License: MIT License

Kotlin 1.26% Swift 11.73% Objective-C 0.39% Dart 71.40% HTML 15.23%
flutter flutter-animation flutter-package

delayed_display's Introduction

delayed_display

A widget that enables you to display a child after a delay and with beautiful fading and sliding animation.

examples

How does it works

All you have to do is to use the widget DelayedDisplay like this for example :

DelayedDisplay(
  delay: Duration(seconds: 1),
  child: Text(
    "Hello",
    style: TextStyle(
      fontWeight: FontWeight.bold,
      fontSize: 35.0,
      color: Colors.white,
    ),
  ),
),

And ... That's all ! It will automatically handle fading and sliding animation and will make the Text appear after 1 second delay.

Let's customize it !

Here are the accepted parameters :

Name Type Usage Required Default Value
child Widget The Widget that needs to appear yes null
delay Duration The duration before showing the widget (and animating it) false null
fadingDuration Duration The duration of the fading animation false const Duration(milliseconds: 800)
slidingCurve Curve The curve of the sliding animation false Curves.decelerate
slidingBeginOffset Offset The offset from where the sliding animation will start false const Offset(0.0, 0.35)

delayed_display's People

Contributors

davidlepilote avatar thomasecalle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

delayed_display's Issues

Timer should be cancelled in dispose()

First off, thanks for making this widget... it's great!

I noticed the following issue when changing routes while the timer is still running:

AnimationController.forward() called after AnimationController.dispose()

It can be resolved by doing the following:

Create a new private variable:

var _timer;

Assign the timer to it:

_timer = Timer(delay, () {
_opacityController.forward();
});

Modify the dispose() method as follows:

/// Dispose the opacity controller
@OverRide
void dispose() {
_opacityController.dispose();
if (_timer != null) {
_timer.cancel();
}
super.dispose();
}

Delayed hide

It would be nice to have a reverse animation feature for hiding the child widget.

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.