locale property

  1. @override
Locale? get locale
override

The current locale language translation

Implementation

@override
Locale? get locale {
  injected.initialize();
  TopStatelessWidget.addToObs?.call(
    injected,
    _onTopWidgetObserverAdded,
    didChangeLocales,
  );

  return _locale;
}
  1. @override
set locale (Locale? l)
override

The current locale language translation

Implementation

@override
set locale(Locale? l) {
  if (l == null) {
    return;
  }
  if (l is SystemLocale && _locale is SystemLocale) {
    if (l.runtimeType == SystemLocale || _locale == l) {
      return;
    }
  } else if (l is! SystemLocale && _locale is! SystemLocale) {
    if (_locale == l) {
      return;
    }
  }

  final lan = _getLanguage(l);

  injected.setState((s) => lan);
}