pushAndRemoveUntilDuration method
dynamic
pushAndRemoveUntilDuration(
- BuildContext context,
- Widget page, {
- Duration duration = const Duration(milliseconds: 300),
Implementation
pushAndRemoveUntilDuration(BuildContext context, Widget page,
{Duration duration = const Duration(milliseconds: 300)}) {
try {
Navigator.of(context).pushAndRemoveUntil(
PageRouteBuilder(
pageBuilder: (_, __, ___) => page,
transitionDuration: duration,
transitionsBuilder: (_, animation, __, child) =>
FadeTransition(opacity: animation, child: child),
),
(route) => false,
);
} catch (e) {}
}