decodeLocalizedValues static method

Map<String, String>? decodeLocalizedValues(
  1. DartObject obj
)

Reads a defaultTranslations locale map, or null when obj is not a localized string.

Dispatch is on the presence of the field rather than on the type name: a redirecting const factory is not guaranteed to report the target class, and a silent miss here would drop every translation.

Implementation

static Map<String, String>? decodeLocalizedValues(DartObject obj) =>
    decodeStringMap(getField(obj, 'defaultTranslations'));