RichText.url constructor

const RichText.url({
  1. @JsonKey.new(name: 'type') @Default.new(RichTextType.url) RichTextType type,
  2. @JsonKey.new(name: 'text') @RichTextConverter() required RichText text,
  3. @JsonKey.new(name: 'url') required String url,
})

A text with a link.

Implementation

const factory RichText.url({
  /// Type of the rich text, always "url"
  @JsonKey(name: 'type') @Default(RichTextType.url) RichTextType type,

  /// The text
  @JsonKey(name: 'text') @RichTextConverter() required RichText text,

  /// URL of the link
  @JsonKey(name: 'url') required String url,
}) = RichTextUrl;