1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-30 00:36:28 +00:00
comunicmobile/lib/models/new_conversation_message.dart

30 lines
719 B
Dart
Raw Normal View History

2021-03-12 16:47:09 +00:00
import 'package:comunic/models/api_request.dart';
2019-04-25 07:48:52 +00:00
import 'package:meta/meta.dart';
/// New conversation message model
///
/// This model is used to transfer a conversation message to send in the application
///
/// @author Pierre HUBERT
class NewConversationMessage {
final int conversationID;
final String message;
2021-03-12 16:47:09 +00:00
final BytesFile file;
2021-03-12 18:36:42 +00:00
final BytesFile thumbnail;
2019-04-25 07:48:52 +00:00
2021-03-12 16:47:09 +00:00
NewConversationMessage({
@required this.conversationID,
@required this.message,
this.file,
2021-03-12 18:36:42 +00:00
this.thumbnail,
2021-03-12 16:47:09 +00:00
}) : assert(conversationID != null),
assert(file != null || message != null);
2019-04-25 18:14:19 +00:00
bool get hasMessage => message != null;
2021-02-07 16:09:08 +00:00
2021-03-12 16:47:09 +00:00
bool get hasFile => file != null;
2021-03-12 18:36:42 +00:00
bool get hasThumbnail => thumbnail != null;
2019-04-25 07:48:52 +00:00
}