BuildContextExtension extension

Extension for BuildContext used to simplify some operations with Intent or Notification.

on

Methods

dispatch(Notification notification) → void
Start bubbling this notification at the given build context.
findAction<T extends Intent>(T intent) Action<T>
Finds the Action bound to the given intent type T in the given context.
handler<T extends Intent>(T intent) VoidCallback?
Returns a VoidCallback handler that invokes the bound action for the given Intent If the action is enabled, and returns null if the action is not enabled, or no matching action is found.
invoke<T extends Intent>(T intent) Object?
Invokes the action associated with the given Intent using the Actions widget that most tightly encloses the given BuildContext.
maybeFindAction<T extends Intent>(T intent) Action<T>?
Finds the Action bound to the given intent type T in the given context.
maybeInvoke<T extends Intent>(T intent) Object?
Invokes the action associated with the given Intent using the Actions widget that most tightly encloses the given BuildContext.