LocaleQueryData of(BuildContext context)

The data from the closest instance of this class that encloses the given context.

Typical usage is as follows:

MyLocaleData data = LocaleQueryData.of(context);

Source

static LocaleQueryData of(BuildContext context) {
  LocaleQuery query = context.inheritFromWidgetOfExactType(LocaleQuery);
  return query?.data;
}