maybeRecipeOf<T extends Equatable> function
Returns the recipe of type T
from the context, or null if no recipe
was found.
Implementation
T? maybeRecipeOf<T extends Equatable>({
required BuildContext context,
required bool listen,
}) {
try {
return Provider.of<T>(context, listen: listen);
} on ProviderNotFoundException {
return null;
}
}