mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-22 12:59:21 +00:00
32 lines
713 B
Dart
32 lines
713 B
Dart
import 'package:meta/meta.dart';
|
|
|
|
/// Single conversation message
|
|
///
|
|
/// @author Pierre HUBERT
|
|
|
|
class ConversationMessage implements Comparable {
|
|
final int id;
|
|
final int userID;
|
|
final int timeInsert;
|
|
final String message;
|
|
final String imageURL;
|
|
|
|
const ConversationMessage({
|
|
@required this.id,
|
|
@required this.userID,
|
|
@required this.timeInsert,
|
|
@required this.message,
|
|
@required this.imageURL,
|
|
}) : assert(id != null),
|
|
assert(userID != null),
|
|
assert(timeInsert != null),
|
|
assert(message != null);
|
|
|
|
DateTime get date => DateTime.fromMillisecondsSinceEpoch(timeInsert * 1000);
|
|
|
|
@override
|
|
int compareTo(other) {
|
|
return id.compareTo(other.id);
|
|
}
|
|
}
|