GenZButton constructor

const GenZButton({
  1. Key? key,
  2. String? text,
  3. required void onPressed()?,
  4. GenZButtonShape? shape = GenZButtonShape.DEFAULT,
  5. Widget? child,
  6. Widget? icon,
  7. GenZButtonType? type = GenZButtonType.FILL,
  8. GenZPosition position = GenZPosition.LEADING,
  9. EdgeInsets? padding,
  10. bool enableFeedback = false,
  11. Color? color,
  12. Widget? badgeText,
  13. Color? badgeColor,
  14. Color? splashColor,
  15. BadgeType badgeType = BadgeType.OUTSIDE,
  16. GenZSize size = GenZSize.MEDIUM,
  17. Color? highlightColor,
  18. bool badge = false,
  19. BadgePosition badgePosition = const BadgePosition(right: 0),
  20. Color? textColor,
  21. double? height,
  22. double? minWidth,
  23. Color? disabledColor,
  24. TextStyle? textStyle,
  25. double elevation = 0.0,
  26. double disabledElevation = 0.0,
  27. double focusElevation = 0.0,
  28. double highlightElevation = 0.0,
  29. 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);