mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-22 21:09:21 +00:00
40 lines
879 B
Dart
40 lines
879 B
Dart
import 'package:meta/meta.dart';
|
|
|
|
/// Comments
|
|
///
|
|
/// Contains information about a single comment
|
|
///
|
|
/// @author Pierre HUBERT
|
|
|
|
class Comment {
|
|
final int id;
|
|
final int userID;
|
|
final int postID;
|
|
final int timeSent;
|
|
final String content;
|
|
final String imageURL;
|
|
final int likes;
|
|
final bool userLike;
|
|
|
|
Comment({
|
|
@required this.id,
|
|
@required this.userID,
|
|
@required this.postID,
|
|
@required this.timeSent,
|
|
@required this.content,
|
|
@required this.imageURL,
|
|
@required this.likes,
|
|
@required this.userLike,
|
|
}) : assert(id != null),
|
|
assert(userID != null),
|
|
assert(postID != null),
|
|
assert(timeSent != null),
|
|
assert(content != null),
|
|
assert(likes != null),
|
|
assert(userLike != null);
|
|
|
|
bool get hasContent => content != null && content.length > 0;
|
|
|
|
bool get hasImage => imageURL != null;
|
|
}
|