fromJson static method

LocalizedString? fromJson(
  1. dynamic json
)

Parses a LocalizedString from its RWPM JSON representation. If the localized string can't be parsed, a warning will be logged with warnings.

"anyOf": [ { "type": "string" }, { "description": "The language in a language map must be a valid BCP 47 tag.", "type": "object", "patternProperties": { "^((?

Implementation

static LocalizedString? fromJson(dynamic json) {
  if (json == null) {
    return null;
  }
  if (json is String) {
    return LocalizedString.fromString(json);
  }
  if (json is Map<String, dynamic>) {
    return LocalizedString._fromJSONObject(json);
  }
  Fimber.i("invalid localized string object");
  return null;
}