CustomButton constructor
const
CustomButton({
- Key? key,
- Pressed pressed = Pressed.notPressed,
- bool vibrate = true,
- Color? shadowColor,
- CrossAxisAlignment crossAxis = CrossAxisAlignment.start,
- Widget? subtitle,
- List<
Widget> ? rowChildren, - MainAxisAlignment mainAxis = MainAxisAlignment.center,
- double? width,
- double? height,
- bool isThreeD = false,
- required void onPressed()?,
- bool reversePosition = false,
- String? title,
- Widget? child,
- Gradient? gradient,
- Color? backgroundColor,
- Widget? iconWidget,
- ButtonAsset? asset,
- List<
BoxShadow> ? boxShadow, - EdgeInsets? margin,
- EdgeInsets? padding,
- double? borderRadius,
- bool animate = false,
- Decoration? decoration,
- bool isLoading = false,
Implementation
const CustomButton({
Key? key,
this.pressed = Pressed.notPressed,
this.vibrate = true,
this.shadowColor,
this.crossAxis = CrossAxisAlignment.start,
this.subtitle,
this.rowChildren,
this.mainAxis = MainAxisAlignment.center,
this.width,
this.height,
this.isThreeD = false,
required this.onPressed,
this.reversePosition = false,
this.title,
this.child,
this.gradient,
this.backgroundColor,
this.iconWidget,
this.asset,
this.boxShadow,
this.margin,
this.padding,
this.borderRadius,
this.animate = false,
this.decoration,
this.isLoading = false, // showing the loading in the button itself
}) : assert(backgroundColor == null || gradient == null),
assert(iconWidget == null || asset == null),
assert(decoration == null ||
(backgroundColor == null && boxShadow == null)),
assert(child == null || (title == null)),
assert(rowChildren == null ||
(title == null &&
child == null &&
asset == null &&
iconWidget == null)),
assert((!(animate == true && height == null))),
assert(!((pressed == Pressed.pressed && animate == false))),
super(key: key);