HeroWidgetExtension extension

Extension methods for Widget that provide convenient hero animation functionality.

This extension adds a method to easily wrap widgets in Hero widgets for smooth page transition animations. Hero animations create a visual connection between widgets on different screens by animating them during navigation.

Hero widgets with the same tag will be automatically animated between screens when navigating. This creates smooth, visually appealing transitions that help users understand the relationship between elements across different pages.

Example usage:

Image.asset('profile.jpg')
  .hero('profile-image'); // Will animate when navigating between screens
on

Methods

hero(String tag, {Tween<Rect?> createRectTween(Rect?, Rect?)?, Widget flightShuttleBuilder(BuildContext, Animation<double>, HeroFlightDirection, BuildContext, BuildContext)?, Widget placeholderBuilder(BuildContext, Size, Widget)?, bool transitionOnUserGestures = false}) Hero

Available on Widget, provided by the HeroWidgetExtension extension

Wraps the widget in a Hero for page transition animations.