⬆️ Support new attachments system
This commit is contained in:
@ -20,7 +20,7 @@ class _PostEditorThumbnailDialogState extends State<PostEditorThumbnailDialog> {
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
builder: (context) => AttachmentEditorPopup(
|
||||
usage: 'i.attachment',
|
||||
pool: 'interactive',
|
||||
singleMode: true,
|
||||
imageOnly: true,
|
||||
autoUpload: true,
|
||||
@ -84,8 +84,7 @@ class _PostEditorThumbnailDialogState extends State<PostEditorThumbnailDialog> {
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
widget.controller.thumbnail.value =
|
||||
int.tryParse(_attachmentController.text);
|
||||
widget.controller.thumbnail.value = _attachmentController.text;
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Text('confirm'.tr),
|
||||
|
@ -87,7 +87,7 @@ class _PostItemState extends State<PostItem> {
|
||||
child: AspectRatio(
|
||||
aspectRatio: 16 / 9,
|
||||
child: AttachmentSelfContainedEntry(
|
||||
id: widget.item.body['thumbnail'],
|
||||
rid: widget.item.body['thumbnail'],
|
||||
parentId: 'p${item.id}-thumbnail',
|
||||
),
|
||||
),
|
||||
@ -292,8 +292,8 @@ class _PostItemState extends State<PostItem> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final List<int> attachments = item.body['attachments'] is List
|
||||
? item.body['attachments']?.cast<int>()
|
||||
final List<String> attachments = item.body['attachments'] is List
|
||||
? item.body['attachments']?.cast<String>()
|
||||
: List.empty();
|
||||
final hasAttachment = attachments.isNotEmpty;
|
||||
|
||||
|
Reference in New Issue
Block a user