maybeFindAction<T extends Intent> method

Action<T>? maybeFindAction<T extends Intent>(
  1. T intent
)

Finds the Action bound to the given intent type T in the given context.

Creates a dependency on the Actions widget that maps the bound action so that if the actions change, the context will be rebuilt and find the updated action. The intent argument supplies the type of the intent to look for. If no Actions widget surrounds the given context, this function will return null.

Example:

Action<SomeIntent>? maybeAction = context.maybeFindAction(SomeIntent());

Implementation

Action<T>? maybeFindAction<T extends Intent>(T intent) =>
    Actions.maybeFind(this, intent: intent);