Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
Remove unused parameter and consequently unused variable (#98428)
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusfccp committed Feb 16, 2022
1 parent cef6823 commit 7055bec
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/flutter/lib/src/widgets/heroes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -851,17 +851,16 @@ class HeroController extends NavigatorObserver {
if (toRoute != fromRoute && toRoute is PageRoute<dynamic> && fromRoute is PageRoute<dynamic>) {
final PageRoute<dynamic> from = fromRoute;
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
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;
Expand All @@ -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.
Expand All @@ -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);
});
}
}
Expand All @@ -893,7 +892,6 @@ class HeroController extends NavigatorObserver {
void _startHeroTransition(
PageRoute<dynamic> from,
PageRoute<dynamic> to,
Animation<double> animation,
HeroFlightDirection flightType,
bool isUserGestureTransition,
) {
Expand Down

0 comments on commit 7055bec

Please sign in to comment.