From 7055becf391723ad2f90607f5db70019f0927760 Mon Sep 17 00:00:00 2001 From: "Mateus Felipe C. C. Pinto" Date: Wed, 16 Feb 2022 19:42:29 -0300 Subject: [PATCH] Remove unused parameter and consequently unused variable (#98428) --- packages/flutter/lib/src/widgets/heroes.dart | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/flutter/lib/src/widgets/heroes.dart b/packages/flutter/lib/src/widgets/heroes.dart index 3f7562fa6bfd..b01e23f11049 100644 --- a/packages/flutter/lib/src/widgets/heroes.dart +++ b/packages/flutter/lib/src/widgets/heroes.dart @@ -851,17 +851,16 @@ class HeroController extends NavigatorObserver { if (toRoute != fromRoute && toRoute is PageRoute && fromRoute is PageRoute) { final PageRoute from = fromRoute; final PageRoute to = toRoute; - final Animation animation = (flightType == HeroFlightDirection.push) ? to.animation! : from.animation!; // A user gesture may have already completed the pop, or we might be the initial route switch (flightType) { case HeroFlightDirection.pop: - if (animation.value == 0.0) { + if (from.animation!.value == 0.0) { return; } break; case HeroFlightDirection.push: - if (animation.value == 1.0) { + if (to.animation!.value == 1.0) { return; } break; @@ -871,7 +870,7 @@ class HeroController extends NavigatorObserver { // maintainState = true, then the hero's final dimensions can be measured // immediately because their page's layout is still valid. if (isUserGestureTransition && flightType == HeroFlightDirection.pop && to.maintainState) { - _startHeroTransition(from, to, animation, flightType, isUserGestureTransition); + _startHeroTransition(from, to, flightType, isUserGestureTransition); } else { // Otherwise, delay measuring until the end of the next frame to allow // the 'to' route to build and layout. @@ -882,7 +881,7 @@ class HeroController extends NavigatorObserver { to.offstage = to.animation!.value == 0.0; WidgetsBinding.instance.addPostFrameCallback((Duration value) { - _startHeroTransition(from, to, animation, flightType, isUserGestureTransition); + _startHeroTransition(from, to, flightType, isUserGestureTransition); }); } } @@ -893,7 +892,6 @@ class HeroController extends NavigatorObserver { void _startHeroTransition( PageRoute from, PageRoute to, - Animation animation, HeroFlightDirection flightType, bool isUserGestureTransition, ) {