extendedAnimation static method

Animation<double> extendedAnimation(
  1. BuildContext context
)

Returns the animation that controls the NavigationRail.extended state.

This can be used to synchronize animations in the leading or trailing widget, such as an animated menu or a FloatingActionButton animation.

This example shows how to use this animation to create a FloatingActionButton that animates itself between the normal and extended states of the NavigationRail.

An instance of MyNavigationRailFab is created for NavigationRail.leading. Pressing the FAB button toggles the "extended" state of the NavigationRail.

link

To create a local project with this code sample, run:
flutter create --sample=material.NavigationRail.extendedAnimation.1 mysample

Implementation

static Animation<double> extendedAnimation(BuildContext context) {
  return context.dependOnInheritedWidgetOfExactType<_ExtendedNavigationRailAnimation>()!.animation;
}