⚡ Optimize post attachment loading
This commit is contained in:
@ -1,10 +1,19 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:solian/models/account.dart';
|
||||
import 'package:solian/models/attachment.dart';
|
||||
import 'package:solian/models/post_categories.dart';
|
||||
import 'package:solian/models/realm.dart';
|
||||
|
||||
part 'post.g.dart';
|
||||
|
||||
class PostPreload {
|
||||
List<Attachment> attachments;
|
||||
|
||||
PostPreload({
|
||||
required this.attachments,
|
||||
});
|
||||
}
|
||||
|
||||
@JsonSerializable()
|
||||
class Post {
|
||||
int id;
|
||||
@ -33,6 +42,9 @@ class Post {
|
||||
Account author;
|
||||
PostMetric? metric;
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
PostPreload? preload;
|
||||
|
||||
Post({
|
||||
required this.id,
|
||||
required this.createdAt,
|
||||
|
Reference in New Issue
Block a user