beamer
beamer copied to clipboard
popToNamed missing transition
Click on 'beam deep' (it will move from '/' to '/a') Click on 'go to b' (it will pop from /a to /b) --- NO TRANSITION HERE Click on 'go to /' (it will pop from /b to /) --- OK.
Really looking forward to this one :)
It seems that our ReverseTransitionDelegate
could use some improvements.
To remind ourselves: we cannot really pop
from /b
to /a
because they are both page stacks of 2 pages, differing in the top page. ReverseTransitionDelegate
is used by popToNamed
to make it look like a pop.
You can use the base beaming function update
instead of popToNamed
, where you can specify a transitionDelegate
. This way we can play around with it. Clearly, ReverseTransitionDelegate
behaves better in this use case than DefaultTransitionDelegate
, but it's not what you want.
Beamer.of(context).update(
configuration: const RouteInformation(location: '/b'),
beamParameters: const BeamParameters(
transitionDelegate: ReverseTransitionDelegate(),
),
);
P.S. code for transition delegate is not the prettiest in the world :slightly_smiling_face:
I mainly made it by tinkering with NoAnimationTransitionDelegate
from https://api.flutter.dev/flutter/widgets/TransitionDelegate-class.html