of static method

DoughRecipeData of(
  1. BuildContext context, [
  2. bool listen = true
])

Gets the inherited DoughRecipeData. If no recipe is found, a default one will be returned instead.

Implementation

static DoughRecipeData of(
  BuildContext context, [
  bool listen = true,
]) {
  try {
    return Provider.of<DoughRecipeData>(context, listen: listen);
  } on ProviderNotFoundException catch (_) {
    return _kFallbackRecipe;
  }
}