CxButton class
Button Component
Button has two states that they are solid and fill. Set the value of type property.
Demo:
CxButton(
text: "Wechat",
type: CxButtonType.fill,
icon: Icons.wechat,
color: Colors.green,
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- CxButton
Constructors
- CxButton({Key? key, String? text, IconData? icon, CxButtonType? type = CxButtonType.solid, Color? color = const Color.fromARGB(255, 50, 73, 245), Color? textColor, Color? iconColor, double? radius = 20, EdgeInsetsGeometry? padding = const EdgeInsets.all(8), double? iconSize, double? textSize, bool shadow = true, double? width, double? height, bool disabled = false, void onTap()?})
-
const
Properties
- color → Color?
-
button color. default is blue.
final
- disabled → bool
-
the state of disabled. default
falsefinal - hashCode → int
-
The hash code for this object.
no setterinherited
- height → double?
-
button height.
final
- icon → IconData?
-
icon data.
final
- iconColor → Color?
-
the icon color. default is white.
final
- iconSize → double?
-
icon size. default 16.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onTap → void Function()?
-
click event.
final
- padding → EdgeInsetsGeometry?
-
button padding. default 8.
final
- radius → double?
-
border radius. default 20.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shadow → bool
-
whether to enable box shadow. default true.
final
- text → String?
-
button label.
final
- textColor → Color?
-
the label color. default is white.
final
- textSize → double?
-
text size. default 12.
final
- type → CxButtonType?
-
button type.
fillandsolidare the two states of the button.final - width → double?
-
button width.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< CxButton> -
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