currentLocale top-level property

Future<String?> get currentLocale

Returns the current locale in two letter format using deviceLocale package.

Implementation

Future<String?> get currentLocale async {
  final locale = await Devicelocale.currentLocale;
  if (locale == null) return null;
  return locale.split('-').first;
}