canPop property

bool canPop
final

When false, blocks the associated route from being popped.

If this is set to false for first page in the Navigator. It prevents Flutter app from exiting.

If there are any PopScope widgets in a route's widget subtree, each of their canPop must be true, in addition to this canPop, in order for the route to be able to pop.

Implementation

final bool canPop;