ListBuilder<T> class

If source is given, each of its elements is displayed side by side in builder.

If top is set, the top elements are lined up before the source elements are lined up.

If bottom is set, the elements of bottom are lined up after the elements of source are lined up.

When insert is set, insert is inserted at the position of insertPosition in source.

If listenWhenListenable is true, ListenableListener will be wrapped around each element if source inherits Listenable. Therefore, each element of source is monitored individually, and if any element is updated, only that element is updated in the drawing.

sourceを与えるとその各要素をbuilderで並べて表示します。

topを設定するとsourceの要素を並べる前にtopの要素を並べます。

bottomを設定するとsourceの要素を並べた後にbottomの要素を並べます。

insertを設定するとsourceinsertPositionの位置にinsertが挿入されます。

listenWhenListenabletrueになっている場合、sourceListenableを継承している場合ListenableListenerが各要素にラップされます。 そのため、sourceの各要素をそれぞれ監視し、いずれかの要素が更新された場合その要素のみ描画が更新されます。

Inheritance
Available Extensions

Constructors

ListBuilder({Key? key, Axis scrollDirection = Axis.vertical, bool reverse = false, ScrollController? controller, bool? primary, ScrollPhysics? physics, bool shrinkWrap = false, EdgeInsetsGeometry? padding, List<Widget>? top, List<Widget>? insert, int insertPosition = 0, List<Widget>? bottom, double? itemExtent, required ListBuilderCallback<T> builder, required List<T> source, bool addAutomaticKeepAlives = true, bool addRepaintBoundaries = true, bool addSemanticIndexes = true, double? cacheExtent, int? semanticChildCount, bool listenWhenListenable = true, DragStartBehavior dragStartBehavior = DragStartBehavior.start, ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual, String? restorationId, Clip clipBehavior = Clip.hardEdge})
If source is given, each of its elements is displayed side by side in builder.
const

Properties

addAutomaticKeepAlives bool
If this is set to true, it will prevent a rebuild if AutomaticKeepAliveClientMixin is mixdrunk in the Widget in the List and is shown or hidden in the List.
final
addRepaintBoundaries bool
Set to true to provide a redraw area for the list (the part that is displayed on the screen).
final
addSemanticIndexes bool
Automatically add semantics indexes.
final
bottom List<Widget>?
If bottom is set, the elements of bottom are lined up after the elements of source are lined up.
final
builder ListBuilderCallback<T>
Builder to display on the list.
final
cacheExtent double?
Specify the area to hold the cache.
final
clipBehavior Clip
Specify here to adjust the clip function of the listing.
final
controller ScrollController?
If you want to control scrolling from the outside, pass ScrollController.
final
dragStartBehavior DragStartBehavior
Provides the ability to initiate a drag.
final
hashCode int
The hash code for this object.
no setterinherited
insert List<Widget>?
When insert is set, insert is inserted at the position of insertPosition in source.
final
insertPosition int
If an element of insert exists, insert insert at the insertPositionth position of source.
final
itemExtent double?
The height (width) of each element. If Null, the bare height (width) of each element is set.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyboardDismissBehavior ScrollViewKeyboardDismissBehavior
Define here if you want to implement a mechanism to close the keyboard triggered by scrolling.
final
listenWhenListenable bool
If listenWhenListenable is true, ListenableListener will be wrapped around each element if source inherits Listenable. Therefore, each element of source is monitored individually, and if any element is updated, only that element is updated in the drawing.
final
padding EdgeInsetsGeometry?
List view padding.
final
physics ScrollPhysics?
Pass ScrollPhysics to set the scrolling method.
final
primary bool?
If this is true, it is recognized as the primary scrolling view.
final
restorationId String?
Restore ID to save and restore the scroll offset of the listing.
final
reverse bool
If this is true, the scroll direction is reversed.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollDirection Axis
Scroll direction.
final
semanticChildCount int?
Explicitly communicate the number of child widgets.
final
shrinkWrap bool
If this is true, the area for scrolling is reduced to only where the content resides.
final
source List<T>
List of data to be displayed in the list.
final
top List<Widget>?
If top is set, the top elements are lined up before the source elements are lined up.
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
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
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