fromJson static method

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

Implementation

static RichMessage? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return RichMessage(
    blocks: List<PageBlock>.from(
      tdListFromJson(json['blocks'])
          .map((item) => PageBlock.fromJson(tdMapFromJson(item)))
          .whereType<PageBlock>(),
    ),
    isRtl: (json['is_rtl'] as bool?) ?? false,
    isFull: (json['is_full'] as bool?) ?? false,
  );
}