Remove unused parameter and consequently unused variable (#98428)

This commit is contained in:
Mateus Felipe C. C. Pinto 2022-02-16 19:42:29 -03:00 committed by GitHub
parent cef6823637
commit 7055becf39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {
// 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 {
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 {
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,
) { ) {