StructuredFormatting.fromJson constructor

StructuredFormatting.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory StructuredFormatting.fromJson(Map<String, dynamic> json) {
  return StructuredFormatting(
    mainText: json['main_text'] as String?,
    mainTextMatchedSubstrings: json['main_text_matched_substrings']
        .map<MainTextMatchedSubstring>(
            (json) => MainTextMatchedSubstring.fromJson(json))
        .toList(),
    secondaryText: json['secondary_text'] as String?,
  );
}