SSwitcher class

A widget that displays a value with decrement (-) and increment (+) buttons. It is composed of a prefix widget (title or custom prefix), a value widget (text or custom value widget), and a suffix widget (suffix text or custom suffix).

Inheritance
Available extensions

Constructors

SSwitcher({Key? key, required String valueText, String? title, TextStyle? titleStyle, String? titleTooltip, Widget? customPrefix, VoidCallback? onDecrement, VoidCallback? onIncrement, bool enableDecrement = true, bool enableIncrement = true, String? suffixText, TextStyle? suffixTextStyle, Widget? customSuffix, Decoration? containerDecoration, EdgeInsetsGeometry containerPadding = const EdgeInsets.symmetric(horizontal: 10, vertical: 8), Decoration? valueContainerDecoration, EdgeInsetsGeometry valueContainerPadding = const EdgeInsets.symmetric(horizontal: 10, vertical: 4), EdgeInsetsGeometry valueContainerMargin = const EdgeInsets.symmetric(horizontal: 8), double valueMinWidth = 26, IconData decrementIcon = Icons.remove_circle_outline_rounded, IconData incrementIcon = Icons.add_circle_outline_rounded, double iconSize = 18, Color? iconColor, TextStyle? valueTextStyle})
const

Properties

containerDecoration Decoration?
Decoration for the outer container.
final
containerPadding EdgeInsetsGeometry
final
customPrefix Widget?
Custom prefix widget to display instead of the title.
final
customSuffix Widget?
Custom suffix widget to display instead of the suffix text.
final
decrementIcon IconData
Custom icon data for decrement button
final
enableDecrement bool
Whether the decrement button is enabled. Defaults to true.
final
enableIncrement bool
Whether the increment button is enabled. Defaults to true.
final
hashCode int
The hash code for this object.
no setterinherited
iconColor Color?
final
iconSize double
final
incrementIcon IconData
Custom icon data for increment button
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onDecrement VoidCallback?
Callback when the decrement (-) button is tapped.
final
onIncrement VoidCallback?
Callback when the increment (+) button is tapped.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
suffixText String?
Optional suffix text displayed on the right.
final
suffixTextStyle TextStyle?
final
title String?
Optional title displayed on the left.
final
titleStyle TextStyle?
final
titleTooltip String?
Optional tooltip for the title.
final
valueContainerDecoration Decoration?
Decoration for the value container.
final
valueContainerMargin EdgeInsetsGeometry
final
valueContainerPadding EdgeInsetsGeometry
final
valueMinWidth double
final
valueText String
The text to display in the center (the value).
final
valueTextStyle TextStyle?
final

Methods

addMaterialWidget() Material

Available on Widget, provided by the GenericExtensions extension

addTooltipWidget(String toolTip) Tooltip

Available on Widget, provided by the GenericExtensions extension

borderRadius([BorderRadiusGeometry? borderRadius]) Widget

Available on Widget, provided by the GenericExtensions extension

boxDecoration([BoxDecoration? boxDecoration]) Widget

Available on Widget, provided by the GenericExtensions extension

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
colorFilter([ColorFilter? colorFilter]) Widget

Available on Widget, provided by the GenericExtensions extension

set parent widget in center
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