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