Skip to content

jonny7737/shaking_icon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages