2021-03-12 16:47:09 +00:00
|
|
|
import 'package:comunic/models/api_request.dart';
|
2019-04-25 07:48:52 +00:00
|
|
|
|
|
|
|
/// 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;
|
2022-03-10 18:39:57 +00:00
|
|
|
final String? message;
|
|
|
|
final BytesFile? file;
|
|
|
|
final BytesFile? thumbnail;
|
2019-04-25 07:48:52 +00:00
|
|
|
|
2021-03-12 16:47:09 +00:00
|
|
|
NewConversationMessage({
|
2022-03-10 18:39:57 +00:00
|
|
|
required this.conversationID,
|
|
|
|
required this.message,
|
2021-03-12 16:47:09 +00:00
|
|
|
this.file,
|
2021-03-12 18:36:42 +00:00
|
|
|
this.thumbnail,
|
2022-03-11 16:16:46 +00:00
|
|
|
}) : 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
|
|
|
}
|