AnimatedGridView<E extends Object> class
A Flutter AnimatedGridView that animates insertion and removal of the item.
enterTransition: [FadeIn(), ScaleIn()],
Effects are always run in parallel (ie. the fade and scale effects in the example above would be run simultaneously), but you can apply delays to offset them or run them in sequence.
/// All list items must have a key.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- AnimatedGridView
Constructors
-
AnimatedGridView.new({Key? key, required List<
E> items, required ItemBuilder<Widget, E> itemBuilder, required SliverGridDelegate sliverGridDelegate, List<AnimationEffect> ? enterTransition, List<AnimationEffect> ? exitTransition, Duration? insertDuration, Duration? removeDuration, EdgeInsetsGeometry? padding, Axis scrollDirection = Axis.vertical, bool reverse = false, ScrollController? controller, bool? primary, ScrollPhysics? physics, ScrollBehavior? scrollBehavior, String? restorationId, ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual, DragStartBehavior dragStartBehavior = DragStartBehavior.start, Clip clipBehavior = Clip.hardEdge, AnimatedWidgetBuilder<Widget, dynamic> ? insertItemBuilder, AnimatedWidgetBuilder<Widget, dynamic> ? removeItemBuilder, bool shrinkWrap = false, required bool isSameItem(E a, E b), bool enableSwap = true}) -
Creates a AnimatedGridView that animates insertion and removal of the item.
const
Properties
- clipBehavior → Clip
-
Defaults to Clip.hardEdge.
final
- controller → ScrollController?
-
ScrollController to get the current scroll position.
final
- dragStartBehavior → DragStartBehavior
-
Creates a ScrollView that creates custom scroll effects using slivers.
See the ScrollView constructor for more details on these arguments.
final
- enableSwap → bool
-
Whether to enable swap animation when changing the order of the items.
final
-
enterTransition
→ List<
AnimationEffect> ? -
A list of AnimationEffect used for the appearing animation when an item is added to the list.
final
-
exitTransition
→ List<
AnimationEffect> ? -
A list of AnimationEffect used for the disappearing animation when an item was removed from the list.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- insertDuration → Duration?
-
The duration of the animation when an item is inserted into the list.
final
-
insertItemBuilder
→ AnimatedWidgetBuilder<
Widget, dynamic> ? -
A custom builder that is for adding items with animations.
final
- isSameItem → bool Function(E a, E b)
-
A callback function to determine if two items in the list are considered the same.
final
-
itemBuilder
→ ItemBuilder<
Widget, E> -
Called, as needed, to build list item widgets.
final
-
items
→ List<
E> -
The current list of items that thisAnimatedGridView should represent.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- keyboardDismissBehavior → ScrollViewKeyboardDismissBehavior
-
ScrollViewKeyboardDismissBehavior the defines how this ScrollView will
dismiss the keyboard automatically.
final
- padding → EdgeInsetsGeometry?
-
The amount of space by which to inset the list contents.
final
- physics → ScrollPhysics?
-
How the scroll view should respond to user input.
final
- primary → bool?
-
When this is true, the scroll view is scrollable even if it does not have
sufficient content to actually scroll. Otherwise, by default the user can
only scroll the view if it has sufficient content. See physics.
final
- removeDuration → Duration?
-
The duration of the animation when an item is removed from the list.
final
-
removeItemBuilder
→ AnimatedWidgetBuilder<
Widget, dynamic> ? -
A custom builder that is for removing items with animations.
final
- restorationId → String?
-
Creates a ScrollView that creates custom scroll effects using slivers.
See the ScrollView constructor for more details on these arguments.
final
- reverse → bool
-
Whether the scroll view scrolls in the reading direction.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollBehavior → ScrollBehavior?
-
ScrollBehaviors also provide ScrollPhysics. If an explicit
ScrollPhysics is provided in physics, it will take precedence,
followed by scrollBehavior, and then the inherited ancestor
ScrollBehavior.
final
- scrollDirection → Axis
-
The axis along which the scroll view scrolls.
final
- shrinkWrap → bool
-
Whether the extent of the scroll view in the scrollDirection should be determined by the contents being viewed.
final
- sliverGridDelegate → SliverGridDelegate
-
Controls the layout of tiles in a grid.
Given the current constraints on the grid,
a SliverGridDelegate computes the layout for the tiles in the grid.
The tiles can be placed arbitrarily,
but it is more efficient to place tiles in roughly in order by scroll offset because grids reify a contiguous sequence of children.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< AnimatedGridView< E> > -
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, 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
Static Methods
-
maybeOf(
BuildContext context) → AnimatedGridViewState< Object> ? - The state from the closest instance of this class that encloses the given context.
-
of(
BuildContext context) → AnimatedGridViewState< Object> - The state from the closest instance of this class that encloses the given context.