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. bool enable = true,
  17. ValueChanged<bool>? onChanges,
  18. Color borderColor = Colors.transparent,
  19. double borderRadius = 0,
  20. double borderWidth = 0,
  21. Gradient? gradient,
  22. Gradient? selectedGradientColor,
  23. bool isSelected = false,
  24. String selectedText = '',
})

Implementation

const AnimatedButton({
  super.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.enable = true,
  this.onChanges,
  this.borderColor = Colors.transparent,
  this.borderRadius = 0,
  this.borderWidth = 0,
  this.gradient,
  this.selectedGradientColor,
  this.isSelected = false,
  this.selectedText = '',
})  : isStrip = false,
      stripColor = Colors.transparent,
      stripSize = 0,
      stripTransitionType = StripTransitionType.LEFT_TO_RIGHT;