preferredLocale property

Locale? get preferredLocale

Return the saved Locale if any.

Implementation

Locale? get preferredLocale {
  final codes = Prefs.getString('locale').split('-');
  Locale? locale;
  if (codes.length == 2) {
    locale = Locale(codes[0], codes[1]);
  }
  return locale;
}