onPressed property

dynamic Function()? onPressed
getter/setter pair

Callback function when the leading back icon is pressed. Overrides the default pop navigation.

If this is provided, it will be called when the back button is tapped. If it's null, the default behavior is to call Navigator.pop(context).

Implementation

Function()? onPressed;