closeSubPage function
Implementation
void closeSubPage({BuildContext? context}) {
if (context == null && (!state.isContextLoaded || !state.appContext.mounted)) {
assert(false,
"App Context was not loaded or not mounted");
return;
}
if (context != null && !context.mounted) {
assert(false,
"Provided Context was not loaded or not mounted");
return;
}
context = context?? state.appContext;
Navigator.of(context).pop();
}