FlatList<T> class
Root of the FlatList widget tree.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- FlatList
Constructors
-
FlatList({Key? key, required List<
T> data, required ItemBuilder<T> buildItem, Widget? listHeaderWidget, Widget? listEmptyWidget, Widget? listLoadingWidget, Widget? itemSeparatorWidget, bool loading = false, int numColumns = 1, double onEndReachedDelta = 200, VoidCallback? onEndReached, dynamic onScroll(double maxScroll, double currentScroll)?, RefreshCallback? onRefresh, Color? refreshIndicatorColor, double refreshIndicatorStrokeWidth = 2.0, double childAspectRatio = 1, double mainAxisSpacing = 10, double crossAxisSpacing = 10, bool horizontal = false, ScrollController? controller, bool inverted = false}) -
const
Properties
-
buildItem
→ ItemBuilder<
T> -
The
required
parameter that specifies the widget builder for the list item.final - childAspectRatio → double
-
final
- controller → ScrollController?
-
When you want to provide full controls over the list,
you can pass controller to the FlatList.
final
- crossAxisSpacing → double
-
final
-
data
→ List<
T> -
The
required
parameter that specifies the data source for the list.final - hashCode → int
-
The hash code for this object.
no setterinherited
- horizontal → bool
-
Make horizontal list view when value is
true
.final - inverted → bool
-
Invert the scroll direction. This argument is often used when you are building a chat list.
final
- itemSeparatorWidget → Widget?
-
The list separator that attaches to bottom each list item.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- listEmptyWidget → Widget?
-
The widget to render when the list is empty.
final
-
The footer widget to render which is scrollable with list item.
final
- listHeaderWidget → Widget?
-
The header widget to render which is scrollable with list item.
final
- listLoadingWidget → Widget?
-
The widget to render when the list is loading.
The loading will be available at the bottom of the list.
final
- loading → bool
-
The
loading
state value.final - mainAxisSpacing → double
-
final
- numColumns → int
-
Only works when horizontal is
true
.final - onEndReached → VoidCallback?
-
The callback when user reaches the bottom of the list.
final
- onEndReachedDelta → double
-
The parameter to specify when onEndReached should be called.
final
- onRefresh → RefreshCallback?
-
RefreshControl props
The callback when user pulls the list to refresh.
final
- onScroll → dynamic Function(double maxScroll, double currentScroll)?
-
The callback when user scrolls.
It returns
maxScroll
andcurrentScroll
as parameters.final - refreshIndicatorColor → Color?
-
The color of the refresh indicator.
final
- refreshIndicatorStrokeWidth → double
-
The color of the refresh indicator's stroke.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< FlatList> -
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