dev
dart 38 lines 872 Bytes
Raw
1 class MastodonUser {
2 String id;
3 String username;
4 String profileImageUrl;
5 String acct;
6 String note;
7
8 MastodonUser({
9 required this.id,
10 required this.username,
11 required this.profileImageUrl,
12 required this.acct,
13 required this.note,
14 });
15
16 factory MastodonUser.fromJson(Map<String, dynamic> json) {
17 return MastodonUser(
18 id: json['id'] as String,
19 username: json['username'] as String? ?? '',
20 acct: json['acct'] as String,
21 note: json['note'] as String,
22 profileImageUrl: json['avatar'] as String? ?? '');
23 }
24 }
25
26 class PinnedPost {
27 final String id;
28 final String content;
29
30 PinnedPost({required this.id, required this.content});
31
32 factory PinnedPost.fromJson(Map<String, dynamic> json) {
33 return PinnedPost(
34 id: json['id'] as String,
35 content: json['content'] as String,
36 );
37 }
38 }