ListView class

A list view component for displaying scrollable lists.

Inheritance

Constructors

ListView({Key? key, List<Component> children = const [], double gap = 0, String? padding, bool horizontal = false})
const
ListView.builder({Key? key, required Component builder(BuildContext context, int index)?, required int? itemCount, double gap = 0, String? padding, bool horizontal = false})
const

Properties

builder Component Function(BuildContext context, int index)?
Builder for dynamic list generation.
final
children List<Component>
Children to display in the list.
final
gap double
Gap between items.
final
hashCode int
The hash code for this object.
no setterinherited
horizontal bool
Whether the list scrolls horizontally.
final
itemCount int?
Number of items when using builder.
final
key Key?
Controls how one component replaces another component in the tree.
finalinherited
padding String?
Padding around the list.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

build(BuildContext context) Component
Describes the part of the user interface represented by this component.
override
createElement() Element
Creates a StatelessElement to manage this component's location in the tree.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
shouldRebuild(covariant Component newComponent) bool
Implement this method to determine whether a rebuild can be skipped.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited