popDisposition property

  1. @override
RoutePopDisposition popDisposition
override

Returns RoutePopDisposition.doNotPop if any of the PopEntry instances registered with registerPopEntry have PopEntry.canPopNotifier set to false.

Typically this method is not overridden because applications usually don't create modal routes directly, they use higher level primitives like showDialog. The scoped PopEntry list makes it possible for ModalRoute descendants to collectively define the value of popDisposition.

See also:

Implementation

@override
RoutePopDisposition get popDisposition {
  for (final PopEntry<Object?> popEntry in _popEntries) {
    if (!popEntry.canPopNotifier.value) {
      return RoutePopDisposition.doNotPop;
    }
  }

  return super.popDisposition;
}