maybePopDuration method

dynamic maybePopDuration(
  1. BuildContext context, {
  2. dynamic value,
  3. Duration duration = const Duration(milliseconds: 300),
})

Implementation

maybePopDuration(BuildContext context,
    {dynamic value, Duration duration = const Duration(milliseconds: 300)}) {
  try {
    Navigator.of(context).maybePop(
      PageRouteBuilder(
        pageBuilder: (_, __, ___) => Container(),
        transitionDuration: duration,
        transitionsBuilder: (_, animation, __, child) =>
            FadeTransition(opacity: animation, child: child),
      ),
    );
  } catch (e) {}
}