canHandleBack method
Whether back would close a drawer, pop shell, or pop Navigator.
Implementation
bool canHandleBack(BuildContext context) {
if (isDrawerOpen || isEndDrawerOpen) return true;
if (canPopShell) return true;
return Navigator.of(context).canPop();
}