GenZButton class

Inheritance

Constructors

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})
const

Properties

badge bool
Badge if true will show badge over button
final
badgeColor Color?
Default badge color will be picked from color property of button
final
badgePosition BadgePosition
BadgePosition Outside Positions and default will be right=0 and size will be 12 if not provided
final
badgeText Widget?
Widget for badge text to be display inside
final
badgeType BadgeType
final
child Widget?
Label for the GenZButton. Takes Widget and will be given less priority than text.
final
color Color?
Default color is GenZColors.primary for defualt GenZButtonType.FILL button type.
final
disabledColor Color?
If disabledColor not given then it will take color with 60% opacity.
final
disabledElevation double
Default disabledElevation is 0.
final
elevation double
Default elevation is 0.
final
enableFeedback bool
Default is false.
final
focusElevation double
Default focusElevation is 0.
final
hashCode int
The hash code for this object.
no setterinherited
height double?
Default height is 0.
final
highlightColor Color?
highlightColor color for icon is transparent
final
highlightElevation double
Default highlightElevation is 0.
final
hoverElevation double
Default hoverElevation is 0.
final
icon Widget?
Takes Widget as an Icon and can be used alone as IconButton.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
minWidth double?
Defualt minWidth is 0.
final
onPressed → void Function()?
When GenZButton is tapped or pressed if given Null button will be disabled.
final
padding EdgeInsets?
Padding for the content.
final
position GenZPosition
Defualt position is GenZPosition.LEADING.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shape GenZButtonShape?
Defualt shape is GenZButtonShape.DEFAULT.
final
size GenZSize
Defualt size is GenZSize.MEDIUM.
final
splashColor Color?
Splash color for icon is transparent
final
text String?
Text takes String and If child and text both are given then text will be given priority.
final
textColor Color?
textColor works for all text,child,icon
final
textStyle TextStyle?
textStyle is only applicable to text provided using text params.
final
type GenZButtonType?
Defualt type is GenZButtonType.FILL.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<GenZButton>
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, int wrapWidth = 65}) 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