GenZButton constructor
const
GenZButton({
- Key? key,
- String? text,
- required void onPressed()?,
- GenZButtonShape? shape = GenZButtonShape.DEFAULT,
- Widget? child,
- Widget? icon,
- GenZButtonType? type = GenZButtonType.FILL,
- GenZPosition position = GenZPosition.LEADING,
- EdgeInsets? padding,
- bool enableFeedback = false,
- Color? color,
- Widget? badgeText,
- Color? badgeColor,
- Color? splashColor,
- BadgeType badgeType = BadgeType.OUTSIDE,
- GenZSize size = GenZSize.MEDIUM,
- Color? highlightColor,
- bool badge = false,
- BadgePosition badgePosition = const BadgePosition(right: 0),
- Color? textColor,
- double? height,
- double? minWidth,
- Color? disabledColor,
- TextStyle? textStyle,
- double elevation = 0.0,
- double disabledElevation = 0.0,
- double focusElevation = 0.0,
- double highlightElevation = 0.0,
- double hoverElevation = 0.0,
Implementation
const GenZButton({
Key? key,
this.text,
required this.onPressed,
this.shape = GenZButtonShape.DEFAULT,
this.child,
this.icon,
this.type = GenZButtonType.FILL,
this.position = GenZPosition.LEADING,
this.padding,
this.enableFeedback = false,
this.color,
this.badgeText,
this.badgeColor,
this.splashColor,
this.badgeType = BadgeType.OUTSIDE,
this.size = GenZSize.MEDIUM,
this.highlightColor,
this.badge = false,
this.badgePosition = const BadgePosition(right: 0),
this.textColor,
this.height,
this.minWidth,
this.disabledColor,
this.textStyle,
this.elevation = 0.0,
this.disabledElevation = 0.0,
this.focusElevation = 0.0,
this.highlightElevation = 0.0,
this.hoverElevation = 0.0,
}) : assert(focusElevation >= 0.0),
assert(hoverElevation >= 0.0),
assert(highlightElevation >= 0.0),
assert(disabledElevation >= 0.0),
assert(
icon != null && (child != null || text != null)
? (position == GenZPosition.CENTER ? false : true)
: true,
POSITIONCENTERERROR,
),
assert(badgeType == BadgeType.INSIDE ? badgeText != null : true,
"If BadgeType is Inside then badgeText cant be null"),
super(key: key);