Solian/lib/models/account_status.dart

28 lines
707 B
Dart
Raw Normal View History

2024-06-26 16:31:03 +00:00
class AccountStatus {
bool isDisturbable;
bool isOnline;
DateTime? lastSeenAt;
dynamic status;
AccountStatus({
required this.isDisturbable,
required this.isOnline,
required this.lastSeenAt,
required this.status,
});
factory AccountStatus.fromJson(Map<String, dynamic> json) => AccountStatus(
isDisturbable: json['is_disturbable'],
isOnline: json['is_online'],
lastSeenAt: json['last_seen_at'] != null ? DateTime.parse(json['last_seen_at']) : null,
status: json['status'],
);
Map<String, dynamic> toJson() => {
'is_disturbable': isDisturbable,
'is_online': isOnline,
'last_seen_at': lastSeenAt?.toIso8601String(),
'status': status,
};
}