ElScroll class
滚动小部件,它会一次性布局所有子项,但不会渲染可视窗口外的元素
- Inheritance
- Available extensions
Constructors
-
ElScroll({Key? key, required List<
Widget> children, ScrollController? controller, ScrollPhysics? physics, Clip clipBehavior = Clip.hardEdge, ScrollViewKeyboardDismissBehavior? keyboardDismissBehavior, EdgeInsets? padding, double? spacing, Widget? spacingWidget, bool center = false, bool excludeSemantics = false, String? debugLabel, String? cacheKey}) -
const
Properties
- cacheKey → String?
-
记录滚动位置缓存,注意:初始化定位时需要将位置传递给控制器,若你使用自定义控制器只能自己处理缓存
final
- center → bool
-
滚动内容是否居中
final
-
children
→ List<
Widget> -
final
- clipBehavior → Clip
-
final
- controller → ScrollController?
-
final
- debugLabel → String?
-
显示打印 ElScroll 布局耗时日志
final
- excludeSemantics → bool
-
是否忽略滚动区域的语义,若为 true 可以提高滚动性能
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- keyboardDismissBehavior → ScrollViewKeyboardDismissBehavior?
-
如果想要在滚动时隐藏键盘,可以设置 onDrag 参数
final
- padding → EdgeInsets?
-
final
- physics → ScrollPhysics?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- spacing → double?
-
设置滚动元素之间的间隔,它相当于给 spacingWidget 设置 SizedBox
final
- spacingWidget → Widget?
-
自定义元素之间的小部件
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
buildViewport(
BuildContext context, ViewportOffset offset) → Widget -
createElement(
) → _StatelessHookElement -
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
-
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