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