of static method

Toaster of(
  1. BuildContext context
)

refrence the nearest Toaster.

Implementation

static Toaster of(BuildContext context) {
  final result =
      context.dependOnInheritedWidgetOfExactType<ToasterStateFinder>();
  assert(result != null, 'No toaster found in context');

  return result!.toasterState;
}