✨ Support new feed API
✨ Able to add tag onto post
This commit is contained in:
23
lib/models/feed.dart
Normal file
23
lib/models/feed.dart
Normal file
@ -0,0 +1,23 @@
|
||||
class FeedRecord {
|
||||
String type;
|
||||
Map<String, dynamic> data;
|
||||
DateTime createdAt;
|
||||
|
||||
FeedRecord({
|
||||
required this.type,
|
||||
required this.data,
|
||||
required this.createdAt,
|
||||
});
|
||||
|
||||
factory FeedRecord.fromJson(Map<String, dynamic> json) => FeedRecord(
|
||||
type: json['type'],
|
||||
data: json['data'],
|
||||
createdAt: DateTime.parse(json['created_at']),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'type': type,
|
||||
'data': data,
|
||||
'created_at': createdAt.toIso8601String(),
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user