toJson method

Map<String, dynamic> toJson()

Converts a Sequence instance to a JSON object.

Implementation

Map<String, dynamic> toJson() {
  return {
    'sequence': sequence,
    'style': style != null
        ? {
            'font_family': style!.fontFamily,
            'font_size': style!.fontSize,
            'font_weight': style!.fontWeight?.index,
            'font_style': style!.fontStyle?.index,
            'color': style!.color?.value,
            'background_color': style!.backgroundColor?.value,
            'decoration': _textDecorationToString(style!.decoration),
            'decoration_color': style!.decorationColor?.value,
            'decoration_style': style!.decorationStyle?.index,
            'letter_spacing': style!.letterSpacing,
            'word_spacing': style!.wordSpacing,
            'height': style!.height,
            'locale': style!.locale.toString(),
          }
        : null,
  };
}