maybeSelectAndPop method
Selects the given item
and pops the current route.
This method calls the onSelect callback with the selected item
and
then pops the current route using maybePop()
from the context
.
Returns the selected item
.
Implementation
@protected
@optionalTypeArgs
T maybeSelectAndPop(T item, BuildContext context) {
onSelect?.call(item);
unawaited(context.maybePop());
return item;
}