ElScrollbar class

Inheritance
Available extensions

Constructors

ElScrollbar({Key? key, required Widget child, ElScrollbarShowMode showMode = ElScrollbarShowMode.hover, ScrollController? controller, double thickness = 8.0, OutlinedBorder? shape, Radius radius = const Radius.circular(4.0), Radius? trackRadius, double mainAxisMargin = 0.0, double crossAxisMargin = 1.0, EdgeInsets? padding, double minThumbLength = 36.0, Color trackColor = Colors.transparent, Color trackBorderColor = Colors.transparent, bool paintSecondTrackBorder = false, double trackBorderWidth = 1.0, Color thumbColor = const Color.fromRGBO(144, 147, 153, .45), Color thumbActiveColor = const Color.fromRGBO(144, 147, 153, .9), bool ignorePointer = false, bool ignoreTrackPointer = false, Duration fadeDuration = const Duration(milliseconds: 200), Duration timeToFade = const Duration(milliseconds: 1000), Duration trackScrollDuration = const Duration(milliseconds: 350), ScrollbarOrientation? scrollbarOrientation, ScrollNotificationPredicate notificationPredicate = defaultScrollNotificationPredicate})
Element UI 滚动条,由于可以通过 ScrollConfiguration 配置默认滚动条,所以并未提供 ThemeData 配置
const

Properties

child Widget
final
controller ScrollController?
滚动控制器
final
crossAxisMargin double
滚动条离轨道之间的间距,默认 1.0
final
fadeDuration Duration
滚动条淡入、淡出过渡动画持续时间
final
hashCode int
The hash code for this object.
no setterinherited
ignorePointer bool
是否忽略滚动条指针事件,若为 true,将不允许拖拽滚动条
final
ignoreTrackPointer bool
否忽略轨道指针事件
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
mainAxisMargin double
滚动条离顶部、尾部之间的间距,默认 0.0
final
minThumbLength double
滚动条最小长度
final
notificationPredicate ScrollNotificationPredicate
根据滚动通知响应的 depth 来决定滚动条是否触发滚动,默认 defaultScrollNotificationPredicate, 它返回的条件是 notification.depth == 0,假如你嵌套了多个滚动容器,要让滚动条响应第二滚动容器只需要返回 notification.depth == 1, 应用场景:同时显示垂直、水平滚动条,详细信息请参阅 element_ui/lib 滚动条示例。
final
padding EdgeInsets?
滚动条和轨道内边距
final
paintSecondTrackBorder bool
是否绘制第二条轨道边框,默认情况下,ScrollbarPainter 只会绘制一条轨道, 如果你的布局没有使用 Border 分割页面,那么局部滚动条的轨道将会显得非常突兀。
final
radius Radius
滚动条圆角
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollbarOrientation ScrollbarOrientation?
滚动条在滚动容器中的位置,默认情况下,如果是垂直滚动,滚动条放置在右边,水平滚动滚动条放置在底部
final
shape OutlinedBorder?
自定义滚动条形状,只能在 radius 之间二选一
final
showMode ElScrollbarShowMode
滚动条显示模式,默认 ElScrollbarShowMode.hover
final
thickness double
滚动条粗细值
final
thumbActiveColor Color
滚动条激活颜色
final
thumbColor Color
滚动条颜色
final
timeToFade Duration
当交互停止时,滚动条多久才会隐藏,仅限 mode = ElScrollbarShowMode.onlyScrolling
final
trackBorderColor Color
轨道边框颜色,默认透明
final
trackBorderWidth double
轨道边框宽度
final
trackColor Color
轨道颜色,默认透明
final
trackRadius Radius?
滚动轨道圆角
final
trackScrollDuration Duration
点击轨道滚动跳转动画持续时间
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<ElScrollbar>
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
noScrollbarBehavior(BuildContext context, {Key? key, bool? overscroll, bool enabled = true}) Widget

Available on Widget, provided by the FlutterWidgetExt extension

不使用祖先提供的默认滚动条,当使用自定义滚动条时请添加此扩展方法,防止与祖先提供的默认滚动条重叠
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