2021-02-07 16:09:08 +00:00
|
|
|
import 'package:image_picker/image_picker.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-02-07 16:09:08 +00:00
|
|
|
final PickedFile image;
|
2019-04-25 07:48:52 +00:00
|
|
|
|
2021-02-07 16:09:08 +00:00
|
|
|
NewConversationMessage(
|
|
|
|
{@required this.conversationID, @required this.message, this.image})
|
|
|
|
: assert(conversationID != null),
|
2019-04-25 18:14:19 +00:00
|
|
|
assert(image != null || message != null);
|
|
|
|
|
|
|
|
bool get hasMessage => message != null;
|
2021-02-07 16:09:08 +00:00
|
|
|
|
2019-04-25 18:14:19 +00:00
|
|
|
bool get hasImage => image != null;
|
2019-04-25 07:48:52 +00:00
|
|
|
}
|