of<T> method

T of<T>(
  1. BuildContext context,
  2. T orDefault(
    1. Locale locale
    )
)

Get current location

Implementation

static T of<T>(BuildContext context, T Function(Locale locale) orDefault) {
  var localization = Localizations.of<T>(context, T);
  return localization ?? orDefault(Localizations.localeOf(context));
}