AdaptiveButton class

Inheritance

Constructors

AdaptiveButton({required Widget child, VoidCallback? onLongPress, ValueChanged<bool>? onHighlightChanged, Color? focusColor, Color? hoverColor, Color? highlightColor, Color? splashColor, double elevation = 2.0, double focusElevation = 4.0, double hoverElevation = 4.0, double highlightElevation = 8.0, double disabledElevation = 0.0, EdgeInsetsGeometry padding = EdgeInsets.zero, ShapeBorder shape = const RoundedRectangleBorder(), Duration animationDuration = kThemeChangeDuration, Clip clipBehavior = Clip.none, FocusNode? focusNode, bool autofocus = false, MaterialTapTargetSize? materialTapTargetSize, VoidCallback? onPressed, Color? color, ButtonTextTheme? textTheme, Color? buttonColor, Color? textColor, Color? disabledTextColor, Color? disabledColor, Brightness? colorBrightness, Widget? icon, Widget? label})
AdaptiveButton.icon({Key? key, required Widget child, VoidCallback? onLongPress, ValueChanged<bool>? onHighlightChanged, Color? focusColor, Color? hoverColor, Color? highlightColor, Color? splashColor, double elevation = 2.0, double focusElevation = 4.0, double hoverElevation = 4.0, double highlightElevation = 8.0, double disabledElevation = 0.0, EdgeInsetsGeometry padding = EdgeInsets.zero, ShapeBorder shape = const RoundedRectangleBorder(), Duration animationDuration = kThemeChangeDuration, Clip clipBehavior = Clip.none, FocusNode? focusNode, bool autofocus = false, MaterialTapTargetSize? materialTapTargetSize, VoidCallback? onPressed, Color? color, ButtonTextTheme? textTheme, Color? buttonColor, Color? textColor, Color? disabledTextColor, Color? disabledColor, Brightness? colorBrightness, BorderRadius? borderRadius, Widget? icon, Widget? label})
AdaptiveButton.raised({Key? key, required Widget child, VoidCallback? onLongPress, ValueChanged<bool>? onHighlightChanged, Color? focusColor, Color? hoverColor, Color? highlightColor, Color? splashColor, double elevation = 2.0, double focusElevation = 4.0, double hoverElevation = 4.0, double highlightElevation = 8.0, double disabledElevation = 0.0, EdgeInsetsGeometry padding = EdgeInsets.zero, ShapeBorder shape = const RoundedRectangleBorder(), Duration animationDuration = kThemeChangeDuration, Clip clipBehavior = Clip.none, FocusNode? focusNode, bool autofocus = false, MaterialTapTargetSize? materialTapTargetSize, VoidCallback? onPressed, Color? color, ButtonTextTheme? textTheme, Color? buttonColor, Color? textColor, Color? disabledTextColor, Color? disabledColor, Brightness? colorBrightness, BorderRadius? borderRadius, Widget? icon, Widget? label})

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
borderRadius BorderRadius?
ONLY USED ON CUPERTINO
final
buttonColor Color?
Recommended to use ThemeData in AdaptiveApp to set the button's color.
final
child Widget
The button's content
final
clipBehavior Clip
Defaults to Clip.none, and must not be null.
final
color Color?
The button's color
final
colorBrightness Brightness?
The theme brightness to use for this button.
final
disabledColor Color?
The fill color of the button when the button is disabled.
final
disabledElevation double
The elevation for the button's Material relative to its parent 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 z-coordinate at which to place this button relative to its parent.
final
enabled bool
Whether the button is enabled or disabled.
no setter
focusColor Color?
The fill color of 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
hashCode int
The hash code for this object.
no setterinherited
highlightColor Color?
The color usually taken for a material ripple effect. NOTE: no effect on Cupertino.
final
highlightElevation double
The elevation for the button's Material relative to its parent when the button is enabled and pressed.
final
hoverColor Color?
The color usually taken for a click/hover. NOTE: no effect on Cupertino.
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?
Used when having an icon button, currently not implemented for Cupertino.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
label Widget?
Used when having an icon button, currently not implemented for Cupertino.
final
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?
The callback that is called when the button is long-pressed.
final
onPressed VoidCallback?
The press callback
final
padding EdgeInsetsGeometry
The internal padding for the button's child.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shape ShapeBorder
The shape of the button's Material.
final
splashColor Color?
The splash color of the button's InkWell.
final
textColor Color?
The color to use for this button's text.
final
textTheme ButtonTextTheme?
This is used on Material only; specifies the appearance of the text in contrast to button's surface color. NOTE: no effect on Cupertino.
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}) 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