finish function

void finish(
  1. BuildContext context,
  2. [Object? result]
)

for pop from anywhere in app

Implementation

void finish(BuildContext context, [Object? result]) {
  if (Navigator.canPop(context)) Navigator.pop(context, result);
}