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, TextStyle? labelStyle, bool labelAbove = true, required bool selected, VoidCallback? onSelect, BorderSide? selectedBorder, BorderSide? unselectedBorder, double elevation = 0, EdgeInsets? optionButtonPadding, EdgeInsets? optionButtonMargin, double optionButtonBorderRadius = 5, double height = 24, double width = 24, double borderRadius = 4, EdgeInsets? padding, Color? hoverColor})
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. Defaults to 4 dp.
final
elevation double
The elevation of the option button. Defaults to 0 dp.
final
flexSchemeColor FlexSchemeColor
The scheme colors used to colorize the option button's four colors.
final
hashCode int
The hash code for this object.
no setterinherited
height double
The height of an individual scheme color box. Defaults to 24 dp.
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, if null, the label is omitted.
final
labelAbove bool
If true, the label will be above the option button, if false the label will be below the option button. Defaults to true.
final
labelStyle TextStyle?
Optional text style for the label. If null, default to Theme.of(context).textTheme.caption).
final
onSelect VoidCallback?
The button was clicked and selected.
final
optionButtonBorderRadius double
The circular borderRadius of the option button Defaults to 5 dp.
final
optionButtonMargin EdgeInsets?
The margin inside the option button before the scheme color boxes. If null, defaults to EdgeInsets.all(4).
final
optionButtonPadding EdgeInsets?
Padding around the option button. If null, defaults to const EdgeInsetsDirectional.only(start: 6).
final
padding EdgeInsets?
Padding around an individual scheme color box. If null, default to const EdgeInsets.all(3)
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. If null, defaults to BorderSide(color: Theme.of(context).colorScheme.primary, width: 4).
final
unselectedBorder BorderSide?
Border side for the unselected option state. If null, defaults to BorderSide(color: Theme.of(context).dividerColor).
final
width double
The width of an individual scheme color box. Defaults to 24 dp.
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