mirror of
https://github.com/Linloir/Simple-TCP-Client.git
synced 2025-12-17 16:58:11 +08:00
40 lines
921 B
Dart
40 lines
921 B
Dart
/*
|
|
* @Author : Linloir
|
|
* @Date : 2022-10-14 14:55:20
|
|
* @LastEditTime : 2022-10-14 15:26:25
|
|
* @Description :
|
|
*/
|
|
|
|
import 'package:equatable/equatable.dart';
|
|
import 'package:tcp_client/repositories/common_models/message.dart';
|
|
|
|
enum ChatHistoryType { outcome, income }
|
|
enum ChatHistoryStatus { none, sending, downloading, done, failed }
|
|
|
|
class ChatHistory extends Equatable {
|
|
final Message message;
|
|
final ChatHistoryType type;
|
|
final ChatHistoryStatus status;
|
|
|
|
const ChatHistory({
|
|
required this.message,
|
|
required this.type,
|
|
required this.status
|
|
});
|
|
|
|
ChatHistory copyWith({
|
|
Message? message,
|
|
ChatHistoryType? type,
|
|
ChatHistoryStatus? status
|
|
}) {
|
|
return ChatHistory(
|
|
message: message ?? this.message,
|
|
type: type ?? this.type,
|
|
status: status ?? this.status
|
|
);
|
|
}
|
|
|
|
@override
|
|
List<Object> get props => [message.contentmd5, type, status];
|
|
}
|