Neda/Front/lib/models/group_member.dart
2026-03-08 09:53:45 +03:30

25 lines
606 B
Dart

class GroupMember {
final String userId;
final String username;
final String role; // 'MANAGER' | 'MEMBER'
final bool isOnline;
const GroupMember({
required this.userId,
required this.username,
this.role = 'MEMBER',
this.isOnline = false,
});
factory GroupMember.fromJson(Map<String, dynamic> json) {
return GroupMember(
userId: json['user_id'].toString(),
username: json['username'] as String,
role: (json['role'] as String?) ?? 'MEMBER',
isOnline: (json['is_online'] as bool?) ?? false,
);
}
bool get isManager => role == 'MANAGER';
}