SuraAsyncButton class

Create a Material Elevated Button that can contain a loadingWiidget whenever you execute a Future function in onPressed callback

Inheritance
Available Extensions

Constructors

SuraAsyncButton({Key? key, required FutureOrCallBack? onPressed, required Widget child, bool fullWidth = true, Color loadingColor = Colors.white, EdgeInsets margin = const EdgeInsets.symmetric(vertical: 16), EdgeInsets padding = const EdgeInsets.symmetric(vertical: 8, horizontal: 16), LoadingType loadingType = LoadingType.progress, Widget? startIcon, Widget? endIcon, Widget? loadingWidget, double? width, double? height, Color? color, OutlinedBorder? shape, MainAxisAlignment? alignment, BorderSide? borderSide, Color? textColor, double? elevation})
Create a Material Elevated Button that can contain a loadingWiidget whenever you execute a Future function in onPressed callback
const

Properties

alignment MainAxisAlignment?
Alignment of the icon and child
final
borderSide BorderSide?
button's border side
final
child Widget
A child to display inside the button
final
color Color?
Button's background color
final
elevation double?
Button's elevation
final
endIcon Widget?
endIcon will show on the left side of the button
final
fullWidth bool
whether button is set to stretch with available width
final
hashCode int
The hash code for this object.
no setterinherited
height double?
Button's height
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
loadingColor Color
A color for default loadingWidget
final
loadingType LoadingType
select a loading type of the button
final
loadingWidget Widget?
A widget to show when button is loading
final
margin EdgeInsets
Button's margin, default value is vertical: 16
final
onPressed → FutureOrCallBack?
onPressed callback
final
padding EdgeInsets
Button padding
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shape OutlinedBorder?
Button's shape
final
startIcon Widget?
startIcon will show on the left side of the button
final
textColor Color?
Button's text color
final
width double?
Button's widget
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _SuraAsyncButtonState
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