handleBackButton method

Future<bool> handleBackButton()

Returns true if the back press was handled, false if the app should close.

Implementation

Future<bool> handleBackButton() async {
  final currentUri = _router.routeInformationProvider.value.uri;

  if (_hasModalParameter(currentUri)) {
    await _closeModal(currentUri);
    return true;
  }

  final currentPath = currentUri.path;
  final navigationResult = await _handlePathNavigation(currentPath);
  return navigationResult;
}