decode method

  1. @override
Locale? decode(
  1. Map<String, dynamic>? data

Revert an encoded map of String to json encodable objects to an instance of T. Return null if data is null or conversion fails.


Locale? decode(Map<String, dynamic>? data) {
  if (data == null || data.isEmpty) return null;
  return Locale.fromSubtags(
    languageCode: data['languageCode'] ?? 'und',
    countryCode: data['countryCode'],
    scriptCode: data['scriptCode'],