toJson method
Implementation
Map<String, dynamic> toJson() => switch (T) {
Message => (data as Message).toJson(),
Channel => (data as Channel).toJson(),
MessageInfo => (data as MessageInfo).toJson(),
Type() => throw contigo_chatException(
code: 422,
message: '$runtimeType reported unknown type $T',
),
};