SwitchCipper class

SwitchCipper

Inheritance

Constructors

SwitchCipper({Key? key, required Widget child, required Widget background, Duration duration = const Duration(milliseconds: 500), Curve curve = Curves.bounceOut, Curve reverseCurve = Curves.ease, bool? isSelect, bool? onSelect(bool result)?, AlignmentGeometry alignment = Alignment.center, SwitchCipperBuilder? customCipperBuilder, bool initSelect = false, OnAnimationStatusChanged? onAnimationComplate, double? value, bool hasAnimationWhenValueChanged = true, bool enableWhenAnimating = true})
const

Properties

alignment AlignmentGeometry
  • childbackground 的对齐方式
  • 默认 Alignment.center
  • final
    background Widget
    底层Widget
    final
    child Widget
    上层Widget
    final
    curve Curve
  • forward动画曲线
  • 默认Curves.bounceOut
  • final
    customCipperBuilder SwitchCipperBuilder?
  • 自定义裁切
  • 默认 FillClipper
  • final
    duration Duration
  • 动画持续时间
  • 默认 const Duration(milliseconds: 500)
  • final
    enableWhenAnimating bool
  • 动画能否被打断
  • if(!enableWhenAnimating) 动画必须执行完毕才能进行下一步动作
  • 默认 true
  • final
    hasAnimationWhenValueChanged bool
  • value变化时是否有动画
  • 默认true
  • final
    hashCode int
    The hash code for this object.
    no setterinherited
    initSelect bool
  • 初始化选中状态
  • 仅在widget创建时生效
  • 默认false
  • final
    isSelect bool?
  • 选中状态
  • isSelect!=nullonSelect 将失效
  • final
    key Key?
    Controls how one widget replaces another widget in the tree.
    finalinherited
    onAnimationComplate OnAnimationStatusChanged?
    动画执行状态回调
    final
    onSelect → (bool? Function(bool result)?)
  • 点击回调
  • result 回调值
  • 函数返回值将控制此次点击是否生效
  • final
    reverseCurve Curve
  • reverse动画曲线
  • 默认Curves.ease
  • final
    runtimeType Type
    A representation of the runtime type of the object.
    no setterinherited
    value double?
  • 当前值
  • 会覆盖 isSelectinitSelect
  • final

    Methods

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