Solian/lib/models/account_status.dart

57 lines
1.2 KiB
Dart
Raw Normal View History

import 'package:freezed_annotation/freezed_annotation.dart';
part 'account_status.g.dart';
@JsonSerializable()
2024-06-26 16:31:03 +00:00
class AccountStatus {
bool isDisturbable;
bool isOnline;
DateTime? lastSeenAt;
2024-06-26 17:33:03 +00:00
Status? status;
2024-06-26 16:31:03 +00:00
AccountStatus({
required this.isDisturbable,
required this.isOnline,
required this.lastSeenAt,
required this.status,
});
factory AccountStatus.fromJson(Map<String, dynamic> json) =>
_$AccountStatusFromJson(json);
2024-06-26 16:31:03 +00:00
Map<String, dynamic> toJson() => _$AccountStatusToJson(this);
2024-06-26 17:33:03 +00:00
}
@JsonSerializable()
2024-06-26 17:33:03 +00:00
class Status {
int id;
DateTime createdAt;
DateTime updatedAt;
DateTime? deletedAt;
String type;
String label;
int attitude;
bool isNoDisturb;
bool isInvisible;
DateTime? clearAt;
int accountId;
Status({
required this.id,
required this.createdAt,
required this.updatedAt,
required this.deletedAt,
required this.type,
required this.label,
required this.attitude,
required this.isNoDisturb,
required this.isInvisible,
required this.clearAt,
required this.accountId,
});
factory Status.fromJson(Map<String, dynamic> json) => _$StatusFromJson(json);
2024-06-26 17:33:03 +00:00
Map<String, dynamic> toJson() => _$StatusToJson(this);
2024-06-26 16:31:03 +00:00
}