RichText.fromJson constructor

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

Implementation

factory RichText.fromJson(Map<String, dynamic> json) {
  switch (json["@type"]) {
    case RichTextPlain.CONSTRUCTOR:
      return RichTextPlain.fromJson(json);
    case RichTextBold.CONSTRUCTOR:
      return RichTextBold.fromJson(json);
    case RichTextItalic.CONSTRUCTOR:
      return RichTextItalic.fromJson(json);
    case RichTextUnderline.CONSTRUCTOR:
      return RichTextUnderline.fromJson(json);
    case RichTextStrikethrough.CONSTRUCTOR:
      return RichTextStrikethrough.fromJson(json);
    case RichTextFixed.CONSTRUCTOR:
      return RichTextFixed.fromJson(json);
    case RichTextUrl.CONSTRUCTOR:
      return RichTextUrl.fromJson(json);
    case RichTextEmailAddress.CONSTRUCTOR:
      return RichTextEmailAddress.fromJson(json);
    case RichTextSubscript.CONSTRUCTOR:
      return RichTextSubscript.fromJson(json);
    case RichTextSuperscript.CONSTRUCTOR:
      return RichTextSuperscript.fromJson(json);
    case RichTextMarked.CONSTRUCTOR:
      return RichTextMarked.fromJson(json);
    case RichTextPhoneNumber.CONSTRUCTOR:
      return RichTextPhoneNumber.fromJson(json);
    case RichTextIcon.CONSTRUCTOR:
      return RichTextIcon.fromJson(json);
    case RichTextReference.CONSTRUCTOR:
      return RichTextReference.fromJson(json);
    case RichTextAnchor.CONSTRUCTOR:
      return RichTextAnchor.fromJson(json);
    case RichTextAnchorLink.CONSTRUCTOR:
      return RichTextAnchorLink.fromJson(json);
    case RichTexts.CONSTRUCTOR:
      return RichTexts.fromJson(json);
    default:
      return const RichText();
  }
}