MiuixScrollEndHaptic class

当可滚动内容被惯性甩到起始/末尾边界时触发一次触觉反馈。 对应 Kotlin Modifier.scrollEndHaptic()

用法:用它包裹含有可滚动子组件(如 ListViewSingleChildScrollView)的子树:

MiuixScrollEndHaptic(
  child: ListView(children: [...]),
)

语义与原版一致:从边界往内容方向滚动时复位状态;仅在「甩动越界且被消费的速度 不算太小」时触发,且每次触边只触发一次,避免连续抖动。

Inheritance

Constructors

MiuixScrollEndHaptic({Key? key, MiuixHapticFeedbackType hapticFeedbackType = MiuixHapticFeedbackType.textHandleMove, required Widget child})
const

Properties

child Widget
final
hapticFeedbackType MiuixHapticFeedbackType
触觉类型。对应 Kotlin hapticFeedbackType(默认 TextHandleMove)。
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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