of static method

S? of(
  1. BuildContext context
)

Implementation

static S? of(BuildContext context) {
  final instance = S.maybeOf(context);
  assert(instance != null,
      'No instance of S present in the widget tree. Did you add S.delegate in localizationsDelegates?');
  return instance;
}