Closed rignaneseleo closed 3 years ago
This might be a bit late but you'll want to wrap your page in a WillPopScope
I could explain the details here but the resources already exist on google
Add this to your navigator.dart (packages/flutter/lib/src/widgets/navigator.dart) (in NavigatorState).
Future<void> removeTop() {
assert(!_debugLocked);
assert(() {
_debugLocked = true;
return true;
}());
int index = _history.length - 1;
while (index >= 0) {
if (_history[index].isPresent) {
_history[index].remove();
break;
}
}
_flushHistoryUpdates();
assert(() {
_debugLocked = false;
return true;
}());
}
And then call it: Navigator.of(context).removeTop();
How can I use the animation only to open a page and not when it closes?
Thanks and congrats for the good job.