maybePop<T extends Object?> method

  1. @override
  2. @optionalTypeArgs
Future<bool> maybePop<T extends Object?>([
  1. T? result
])
override

Clients can either pop their own _pages stack or defer the call to a parent controller

see Navigator.maybePop(context) for more details

Implementation

@override
@optionalTypeArgs
Future<bool> maybePop<T extends Object?>([T? result]) {
  if (homeIndex != -1 && _activeIndex != homeIndex) {
    setActiveIndex(homeIndex);
    return SynchronousFuture<bool>(true);
  } else if (_parent != null) {
    return _parent!.maybePop<T>(result);
  } else {
    return SynchronousFuture<bool>(false);
  }
}