Unverified Commit 7055becf authored by Mateus Felipe C. C. Pinto's avatar Mateus Felipe C. C. Pinto Committed by GitHub

Remove unused parameter and consequently unused variable (#98428)

parent cef68236
...@@ -851,17 +851,16 @@ class HeroController extends NavigatorObserver { ...@@ -851,17 +851,16 @@ class HeroController extends NavigatorObserver {
if (toRoute != fromRoute && toRoute is PageRoute<dynamic> && fromRoute is PageRoute<dynamic>) { if (toRoute != fromRoute && toRoute is PageRoute<dynamic> && fromRoute is PageRoute<dynamic>) {
final PageRoute<dynamic> from = fromRoute; final PageRoute<dynamic> from = fromRoute;
final PageRoute<dynamic> to = toRoute; final PageRoute<dynamic> to = toRoute;
final Animation<double> animation = (flightType == HeroFlightDirection.push) ? to.animation! : from.animation!;
// A user gesture may have already completed the pop, or we might be the initial route // A user gesture may have already completed the pop, or we might be the initial route
switch (flightType) { switch (flightType) {
case HeroFlightDirection.pop: case HeroFlightDirection.pop:
if (animation.value == 0.0) { if (from.animation!.value == 0.0) {
return; return;
} }
break; break;
case HeroFlightDirection.push: case HeroFlightDirection.push:
if (animation.value == 1.0) { if (to.animation!.value == 1.0) {
return; return;
} }
break; break;
...@@ -871,7 +870,7 @@ class HeroController extends NavigatorObserver { ...@@ -871,7 +870,7 @@ class HeroController extends NavigatorObserver {
// maintainState = true, then the hero's final dimensions can be measured // maintainState = true, then the hero's final dimensions can be measured
// immediately because their page's layout is still valid. // immediately because their page's layout is still valid.
if (isUserGestureTransition && flightType == HeroFlightDirection.pop && to.maintainState) { if (isUserGestureTransition && flightType == HeroFlightDirection.pop && to.maintainState) {
_startHeroTransition(from, to, animation, flightType, isUserGestureTransition); _startHeroTransition(from, to, flightType, isUserGestureTransition);
} else { } else {
// Otherwise, delay measuring until the end of the next frame to allow // Otherwise, delay measuring until the end of the next frame to allow
// the 'to' route to build and layout. // the 'to' route to build and layout.
...@@ -882,7 +881,7 @@ class HeroController extends NavigatorObserver { ...@@ -882,7 +881,7 @@ class HeroController extends NavigatorObserver {
to.offstage = to.animation!.value == 0.0; to.offstage = to.animation!.value == 0.0;
WidgetsBinding.instance.addPostFrameCallback((Duration value) { WidgetsBinding.instance.addPostFrameCallback((Duration value) {
_startHeroTransition(from, to, animation, flightType, isUserGestureTransition); _startHeroTransition(from, to, flightType, isUserGestureTransition);
}); });
} }
} }
...@@ -893,7 +892,6 @@ class HeroController extends NavigatorObserver { ...@@ -893,7 +892,6 @@ class HeroController extends NavigatorObserver {
void _startHeroTransition( void _startHeroTransition(
PageRoute<dynamic> from, PageRoute<dynamic> from,
PageRoute<dynamic> to, PageRoute<dynamic> to,
Animation<double> animation,
HeroFlightDirection flightType, HeroFlightDirection flightType,
bool isUserGestureTransition, bool isUserGestureTransition,
) { ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment