RichText.dateTime constructor

const RichText.dateTime({
  1. @JsonKey.new(name: 'type') @Default.new(RichTextType.dateTime) RichTextType type,
  2. @JsonKey.new(name: 'text') @RichTextConverter() required RichText text,
  3. @JsonKey.new(name: 'unix_time') required int unixTime,
  4. @JsonKey.new(name: 'date_time_format') required String dateTimeFormat,
})

Formatted date and time.

Implementation

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

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

  /// The Unix time associated with the entity
  @JsonKey(name: 'unix_time') required int unixTime,

  /// The string that defines the formatting of the date and time.
  @JsonKey(name: 'date_time_format') required String dateTimeFormat,
}) = RichTextDateTime;