AnimatedButton constructor

const AnimatedButton({
  1. Key? key,
  2. required String text,
  3. required VoidCallback? onPress,
  4. TransitionType transitionType = TransitionType.LEFT_TO_RIGHT,
  5. TextStyle textStyle = const TextStyle(color: Colors.white, fontSize: 20),
  6. Color selectedTextColor = Colors.blue,
  7. Color selectedBackgroundColor = Colors.white,
  8. Color backgroundColor = Colors.white60,
  9. bool isReverse = false,
  10. int textMaxLine = 1,
  11. TextOverflow textOverflow = TextOverflow.clip,
  12. AlignmentGeometry textAlignment = Alignment.center,
  13. double height = 50,
  14. double width = double.infinity,
  15. Duration animationDuration = const Duration(milliseconds: 500),
  16. ValueChanged<bool>? onChanges,
  17. Color borderColor = Colors.transparent,
  18. double borderRadius = 0,
  19. double borderWidth = 0,
  20. Gradient? gradient,
  21. Gradient? selectedGradientColor,
  22. bool isSelected = false,
  23. String selectedText = '',
  24. 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);