RichBlock.map constructor

const RichBlock.map({
  1. @JsonKey.new(name: 'type') @Default.new(RichBlockType.map) RichBlockType type,
  2. @JsonKey.new(name: 'location') required Location location,
  3. @JsonKey.new(name: 'zoom') required int zoom,
  4. @JsonKey.new(name: 'width') required int width,
  5. @JsonKey.new(name: 'height') required int height,
  6. @JsonKey.new(name: 'caption') RichBlockCaption? caption,
})

A block with a map, corresponding to the custom HTML tag <tg-map>.

Implementation

const factory RichBlock.map({
  /// Type of the block, always "map"
  @JsonKey(name: 'type') @Default(RichBlockType.map) RichBlockType type,

  /// Location of the center of the map
  @JsonKey(name: 'location') required Location location,

  /// Map zoom level; 13-20
  @JsonKey(name: 'zoom') required int zoom,

  /// Expected width of the map
  @JsonKey(name: 'width') required int width,

  /// Expected height of the map
  @JsonKey(name: 'height') required int height,

  /// Optional. Caption of the block
  @JsonKey(name: 'caption') RichBlockCaption? caption,
}) = RichBlockMap;