of static method

Returns the ToastificationThemeData from the closest ToastificationTheme ancestor.

If there is no ancestor, it will assert in debug mode.

Implementation

static ToastificationThemeData of(BuildContext context) {
  final ToastificationTheme? result =
      context.dependOnInheritedWidgetOfExactType<ToastificationTheme>();
  assert(result != null, 'No ToastificationTheme Widget found in context');
  return result!.themeData;
}