HeroContainerController class

Controller that manages the snapshot-based transition animation for HeroContainer widget.

This controller captures widget snapshots and manages the transition state between the closed and opened widgets. It handles the creation of

HeroContainerFragments which contain the captured images and positional information needed for smooth animations.

Constructors

HeroContainerController({required GlobalKey<State<StatefulWidget>> fromKey, required GlobalKey<State<StatefulWidget>> toKey, required WidgetBuilder builder})

Properties

builder WidgetBuilder
Builder for the opened state widget.
final
fromFragment HeroContainerFragment
Fragment containing the closed state snapshot and position.
getter/setter pair
fromKey GlobalKey<State<StatefulWidget>>
Global key for the closed state widget.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
status HeroContainerStatus
Current status of the hero container transition.
getter/setter pair
statusNotifier ValueNotifier<HeroContainerStatus>
Notifier for the current transition status.
final
toFragment HeroContainerFragment?
Fragment containing the opened state snapshot and position. Null until the opened widget is rendered and captured.
getter/setter pair
toKey GlobalKey<State<StatefulWidget>>
Global key for the opened state widget.
final

Methods

captureWidget(BuildContext context, GlobalKey<State<StatefulWidget>> key) Future<Image?>
Captures a widget as an image using its global key.
fragmentOf(BuildContext context, GlobalKey<State<StatefulWidget>> key) Future<HeroContainerFragment>
Creates a HeroContainerFragment from a widget key.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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