SliverWaterfallFlowDelegate class abstract
create by zmtzawqlp on 2019/11/9
Controls the masonry layout of tiles.
Given the current constraints on the grid, a SliverGridDelegate computes the masonry layout for the tiles in the grid. The tiles can be placed as masonry layout with equally cross-axis sized and spaced. A contiguous sequence of children are laid out after the shortest one of the previous row/column。
See also:
- SliverWaterfallFlowDelegateWithFixedCrossAxisCount, which creates a masonry layout with a fixed number of tiles in the cross axis.
- SliverWaterfallFlowDelegateWithMaxCrossAxisExtent, which creates a masonry layout that have a maximum cross-axis extent.
GridMasonryView
, which uses this delegate to control the layout of its tiles.- SliverWaterfallFlow, which uses this delegate to control the layout of its tiles.
- RenderSliverWaterfallFlow, which uses this delegate to control the layout of its tiles.
- Inheritance
-
- Object
- ExtendedListDelegate
- SliverWaterfallFlowDelegate
Constructors
- SliverWaterfallFlowDelegate({double mainAxisSpacing = 0.0, double crossAxisSpacing = 0.0, LastChildLayoutTypeBuilder? lastChildLayoutTypeBuilder, CollectGarbage? collectGarbage, ViewportBuilder? viewportBuilder, bool closeToTrailing = false})
-
Creates a delegate that makes masonry layout with tiles in
the cross axis.
const
Properties
- closeToTrailing → bool
-
when reverse property of List is true, layout is as following.
it likes chat list, and new session will insert to zero index
but it's not right when items are not full of viewport.
finalinherited
- collectGarbage → CollectGarbage?
-
Call when collect garbage, return indexes of children which are disposed to collect
finalinherited
- crossAxisSpacing → double
-
The number of logical pixels between each child along the cross axis.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- lastChildLayoutTypeBuilder → LastChildLayoutTypeBuilder?
-
The builder to get layout type of last child
Notice: it should only for last child
finalinherited
- mainAxisSpacing → double
-
The number of logical pixels between each child along the main axis.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- viewportBuilder → ViewportBuilder?
-
The builder to get indexes in viewport
finalinherited
Methods
-
getChildUsableCrossAxisExtent(
SliverConstraints constraints) → double - Return usable cross-axis extent of each child.
-
getCrossAxisCount(
SliverConstraints constraints) → int -
Return
crossAxisCount
by SliverWaterfallFlowDelegateWithFixedCrossAxisCount and SliverWaterfallFlowDelegateWithMaxCrossAxisExtent. -
getCrossAxisOffset(
SliverConstraints constraints, int? crossAxisIndex) → double - Return the offset of the child in the non-scrolling axis.
-
getLastChildLayoutType(
int index) → LastChildLayoutType -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
shouldRelayout(
SliverWaterfallFlowDelegate oldDelegate) → bool - Return true when the children need to be laid out.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited