CustomSlidingSegmentedControl<T> class

Example:

CustomSlidingSegmentedControl<int>(
  fromMax: true,
  children: {
    1: Text('Segmentation'),
    2: Text('Max'),
  },
  thumbDecoration: BoxDecoration(
    color: Colors.white,
    boxShadow: [
      BoxShadow(
        color: Colors.black.withOpacity(.3),
        blurRadius: 4.0,
        spreadRadius: 1.0,
        offset: Offset(
          0.0,
          2.0,
        ),
      ),
    ],
  ),
  onValueChanged: (int value) {
    print(value);
  },
),
Inheritance

Constructors

CustomSlidingSegmentedControl.new({Key? key, required Map<T, Widget> children, required ValueChanged<T> onValueChanged, bool isDisabled = false, T? initialValue, Duration duration = const Duration(milliseconds: 200), Curve curve = Curves.easeInOut, EdgeInsets innerPadding = const EdgeInsets.all(2.0), double padding = 12, double? fixedWidth, Decoration? decoration = const BoxDecoration(color: CupertinoColors.systemGrey5), Decoration? thumbDecoration = const BoxDecoration(color: Colors.white), bool isStretch = false, bool fromMax = false, bool isShowDivider = false, DividerSettings dividerSettings = const DividerSettings(), Clip clipBehavior = Clip.none, double? height = 40, CustomSegmentedController<T>? controller, CustomSegmentSettings? customSegmentSettings, void onHoverSegment(T value, bool isHover)?, bool onTapSegment(T? segment)?})
const

Properties

children Map<T, Widget>
final
clipBehavior Clip
for container
final
controller CustomSegmentedController<T>?
final
curve Curve
Curve for animated panel
final
customSegmentSettings CustomSegmentSettings?
final
decoration Decoration?
Decoration main panel
final
dividerSettings DividerSettings
final
duration Duration
Speed animation panel
final
fixedWidth double?
fixed width items
final
fromMax bool
Get the largest element, while the rest of the elements get its size
final
hashCode int
The hash code for this object.
no setterinherited
height double?
height panel
final
initialValue → T?
Initial segment
final
innerPadding EdgeInsets
final
isDisabled bool
true if the switch control is disabled, default to false
final
isShowDivider bool
final
isStretch bool
Stretches CustomSlidingSegmentedControl to full width
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onHoverSegment → void Function(T value, bool isHover)?
final
onTapSegment bool Function(T? segment)?
if the function returns false, there will be no transition to the segment
final
onValueChanged ValueChanged<T>
On change current segment
final
padding double
Item padding
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
thumbDecoration Decoration?
Decoraton animation panel
final

Methods

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