2023-10-05 12:18:35 +00:00
|
|
|
class MastodonUser {
|
|
|
|
String id;
|
|
|
|
String username;
|
2024-03-01 19:38:48 +00:00
|
|
|
String profileImageUrl;
|
2023-10-05 12:18:35 +00:00
|
|
|
String acct;
|
|
|
|
String note;
|
|
|
|
|
|
|
|
MastodonUser({
|
|
|
|
required this.id,
|
|
|
|
required this.username,
|
2024-03-01 19:38:48 +00:00
|
|
|
required this.profileImageUrl,
|
2023-10-05 12:18:35 +00:00
|
|
|
required this.acct,
|
|
|
|
required this.note,
|
|
|
|
});
|
|
|
|
|
|
|
|
factory MastodonUser.fromJson(Map<String, dynamic> json) {
|
|
|
|
return MastodonUser(
|
|
|
|
id: json['id'] as String,
|
2024-03-01 19:38:48 +00:00
|
|
|
username: json['username'] as String? ?? '',
|
2023-10-05 12:18:35 +00:00
|
|
|
acct: json['acct'] as String,
|
|
|
|
note: json['note'] as String,
|
2024-03-01 19:38:48 +00:00
|
|
|
profileImageUrl: json['avatar'] as String? ?? ''
|
2023-10-05 12:18:35 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class PinnedPost {
|
|
|
|
final String id;
|
|
|
|
final String content;
|
|
|
|
|
|
|
|
PinnedPost({required this.id, required this.content});
|
|
|
|
|
|
|
|
factory PinnedPost.fromJson(Map<String, dynamic> json) {
|
|
|
|
return PinnedPost(
|
|
|
|
id: json['id'] as String,
|
|
|
|
content: json['content'] as String,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|