popDuration method

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

Implementation

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