Giter Club home page Giter Club logo

shimmer_animation's Introduction

Shimmer Animation

pub package Libraries.io dependency status for latest release License

Moved from Beta to Release

This animation widget can help you bring simple yet beautiful shimmer animations to your project with ease.

Shimmer is very widely used in loading screens or placeholder widgets throughout the development community. Therefore, having an easy to use, yet customizable widget ready to use for Android, iOS and Web, gives developers an advantage to focus on their actual functionality, let shimmer make the loading experience smoother.

Examples

An example can be found in the example directory of this repository.

A list of detailed examples can be found in this Examples Repository

Full Screen Loading Widgets Loading Buttons

How to use

Add shimmer_animation to pubspec.yaml of your project:

dependencies:
  shimmer_animation: ^1.0.0

Import it in your Dart code:

import 'package:shimmer_animation/shimmer_animation.dart';

Wrap any widget with Shimmer() widget to apply animaton:

  Shimmer(
    duration: Duration(seconds: 3), //Default value
    interval: Duration(seconds: 5), //Default value: Duration(seconds: 0)
    color: Colors.white, //Default value
    enabled: true, //Default value
    direction: ShimmerDirection.fromLTRB(),  //Default Value
    child: Container(
      color: Colors.deepPurple,
    ),
  ),

Note

The interval property of shimmer_animation was introduced in v0.2.0 but had a bug which caused animation controller to throw a runtime exception as pointed out by @budo76 in #11

This has been patched in v0.2.1 so anyone using v0.2.0 and using interval should Upgrade Immediately

Parameters:

  • @required child : accepts a child Widget over which the animation is to be displayed
  • color : accepts a parameter of type Color and sets the color of the animation overlay. Default value is Colors.white
  • enabled : accepts a bool toggles animation. Default value is true
  • duration : accepts a Duration that would be the time period of animation. Default value is Duration(seconds: 3)
  • interval : accepts a Duration that would be the interval between the repeating animation. Default value is Duration(seconds: 0) i.e. no interval
  • direction : accepts a ShimmerDirection and aligns the animation accordingly. Default value is ShimmerDirection.fromLBRT()

A detailed API Reference can be found here.

License

MIT License.

shimmer_animation's People

Contributors

maddyb99 avatar normancarcamo avatar

Watchers

James Cloos 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.