ScrollBuilder class

This widget can be placed on top of a ListView or SingleChildScrollView to easily add a RefreshIndicator or Scrollbar.

If showScrollbarWhenDesktopOrWeb is true, a mouse scrollable scrollbar will be displayed only on PC or Web.

If onRefresh is not null, a RefreshIndicator will be placed and Pull to Refresh will be enabled.

Please pass a ListView or SingleChildScrollView to builder.

An internal ScrollController is created and passed to builder. If you want to specify your own ScrollController, pass it to controller.

ListViewSingleChildScrollViewの上に配置することで、RefreshIndicatorScrollbarを簡単に追加できるようにするためのウィジェットです。

showScrollbarWhenDesktopOrWebtrueにすると、PCやWebでのみマウスでドラッグ可能なスクロールバーを表示します。

onRefreshnullでない場合、RefreshIndicatorを配置し、Pull to Refreshを有効にします。

builderListViewSingleChildScrollViewを渡してください。

内部でScrollControllerが作られ、それがbuilderに渡されます。自身でScrollControllerを指定したい場合はcontrollerに渡してください。

Inheritance
Available Extensions

Constructors

ScrollBuilder({Key? key, Future<void> onRefresh()?, ScrollController? controller, bool showScrollbarWhenDesktopOrWeb = true, required Widget builder(BuildContext context, ScrollController controller)})
This widget can be placed on top of a ListView or SingleChildScrollView to easily add a RefreshIndicator or Scrollbar.
const

Properties

builder Widget Function(BuildContext context, ScrollController controller)
Please pass a ListView or SingleChildScrollView to builder.
final
controller ScrollController?
An internal ScrollController is created and passed to builder. If you want to specify your own ScrollController, pass it to controller.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onRefresh → (Future<void> Function()?)
If onRefresh is not null, a RefreshIndicator will be placed and Pull to Refresh will be enabled.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showScrollbarWhenDesktopOrWeb bool
If showScrollbarWhenDesktopOrWeb is true, a mouse scrollable scrollbar will be displayed only on PC or Web.
final

Methods

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