21 lines
421 B
Dart
21 lines
421 B
Dart
class Channel {
|
|
final String id;
|
|
final String name;
|
|
final int memberCount;
|
|
|
|
const Channel({
|
|
required this.id,
|
|
required this.name,
|
|
this.memberCount = 0,
|
|
});
|
|
|
|
factory Channel.fromJson(Map<String, dynamic> json) {
|
|
return Channel(
|
|
id: json['id'].toString(),
|
|
name: json['name'] as String,
|
|
memberCount:
|
|
(json['member_count'] ?? json['members'] ?? 0) as int,
|
|
);
|
|
}
|
|
}
|