autoLeading static method
The route's own exit: the way back on a pushed page, the close on a sheet, nothing on a root.
Implementation
static Widget? autoLeading(BuildContext context, {Key? key}) {
final register = RoutePresentation.of(context);
if (register == RoutePresentation.root) return null;
return ComicBackButton(
key: key,
close: register == RoutePresentation.sheet,
onPressed: () => Navigator.of(context).maybePop(),
);
}