onButtonPressed property
Allows you to intercept any button press. The function passes the ButtonType enum, which tells you which button was pressed, the current selected status of the button, and a function to reverse the status (in case you decide to handle the button press yourself).
Note: In some cases, the button is never active (e.g. copy/paste buttons) so null will be returned for both the selected status and the function.
Return a bool to tell the plugin if it should continue with its own handler or if you want to handle the button press by yourself. (true = continue with internal handler, false = do not use internal handler)
If no interceptor is set, the plugin uses the internal handler.
Implementation
final FutureOr<bool> Function(ButtonType, bool?, Function?)? onButtonPressed;