GFButton class

Inheritance

Constructors

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
const

Properties

animationDuration Duration
Defines the duration of animated changes for shape and elevation.
final
autofocus bool
True if this widget will be selected as the initial focus when no other node in its scope is currently focused.
final
blockButton bool?
on true state blockButton gives block size button
final
borderShape ShapeBorder?
The shape of the button's Material.
final
borderSide BorderSide?
The border side for the button's Material.
final
boxShadow BoxShadow?
The box shadow for the button's Material, if GFButtonType is solid
final
buttonBoxShadow bool?
on true state default box shadow appears around button, if GFButtonType is solid
final
child Widget?
Typically the button's label.
final
clipBehavior Clip
final
color Color
Pass GFColors or Color
final
colorScheme ColorScheme?
A set of thirteen colors that can be used to derive the button theme's colors.
final
constraints BoxConstraints?
Defines the button's size.
final
disabledColor Color?
The fill color of the button when the button is disabled.
final
disabledElevation double
The elevation for the button's Material when the button is not enabled.
final
disabledTextColor Color?
The color to use for this button's text when the button is disabled.
final
elevation double
The elevation for the button's Material when the button is enabled but not pressed.
final
enabled bool
Whether the button is enabled or disabled.
no setter
enableFeedback bool?
Whether detected gestures should provide acoustic and/or haptic feedback.
final
focusColor Color?
Pass GFColors or Color. The color for the button's Material when it has the input focus.
final
focusElevation double
The elevation for the button's Material when the button is enabled and has the input focus.
final
focusNode FocusNode?
An optional focus node to use as the focus node for this widget.
final
fullWidthButton bool?
on true state full width Button gives full width button
final
hashCode int
The hash code for this object.
no setterinherited
highlightColor Color?
Pass GFColors or Color. The highlight color for the button's InkWell.
final
highlightElevation double
The elevation for the button's Material when the button is enabled and pressed.
final
hoverColor Color?
Pass GFColors or Color. The color for the button's Material when a pointer is hovering over it.
final
hoverElevation double
The elevation for the button's Material when the button is enabled and a pointer is hovering over it.
final
icon Widget?
icon of type Widget
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
materialTapTargetSize MaterialTapTargetSize
Configures the minimum size of the tap target.
final
onHighlightChanged ValueChanged<bool>?
Called by the underlying InkWell widget's InkWell.onHighlightChanged callback.
final
onLongPress VoidCallback?
Called when the button is long-pressed.
final
onPressed VoidCallback?
Called when the button is tapped or otherwise activated.
final
padding EdgeInsetsGeometry
The internal padding for the button's child.
final
position GFPosition
icon type of GFPosition i.e, start, end
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shape GFButtonShape
Button type of GFButtonShape i.e, standard, pills, square, shadow, icons
final
size double
size of double or GFSize i.e, 1.2, small, medium, large etc.
final
splashColor Color?
Pass GFColors or Color. The splash color for the button's InkWell.
final
text String?
text of type String is alternative to child. text will get priority over child
final
textColor Color?
Pass GFColors or Color
final
textStyle TextStyle?
Defines the default text style, with Material.textStyle, for the button's child.
final
type GFButtonType
Button type of GFButtonType i.e, solid, outline, outline2x, transparent
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _GFButtonState
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited