This is a Flutter package to make a custom AnimatedIcon from two Icons.
This package is born to make AnimatedIcons easily available for any Icon and not only the few default ones
Features
Here are some examples of animated icons.
Note that you can provide any Icon that is of type IconData to the animator
You can see an example of some icons being animated in the Sample Project
Getting started
To install the package just do:
flutter pub add icons_animate
flutter pub get
OR add the dependency manually to your pubspec.yaml file:
dependencies:icons_animate:^0.0.2
Then depend on it in your class:
import'package:icons_animate/icons_animate.dart';
Usage
Here is a simple implementation:
AnimateIcons(
startIcon: Icons.add_circle,
endIcon: Icons.add_circle_outline,
size: 100.0,
controller: controller,
startTooltip: 'Icons.add_circle',
endTooltip: 'Icons.add_circle_outline',
// add this for splashColor, default is Colors.transparent means no click effect
splashColor: Colors.blueAccent.shade100.withAlpha(50),
// add this to specify a custom splashRadius// default is Material.defaultSplashRadius (35)
splashRadius: 24,
onStartIconPress: () {
print("Clicked on Add Icon");
returntrue;
},
onEndIconPress: () {
print("Clicked on Close Icon");
returntrue;
},
duration: Duration(milliseconds: 500),
startIconColor: Colors.deepPurple,
endIconColor: Colors.deepOrange,
clockwise: false,
),