NibLayoutGroup class
Animates children to their new positions whenever a rebuild changes their layout, using the FLIP (First, Last, Invert, Play) technique.
Each widget in children must carry a non-null, unique Key, which identifies it across rebuilds so NibLayoutGroup can measure how far it moved:
- First: before the new layout is applied, the current position of every child present in both the old and new children is recorded.
- Last: after the new layout is applied (via WidgetsBinding.addPostFrameCallback), each tracked child's new position is compared against its recorded one.
- Invert: if a child moved, its NibMotion is immediately offset (no animation) so it visually stays at its old position.
- Play: that offset is animated back to zero with transition, so the child appears to travel smoothly from its old position to its new one.
A child whose key is newly added to children mounts without a FLIP animation. A child whose key is removed from children stops being tracked; re-adding it later is treated as a new child.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- NibLayoutGroup
- Available extensions
Constructors
-
NibLayoutGroup({Key? key, required List<
Widget> children, NibTransition? transition}) -
Creates a
NibLayoutGroup.const
Properties
-
children
→ List<
Widget> -
The widgets to lay out and track. Each must carry a non-null, unique
Key.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- transition → NibTransition?
-
The transition used to animate a moved child back to its new position.
final
Methods
-
animate(
{Object? initial, Object? animate, NibAnim? exit, NibTransition? transition, NibAnim? whileTap, NibAnim? whileHover, Key? key}) → Widget -
Available on Widget, provided by the NibMotionWidgetExtension extension
Wraps this widget in a NibMotion. -
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< NibLayoutGroup> -
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
-
revealOnScroll(
{NibAnim? initial, bool once = true}) → Widget -
Available on Widget, provided by the NibMotionWidgetExtension extension
Wraps this widget in a NibScrollReveal. -
shimmer(
{bool enabled = true}) → Widget -
Available on Widget, provided by the NibMotionWidgetExtension extension
Wraps this widget in a NibShimmer. -
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