encodeLocale static method
Encodes the given value
to a JSON representation.
{
"countryCode": <String>,
"languageCode": <String>
}
Implementation
static Map<String, dynamic>? encodeLocale(Locale? value) {
Map<String, dynamic>? result;
if (value != null) {
result = <String, dynamic>{
'countryCode': value.countryCode,
'languageCode': value.languageCode,
};
}
return _stripNull(result);
}