fromJson static method

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

Implementation

static MarkupElement fromJson(Map<String, dynamic> json) {
  final type = json['type'] as String;
  return switch (type) {
    'user_mention' => UserMentionMarkup.fromJson(json),
    _ => throw ArgumentError('Unknown markup type: $type'),
  };
}