FlexThemeModeOptionButton class

Stateless widget that draws a box with the 4 colors, primary, primary variant secondary and secondary variant in the properties of passed in flexSchemeColor.

The widget has a required selected bool property for selected and not selected status. A VoidCallback provides onSelect provides select action callback info.

The FlexThemeModeOptionButton offers a large number of customization options, see API reference for more info. This widget is typically used via the FlexThemeModeSwitch widget.

Inheritance

Constructors

FlexThemeModeOptionButton({Key? key, required FlexSchemeColor flexSchemeColor, Color? backgroundColor, String? label, String? semanticLabel, TextStyle? labelStyle, bool labelAbove = true, required bool selected, VoidCallback? onSelect, BorderSide? selectedBorder, BorderSide? unselectedBorder, double elevation = 0, EdgeInsetsGeometry? optionButtonPadding, EdgeInsetsGeometry? optionButtonMargin, double optionButtonBorderRadius = 5, double height = 24, double width = 24, double borderRadius = 4, EdgeInsetsGeometry? padding, Color? hoverColor, Color? focusColor, bool? setFocusOnTap})
Default constructor.
const

Properties

backgroundColor Color?
The background color of the option button.
final
borderRadius double
The circular borderRadius of an individual scheme color box.
final
elevation double
The elevation of the option button.
final
flexSchemeColor FlexSchemeColor
The scheme colors used to colorize the option button's four colors.
final
focusColor Color?
The InkWell focus color for the option button.
final
hashCode int
The hash code for this object.
no setterinherited
height double
The height of an individual scheme color box.
final
hoverColor Color?
The InkWell hover color for the option button.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
label String?
Optional text label for the button.
final
labelAbove bool
Label is positioned above the option button.
final
labelStyle TextStyle?
Optional text style for the label.
final
onSelect VoidCallback?
The button was clicked and selected.
final
optionButtonBorderRadius double
The circular borderRadius of the option button,
final
optionButtonMargin EdgeInsetsGeometry?
The margin inside the option button, before the scheme color boxes.
final
optionButtonPadding EdgeInsetsGeometry?
Padding around the option button.
final
padding EdgeInsetsGeometry?
Padding around an individual scheme color box.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selected bool
The button is selected.
final
selectedBorder BorderSide?
Border side for the selected option state.
final
semanticLabel String?
Optional semantic label for the button.
final
setFocusOnTap bool?
If true, sets focus to the button when it is tapped.
final
unselectedBorder BorderSide?
Border side for the unselected option state.
final
width double
The width of an individual scheme color box.
final

Methods

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