Leondev7 / flutter_fab_dialer

Floating action button dialer
BSD 3-Clause "New" or "Revised" License
67 stars 31 forks source link

Option to select different animations for FAB showing. #8

Closed oleomachado closed 6 years ago

oleomachado commented 6 years ago

You can select different animations for showing the FAB buttons.

In _fabdialer.dart, I did create another constructor parameter (optional) that allow passing an enumeration item for different animations. Using this optional parameter we can avoid any breaking changes. If this parameter is omitted then the default animation (current animation = scale) will take place.

I added 2 new animations using "Staggered animation": fadeIn (fade all small FAB buttons and text) and slideInDown (slide each small FAB button from top to the correct position). More animations can be added later.

How to call:

// Default call without selecting the animation
new FabDialer( [ ... <items> ...], Colors.red, new Icon(Icons.add));
or
// Default call selecting a different animation
new FabDialer( [ ... <items> ...], Colors.red, new Icon(Icons.add), AnimationStyle.slideInDown);

Tested up to 9 items in an IPhone 7 and up to 9 items in and Nexus 6P.

Must update documentation, maybe add a gif with each different animations.

Leondev7 commented 6 years ago

Thanks man, It's very helpfull. I will test it myself to see how it works.