✨ Preload post quoted content
This commit is contained in:
parent
018441ea0b
commit
717bccbf3f
@ -23,6 +23,11 @@ class SnPostContentProvider {
|
|||||||
if (out[i].body['thumbnail'] != null) {
|
if (out[i].body['thumbnail'] != null) {
|
||||||
rids.add(out[i].body['thumbnail']);
|
rids.add(out[i].body['thumbnail']);
|
||||||
}
|
}
|
||||||
|
if (out[i].repostTo != null) {
|
||||||
|
out[i] = out[i].copyWith(
|
||||||
|
repostTo: await _preloadRelatedDataSingle(out[i].repostTo!),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final attachments = await _attach.getMultiple(rids.toList());
|
final attachments = await _attach.getMultiple(rids.toList());
|
||||||
|
@ -637,16 +637,35 @@ class _PostQuoteContent extends StatelessWidget {
|
|||||||
width: 1,
|
width: 1,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
padding: const EdgeInsets.only(top: 8),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
_PostContentHeader(
|
Column(
|
||||||
data: child,
|
children: [
|
||||||
isCompact: true,
|
_PostContentHeader(
|
||||||
showMenu: false,
|
data: child,
|
||||||
onDeleted: () {},
|
isCompact: true,
|
||||||
).padding(bottom: 4),
|
showMenu: false,
|
||||||
_PostContentBody(data: child),
|
onDeleted: () {},
|
||||||
|
).padding(bottom: 4),
|
||||||
|
_PostContentBody(data: child),
|
||||||
|
if (child.visibility > 0) _PostVisibilityHint(data: child).padding(top: 4),
|
||||||
|
],
|
||||||
|
).padding(horizontal: 16),
|
||||||
|
if (child.preload?.attachments?.isNotEmpty ?? false)
|
||||||
|
ClipRRect(
|
||||||
|
borderRadius: const BorderRadius.only(
|
||||||
|
bottomLeft: Radius.circular(8),
|
||||||
|
bottomRight: Radius.circular(8),
|
||||||
|
),
|
||||||
|
child: AttachmentList(
|
||||||
|
data: child.preload!.attachments!,
|
||||||
|
listPadding: const EdgeInsets.symmetric(horizontal: 12),
|
||||||
|
),
|
||||||
|
).padding(
|
||||||
|
top: 8,
|
||||||
|
bottom: (child.preload?.attachments?.length ?? 0) > 1 ? 12 : 0,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Loading…
Reference in New Issue
Block a user