toJson method

Map<String, dynamic> toJson()

Returns a Map representing this ChatItem.

Implementation

Map<String, dynamic> toJson() => switch (runtimeType) {
  const (ChatMessage) => (this as ChatMessage).toJson(),
  const (ChatCall) => (this as ChatCall).toJson(),
  const (ChatInfo) => (this as ChatInfo).toJson(),
  const (ChatForward) => (this as ChatForward).toJson(),
  _ => throw UnimplementedError(runtimeType.toString()),
};