Support new feed API

 Able to add tag onto post
This commit is contained in:
2024-07-07 11:46:48 +08:00
parent f8bed6946e
commit 22ee817676
10 changed files with 271 additions and 30 deletions

23
lib/models/feed.dart Normal file
View 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(),
};
}