jonny7737 / shaking_icon

Flutter widget to shake an icon or image asset. Dynamically enable / disable shaking.

Home Page:https://github.com/jonny7737/shaking_icon

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Shaking Icon Flutter widget

Add a shaking icon to your Flutter app.

Icon to shake - This can be either an IconData object
or a String assetName for an AssetImage.

final dynamic icon;

Size parameter passed to Icon constructor
Default is 36

final double size;

Function to determine shake flag from outside this class
This function takes precedence over shake flag

final Function shakeIt;

Enable / Disable shake flag to support dynamic UI.
Default value is true

final bool shake;

Color parameter passed to Icon constructor

final Color color;

Horizontal shake.
Default to Horizontal shake

final bool horizontalShake;

Diagonal shake if horizontalShake && verticalShake = true
Vertical shake.
Default to Horizontal shake

final bool verticalShake;

Frequency to repeat the shake in seconds

final int secondsToRepeat;

Example usages:

ShakingIcon(Icons.verified_user, size: 32, 
    shakeIt: (bool shake) {
              if(shake) return true;
              else return false;
    },
)

ShakingIcon('assets/003-pointer.png', color: Colors.black, horizontalShake: false, shake: false)
  

About

Flutter widget to shake an icon or image asset. Dynamically enable / disable shaking.

https://github.com/jonny7737/shaking_icon

License:Other


Languages

Language:Dart 100.0%