simple-chat-client/lib/chat/model/chat_history.dart
Linloir 01568cfe9b
Bug Fix & Feature
- Fix the breakdown when sending huge files
- Add md5 processing indicator when sending file
2022-10-18 17:19:50 +08:00

40 lines
933 B
Dart

/*
* @Author : Linloir
* @Date : 2022-10-14 14:55:20
* @LastEditTime : 2022-10-18 15:19:46
* @Description :
*/
import 'package:equatable/equatable.dart';
import 'package:tcp_client/repositories/common_models/message.dart';
enum ChatHistoryType { outcome, income }
enum ChatHistoryStatus { none, processing, 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];
}