LzListView class

It allows you to quickly create scrollable lists of child widgets and provides options for customizing the scrolling behavior and appearance.

Example usage:

LzListView(
  controller: myScrollController, // Optional custom ScrollController.
  scrollLimit: [100.0, 500.0], // Optional scroll limits to restrict scrolling within a range.
  children: [Widget1(), Widget2(), ...], // List of child widgets.
  padding: EdgeInsets.all(16.0), // Optional padding around the list.
  shrinkWrap: false, // Whether the list should shrink-wrap its children.
  physics: BounceScroll(), // Custom scroll physics, defaults to BounceScroll.
  onScroll: (controller) {
    // Callback when the list is scrolled.
  },
  autoCache: true, // Whether to automatically cache the list height.
)
Inheritance
Available extensions

Constructors

LzListView({Key? key, ScrollController? controller, List<double>? scrollLimit, List<Widget> children = const [], EdgeInsetsGeometry? padding, bool shrinkWrap = false, ScrollPhysics? physics, dynamic onScroll(Scroller scroll)?, bool autoCache = false, bool reverse = false, void onRefresh()?, RefrehtorType refreshType = RefrehtorType.bar, RefreshtorStyle? refreshStyle, double? gap})
Create widget
const

Properties

autoCache bool
Whether to automatically cache the list height.
final
children List<Widget>
List of child widgets.
final
controller ScrollController?
Optional custom ScrollController.
final
gap double?
Gap between items in the list.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
lz LzModifiers

Available on Widget, provided by the LzExtension extension

Returns an instance of LzModifiers for applying Lazuli UI modifiers to the widget.
no setter
onRefresh → void Function()?
Optional callback when the list is refreshed.
final
onScroll → dynamic Function(Scroller scroll)?
Callback when the list is scrolled.
final
padding EdgeInsetsGeometry?
Optional padding around the list.
final
physics ScrollPhysics?
Custom scroll physics, defaults to BounceScroll.
final
refreshStyle RefreshtorStyle?
Style of refresh indicator to be displayed.
final
refreshType RefrehtorType
Type of refresh indicator to be displayed.
final
reverse bool
Reverse list view
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollLimit List<double>?
Optional scroll limits to restrict scrolling within a range.
final
shrinkWrap bool
Whether the list should shrink-wrap its children.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<LzListView>
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
margin({double? t, double? b, double? l, double? r, double? v, double? h, double? tlr, double? blr, double others = 0, double? all}) Widget

Available on Widget, provided by the LzWidgetExtension extension

YourWidget().margin() // Only works on widget with no margin property
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onTap(dynamic onTap(), {bool? hoverable}) Touch

Available on Widget, provided by the LzWidgetExtension extension

YourWidget().onTap(() {})
padding({double? t, double? b, double? l, double? r, double? v, double? h, double? tlr, double? blr, double others = 0, double? all}) Widget

Available on Widget, provided by the LzWidgetExtension extension

YourWidget().padding() // Only works on widget with no padding property
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