Offline Support
This commit is contained in:
@@ -1,47 +1 @@
|
||||
import '../utils/app_time.dart';
|
||||
|
||||
class AnnouncementComment {
|
||||
AnnouncementComment({
|
||||
required this.id,
|
||||
required this.announcementId,
|
||||
required this.authorId,
|
||||
required this.body,
|
||||
required this.createdAt,
|
||||
});
|
||||
|
||||
final String id;
|
||||
final String announcementId;
|
||||
final String authorId;
|
||||
final String body;
|
||||
final DateTime createdAt;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is AnnouncementComment &&
|
||||
runtimeType == other.runtimeType &&
|
||||
id == other.id &&
|
||||
announcementId == other.announcementId &&
|
||||
authorId == other.authorId &&
|
||||
body == other.body &&
|
||||
createdAt == other.createdAt;
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
id,
|
||||
announcementId,
|
||||
authorId,
|
||||
body,
|
||||
createdAt,
|
||||
);
|
||||
|
||||
factory AnnouncementComment.fromMap(Map<String, dynamic> map) {
|
||||
return AnnouncementComment(
|
||||
id: map['id'] as String,
|
||||
announcementId: map['announcement_id'] as String,
|
||||
authorId: map['author_id'] as String,
|
||||
body: map['body'] as String? ?? '',
|
||||
createdAt: AppTime.parse(map['created_at'] as String),
|
||||
);
|
||||
}
|
||||
}
|
||||
export 'announcement_comment.model.dart';
|
||||
|
||||
Reference in New Issue
Block a user