TButton class
A highly customizable button
- Inheritance
Constructors
-
TButton.new({required Widget child, Key? key, Widget? leading, Widget? trailing, MainAxisAlignment? mainAxisAlignment, Widget? loading, TStyleTheme? theme, TWidgetSize size = TWidgetSize.md, Color? color, TextStyle? baseTextStyle, TWidgetStatesController? controller, VoidCallback? onPressed, ValueChanged<
bool> ? onHover, String? tooltip, bool selectableText = false}) -
Creates a basic TButton button (TStyleVariant.basic).
const
-
TButton.filled({required Widget child, Key? key, Widget? leading, Widget? trailing, MainAxisAlignment? mainAxisAlignment, Widget? loading, TStyleTheme? theme, TWidgetSize size = TWidgetSize.md, Color? color, TextStyle? baseTextStyle, TWidgetStatesController? controller, VoidCallback? onPressed, ValueChanged<
bool> ? onHover, String? tooltip, bool selectableText = false}) -
Creates a filled TButton button (TStyleVariant.filled).
const
-
TButton.outlined({required Widget child, Key? key, Widget? leading, Widget? trailing, MainAxisAlignment? mainAxisAlignment, Widget? loading, TStyleTheme? theme, TWidgetSize size = TWidgetSize.md, Color? color, TextStyle? baseTextStyle, TWidgetStatesController? controller, VoidCallback? onPressed, ValueChanged<
bool> ? onHover, String? tooltip, bool selectableText = false}) -
Creates an outlined TButton button (TStyleVariant.outlined).
const
-
TButton.raw({required Widget child, required TStyleVariant variant, Key? key, Widget? leading, Widget? trailing, MainAxisAlignment? mainAxisAlignment, Widget? loading, TStyleTheme? theme, TWidgetSize size = TWidgetSize.md, Color? color, TextStyle? baseTextStyle, TWidgetStatesController? controller, VoidCallback? onPressed, ValueChanged<
bool> ? onHover, String? tooltip, bool selectableText = false}) -
Creates a raw TButton button.
const
-
TButton.soft({required Widget child, Key? key, Widget? leading, Widget? trailing, MainAxisAlignment? mainAxisAlignment, Widget? loading, TStyleTheme? theme, TWidgetSize size = TWidgetSize.md, Color? color, TextStyle? baseTextStyle, TWidgetStatesController? controller, VoidCallback? onPressed, ValueChanged<
bool> ? onHover, String? tooltip, bool selectableText = false}) -
Creates a soft TButton button (TStyleVariant.soft).
const
Properties
- baseTextStyle → TextStyle?
-
The base text style for the badge.
final
- child → Widget
-
The custom theme override for the button.
final
- color → Color?
-
The color to use for button styling.
final
- controller → TWidgetStatesController?
-
The controller 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
- leading → Widget?
-
The a leading widget for the badge.
final
- loading → Widget?
-
The widget to display when the TWidgetStatesController is in a loading state.
final
- mainAxisAlignment → MainAxisAlignment?
-
The alignment of the button content.
final
-
onHover
→ ValueChanged<
bool> ? -
Called when a pointer enters or exits the response area.
final
- onPressed → VoidCallback?
-
An action to call when the button is pressed.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectableText → bool
-
Whether or not the button text is selectable, by default it is not.
final
- size → TWidgetSize
-
The custom theme override for the button.
final
- theme → TStyleTheme?
-
The custom theme override for the button.
final
- tooltip → String?
-
The tooltip to display when hovering over the button.
final
- trailing → Widget?
-
The a trailing widget for the badge.
final
- variant → TStyleVariant
-
The variant of 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
Static Methods
-
getDefaultBorderRadius(
TWidgetSize size) → BorderRadius - The border radius associated with the given TWidgetSize.
-
getDefaultHeight(
TWidgetSize size) → double - The fixed height associated with the given TWidgetSize.
-
getDefaultPadding(
TWidgetSize size) → EdgeInsetsGeometry - Fallback padding based on the size of the button.
-
getDefaultTextStyle(
TWidgetSize size) → TextStyle - The default text style associated with the given TWidgetSize.