matchesLocale static method
Check if the current locale matches a specific language (and optionally country).
Implementation
static bool matchesLocale(
BuildContext? context,
String languageCode, [
String? countryCode,
]) {
final currentLocale = getCurrentLocale(context: context);
if (countryCode != null) {
return currentLocale.languageCode == languageCode &&
currentLocale.countryCode == countryCode;
}
return currentLocale.languageCode == languageCode;
}