BuildContextExtension extension

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

on

Methods

component<C extends ComponentStateMixin<StatefulWidget>>() → C
Provides nearest successor of ComponentStateMixin
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.
listen<C extends Object>() → C
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.
read<C extends Object>() → C