AnimatedButton constructor
const
AnimatedButton({
- Key? key,
- required String text,
- required VoidCallback? onPress,
- TransitionType transitionType = TransitionType.LEFT_TO_RIGHT,
- TextStyle textStyle = const TextStyle(color: Colors.white, fontSize: 20),
- Color selectedTextColor = Colors.blue,
- Color selectedBackgroundColor = Colors.white,
- Color backgroundColor = Colors.white60,
- bool isReverse = false,
- int textMaxLine = 1,
- TextOverflow textOverflow = TextOverflow.clip,
- AlignmentGeometry textAlignment = Alignment.center,
- double height = 50,
- double width = double.infinity,
- Duration animationDuration = const Duration(milliseconds: 500),
- ValueChanged<
bool> ? onChanges, - Color borderColor = Colors.transparent,
- double borderRadius = 0,
- double borderWidth = 0,
- Gradient? gradient,
- Gradient? selectedGradientColor,
- bool isSelected = false,
- String selectedText = '',
- AnimatedOn animatedOn = AnimatedOn.onTap,
Implementation
const AnimatedButton({
Key? key,
required this.text,
required this.onPress,
this.transitionType = TransitionType.LEFT_TO_RIGHT,
this.textStyle = const TextStyle(color: Colors.white, fontSize: 20),
this.selectedTextColor = Colors.blue,
this.selectedBackgroundColor = Colors.white,
this.backgroundColor = Colors.white60,
this.isReverse = false,
this.textMaxLine = 1,
this.textOverflow = TextOverflow.clip,
this.textAlignment = Alignment.center,
this.height = 50,
this.width = double.infinity,
this.animationDuration = const Duration(milliseconds: 500),
this.onChanges,
this.borderColor = Colors.transparent,
this.borderRadius = 0,
this.borderWidth = 0,
this.gradient,
this.selectedGradientColor,
this.isSelected = false,
this.selectedText = '',
this.animatedOn = AnimatedOn.onTap,
}) : isStrip = false,
stripColor = Colors.transparent,
stripSize = 0,
stripTransitionType = StripTransitionType.LEFT_TO_RIGHT,
super(key: key);