GFButton constructor
const
GFButton({
- Key? key,
- required VoidCallback? onPressed,
- ValueChanged<
bool> ? onHighlightChanged, - TextStyle? textStyle,
- BoxShadow? boxShadow,
- bool? buttonBoxShadow,
- Color? focusColor,
- Color? hoverColor,
- Color? highlightColor,
- Color? splashColor,
- double elevation = 0.0,
- double focusElevation = 4.0,
- double hoverElevation = 4.0,
- double highlightElevation = 1.0,
- double disabledElevation = 0.0,
- EdgeInsetsGeometry padding = const EdgeInsets.symmetric(horizontal: 8),
- BoxConstraints? constraints,
- ShapeBorder? borderShape,
- Duration animationDuration = kThemeChangeDuration,
- Clip clipBehavior = Clip.none,
- FocusNode? focusNode,
- bool autofocus = false,
- MaterialTapTargetSize? materialTapTargetSize,
- Widget? child,
- GFButtonType type = GFButtonType.solid,
- GFButtonShape shape = GFButtonShape.standard,
- Color color = GFColors.PRIMARY,
- Color? textColor,
- GFPosition position = GFPosition.start,
- double size = GFSize.MEDIUM,
- BorderSide? borderSide,
- String? text,
- Widget? icon,
- bool? blockButton,
- bool? fullWidthButton,
- ColorScheme? colorScheme,
- bool? enableFeedback,
- VoidCallback? onLongPress,
- Color? disabledColor,
- Color? disabledTextColor,
Create buttons of all types. check out GFIconButton for icon buttons, and GFBadge for badges
Implementation
const GFButton({
Key? key,
required this.onPressed,
this.onHighlightChanged,
this.textStyle,
this.boxShadow,
this.buttonBoxShadow,
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.child,
this.type = GFButtonType.solid,
this.shape = GFButtonShape.standard,
this.color = GFColors.PRIMARY,
this.textColor,
this.position = GFPosition.start,
this.size = GFSize.MEDIUM,
this.borderSide,
this.text,
this.icon,
this.blockButton,
this.fullWidthButton,
this.colorScheme,
this.enableFeedback,
this.onLongPress,
this.disabledColor,
this.disabledTextColor,
}) : 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);