maybePop static method

void maybePop(
  1. BuildContext context, {
  2. bool navigatorPop = true,
})

Implementation

static void maybePop(BuildContext context, {bool navigatorPop: true}) async{
  bool popSuccess = await Navigator.of(context).maybePop();
  if (!popSuccess && navigatorPop == true) {
    SystemNavigator.pop();
  }
}