GFButtonBadge constructor

const GFButtonBadge({
  1. Key? key,
  2. required VoidCallback? onPressed,
  3. ValueChanged<bool>? onHighlightChanged,
  4. TextStyle? textStyle,
  5. BoxShadow? boxShadow,
  6. bool? badgeBoxShadow,
  7. Color? focusColor,
  8. Color? hoverColor,
  9. Color? highlightColor,
  10. Color? splashColor,
  11. double elevation = 0.0,
  12. double focusElevation = 4.0,
  13. double hoverElevation = 4.0,
  14. double highlightElevation = 1.0,
  15. double disabledElevation = 0.0,
  16. EdgeInsetsGeometry padding = const EdgeInsets.symmetric(horizontal: 8),
  17. BoxConstraints? constraints,
  18. ShapeBorder? borderShape,
  19. Duration animationDuration = kThemeChangeDuration,
  20. Clip clipBehavior = Clip.none,
  21. FocusNode? focusNode,
  22. bool autofocus = false,
  23. MaterialTapTargetSize? materialTapTargetSize,
  24. GFButtonType type = GFButtonType.solid,
  25. GFButtonShape shape = GFButtonShape.standard,
  26. Color color = GFColors.PRIMARY,
  27. Color? textColor,
  28. GFPosition position = GFPosition.end,
  29. double size = GFSize.MEDIUM,
  30. BorderSide? borderSide,
  31. String? text,
  32. bool? blockButton,
  33. bool? fullWidthButton,
  34. ColorScheme? colorScheme,
  35. bool? enableFeedback,
  36. VoidCallback? onLongPress,
  37. Color? disabledColor,
  38. Color? disabledTextColor,
  39. Widget? icon,
})

Create badges badges of all types. check out GFIconButton for icon badges, and GFBadge for badges

Implementation

const GFButtonBadge({
  Key? key,
  required this.onPressed,
  this.onHighlightChanged,
  this.textStyle,
  this.boxShadow,
  this.badgeBoxShadow,
  this.focusColor,
  this.hoverColor,
  this.highlightColor,
  this.splashColor,
  this.elevation = 0.0,
  this.focusElevation = 4.0,
  this.hoverElevation = 4.0,
  this.highlightElevation = 1.0,
  this.disabledElevation = 0.0,
  this.padding = const EdgeInsets.symmetric(horizontal: 8),
  this.constraints,
  this.borderShape,
  this.animationDuration = kThemeChangeDuration,
  this.clipBehavior = Clip.none,
  this.focusNode,
  this.autofocus = false,
  MaterialTapTargetSize? materialTapTargetSize,
  this.type = GFButtonType.solid,
  this.shape = GFButtonShape.standard,
  this.color = GFColors.PRIMARY,
  this.textColor,
  this.position = GFPosition.end,
  this.size = GFSize.MEDIUM,
  this.borderSide,
  this.text,
  this.blockButton,
  this.fullWidthButton,
  this.colorScheme,
  this.enableFeedback,
  this.onLongPress,
  this.disabledColor,
  this.disabledTextColor,
  this.icon,
})  : materialTapTargetSize =
          materialTapTargetSize ?? MaterialTapTargetSize.padded,
      //  assert(elevation != null && elevation >= 0.0),
      assert(focusElevation >= 0.0),
      assert(hoverElevation >= 0.0),
      assert(highlightElevation >= 0.0),
      assert(disabledElevation >= 0.0),
      super(
        key: key,
      );