StructuredFormatting.fromJson constructor
Creates a StructuredFormatting from JSON data.
Implementation
factory StructuredFormatting.fromJson(Map<String, dynamic> json) =>
StructuredFormatting(
mainText: json["main_text"],
mainTextMatchedSubstrings: json["main_text_matched_substrings"] != null
? List<MatchedSubstring>.from(json["main_text_matched_substrings"]
.map((x) => MatchedSubstring.fromJson(x)))
: null,
secondaryText: json["secondary_text"],
secondaryTextMatchedSubstrings:
json["secondary_text_matched_substrings"] == null
? null
: List<MatchedSubstring>.from(
json["secondary_text_matched_substrings"]
.map((x) => MatchedSubstring.fromJson(x))),
);