AuiButton class
A custom button widget supporting multiple styles and configurations.
This widget provides various predefined styles such as elevated, outlined, and text buttons.
It allows customization of padding, shape, background color, border, shadow, and more.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- AuiButton
Constructors
-
AuiButton({Key? key, VoidCallback? onPressed, required Widget child, WidgetStateProperty<
EdgeInsetsGeometry> ? msPadding, EdgeInsetsGeometry? padding, WidgetStateProperty<EdgeInsetsGeometry> ? msShape, OutlinedBorder? shape, BorderRadiusGeometry? borderRadius, double? borderRadiusAll = 0, WidgetStateProperty<Color> ? msBackgroundColor, Color? backgroundColor, AuiButtonType? buttonType = AuiButtonType.elevated, ButtonStyle? style, WidgetStateProperty<Color> ? msShadowColor, WidgetStateProperty<BorderSide> ? msSide, BorderSide? side, Color borderColor = Colors.transparent, bool? disabled = false, bool? block = false, bool soft = false, WidgetStateProperty<double> ? msElevation, double? elevation = 4, Color? shadowColor, MaterialTapTargetSize? tapTargetSize = MaterialTapTargetSize.padded, Color? splashColor}) -
Default constructor with customization options.
const
-
AuiButton.block({Key? key, required VoidCallback? onPressed, required Widget child, WidgetStateProperty<
EdgeInsetsGeometry> ? msPadding, EdgeInsetsGeometry? padding = const EdgeInsets.fromLTRB(24, 16, 24, 16), WidgetStateProperty<EdgeInsetsGeometry> ? msShape, bool? block = true, OutlinedBorder? shape, bool soft = false, BorderRadiusGeometry? borderRadius, double? borderRadiusAll, WidgetStateProperty<Color> ? msBackgroundColor, Color? backgroundColor, AuiButtonType? buttonType = AuiButtonType.elevated, ButtonStyle? style, WidgetStateProperty<BorderSide> ? msSide, bool? disabled = false, BorderSide? side, Color borderColor = Colors.transparent, WidgetStateProperty<Color> ? msShadowColor, WidgetStateProperty<double> ? msElevation, double? elevation = 4, Color? shadowColor, MaterialTapTargetSize? tapTargetSize = MaterialTapTargetSize.padded, Color? splashColor}) -
const
-
AuiButton.large({Key? key, required VoidCallback? onPressed, required Widget child, WidgetStateProperty<
EdgeInsetsGeometry> ? msPadding, EdgeInsetsGeometry? padding = const EdgeInsets.fromLTRB(36, 20, 36, 20), WidgetStateProperty<EdgeInsetsGeometry> ? msShape, OutlinedBorder? shape, bool soft = false, BorderRadiusGeometry? borderRadius, double? borderRadiusAll, WidgetStateProperty<Color> ? msBackgroundColor, Color? backgroundColor, AuiButtonType? buttonType = AuiButtonType.elevated, ButtonStyle? style, bool? disabled = false, WidgetStateProperty<BorderSide> ? msSide, BorderSide? side, bool? block = false, Color borderColor = Colors.transparent, WidgetStateProperty<Color> ? msShadowColor, WidgetStateProperty<double> ? msElevation, double? elevation = 4, Color? shadowColor, MaterialTapTargetSize? tapTargetSize = MaterialTapTargetSize.padded, Color? splashColor}) -
const
-
AuiButton.medium({Key? key, required VoidCallback? onPressed, required Widget child, WidgetStateProperty<
EdgeInsetsGeometry> ? msPadding, EdgeInsetsGeometry? padding = const EdgeInsets.fromLTRB(24, 16, 24, 16), WidgetStateProperty<EdgeInsetsGeometry> ? msShape, bool? block = false, OutlinedBorder? shape, bool soft = false, BorderRadiusGeometry? borderRadius, double? borderRadiusAll, WidgetStateProperty<Color> ? msBackgroundColor, Color? backgroundColor, AuiButtonType? buttonType = AuiButtonType.elevated, ButtonStyle? style, WidgetStateProperty<BorderSide> ? msSide, bool? disabled = false, BorderSide? side, Color borderColor = Colors.transparent, WidgetStateProperty<Color> ? msShadowColor, WidgetStateProperty<double> ? msElevation, double? elevation = 4, Color? shadowColor, MaterialTapTargetSize? tapTargetSize = MaterialTapTargetSize.padded, Color? splashColor}) -
const
-
AuiButton.outlined({Key? key, required VoidCallback? onPressed, required Widget child, WidgetStateProperty<
EdgeInsetsGeometry> ? msPadding, EdgeInsetsGeometry? padding = const EdgeInsets.fromLTRB(24, 16, 24, 16), WidgetStateProperty<EdgeInsetsGeometry> ? msShape, bool soft = false, OutlinedBorder? shape, BorderRadiusGeometry? borderRadius, double? borderRadiusAll, WidgetStateProperty<Color> ? msBackgroundColor, Color? backgroundColor, AuiButtonType? buttonType = AuiButtonType.outlined, ButtonStyle? style, WidgetStateProperty<BorderSide> ? msSide, bool? block = false, BorderSide? side, bool? disabled = false, Color borderColor = Colors.transparent, WidgetStateProperty<Color> ? msShadowColor, WidgetStateProperty<double> ? msElevation, double? elevation = 4, Color? shadowColor, MaterialTapTargetSize? tapTargetSize = MaterialTapTargetSize.padded, Color? splashColor}) -
const
-
AuiButton.rounded({Key? key, required VoidCallback? onPressed, required Widget child, WidgetStateProperty<
EdgeInsetsGeometry> ? msPadding, EdgeInsetsGeometry? padding, WidgetStateProperty<EdgeInsetsGeometry> ? msShape, OutlinedBorder? shape, BorderRadiusGeometry? borderRadius, double? borderRadiusAll, WidgetStateProperty<Color> ? msBackgroundColor, Color? backgroundColor, AuiButtonType? buttonType = AuiButtonType.elevated, ButtonStyle? style, bool? block = false, WidgetStateProperty<BorderSide> ? msSide, bool? disabled = false, BorderSide? side, bool soft = false, Color borderColor = Colors.transparent, WidgetStateProperty<Color> ? msShadowColor, WidgetStateProperty<double> ? msElevation, double? elevation = 4, Color? shadowColor, MaterialTapTargetSize? tapTargetSize = MaterialTapTargetSize.padded, Color? splashColor}) -
const
-
AuiButton.small({Key? key, required VoidCallback? onPressed, required Widget child, WidgetStateProperty<
EdgeInsetsGeometry> ? msPadding, EdgeInsetsGeometry? padding = const EdgeInsets.fromLTRB(8, 4, 8, 4), WidgetStateProperty<EdgeInsetsGeometry> ? msShape, OutlinedBorder? shape, BorderRadiusGeometry? borderRadius, double? borderRadiusAll, WidgetStateProperty<Color> ? msBackgroundColor, Color? backgroundColor, AuiButtonType? buttonType = AuiButtonType.elevated, ButtonStyle? style, bool? block = false, WidgetStateProperty<BorderSide> ? msSide, bool soft = false, bool? disabled = false, BorderSide? side, Color borderColor = Colors.transparent, WidgetStateProperty<Color> ? msShadowColor, WidgetStateProperty<double> ? msElevation, double? elevation = 4, Color? shadowColor, MaterialTapTargetSize? tapTargetSize = MaterialTapTargetSize.padded, Color? splashColor}) -
const
-
AuiButton.text({Key? key, required VoidCallback? onPressed, required Widget child, WidgetStateProperty<
EdgeInsetsGeometry> ? msPadding, EdgeInsetsGeometry? padding = const EdgeInsets.all(0), WidgetStateProperty<EdgeInsetsGeometry> ? msShape, bool? block = false, OutlinedBorder? shape, bool soft = false, BorderRadiusGeometry? borderRadius, double? borderRadiusAll, WidgetStateProperty<Color> ? msBackgroundColor, Color? backgroundColor, AuiButtonType? buttonType = AuiButtonType.text, ButtonStyle? style, WidgetStateProperty<BorderSide> ? msSide, bool? disabled = false, BorderSide? side, Color borderColor = Colors.transparent, WidgetStateProperty<Color> ? msShadowColor, WidgetStateProperty<double> ? msElevation, double? elevation = 4, Color? shadowColor, MaterialTapTargetSize? tapTargetSize = MaterialTapTargetSize.padded, Color? splashColor}) -
const
Properties
- backgroundColor → Color?
-
Static background color for the button.
final
- block → bool?
-
Whether the button should take full width.
final
- borderColor → Color
-
Border color of the button.
final
- borderRadius → BorderRadiusGeometry?
-
Custom border radius.
final
- borderRadiusAll → double?
-
Border radius applied to all corners.
final
-
Defines the type of button (elevated, outlined, or text).
final
- child → Widget
-
The child widget displayed inside the button.
final
- disabled → bool?
-
Whether the button is disabled.
final
- elevation → double?
-
Static elevation for the button.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
msBackgroundColor
→ WidgetStateProperty<
Color> ? -
Custom background color using WidgetStateProperty.
final
-
msElevation
→ WidgetStateProperty<
double> ? -
Custom elevation using WidgetStateProperty.
final
-
msPadding
→ WidgetStateProperty<
EdgeInsetsGeometry> ? -
Custom padding using WidgetStateProperty.
final
-
msShadowColor
→ WidgetStateProperty<
Color> ? -
Custom shadow color using WidgetStateProperty.
final
-
msShape
→ WidgetStateProperty<
EdgeInsetsGeometry> ? -
Custom shape using WidgetStateProperty.
final
-
msSide
→ WidgetStateProperty<
BorderSide> ? -
Custom border style using WidgetStateProperty.
final
- onPressed → VoidCallback?
-
Callback function to be executed when the button is pressed.
final
- padding → EdgeInsetsGeometry?
-
Static padding for the button.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shadowColor → Color?
-
Static shadow color.
final
- shape → OutlinedBorder?
-
Static shape of the button.
final
- side → BorderSide?
-
Static border style.
final
- soft → bool
-
If
true, applies a soft color variation.final - splashColor → Color?
-
Splash color when the button is pressed.
final
- style → ButtonStyle?
-
Custom button style, if provided.
final
- tapTargetSize → MaterialTapTargetSize?
-
Defines the tap target size for the button.
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
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