From 456bac67f2b07bade0f9894798aa479e26d1348b Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sun, 2 Jun 2024 14:45:19 +0800 Subject: [PATCH] :bug: Fix scroll auto scroll back --- lib/widgets/attachments/attachment_item.dart | 7 ++++--- lib/widgets/attachments/attachment_list.dart | 15 +++++---------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/lib/widgets/attachments/attachment_item.dart b/lib/widgets/attachments/attachment_item.dart index 31c8001..dbe4df8 100644 --- a/lib/widgets/attachments/attachment_item.dart +++ b/lib/widgets/attachments/attachment_item.dart @@ -110,9 +110,10 @@ class _AttachmentItemState extends State { child: ActionChip( visualDensity: const VisualDensity(vertical: -4, horizontal: -4), - avatar: Icon(Icons.visibility_off, - color: - Theme.of(context).colorScheme.onSurfaceVariant), + avatar: Icon( + Icons.visibility_off, + color: Theme.of(context).colorScheme.onSurfaceVariant, + ), label: Text('hide'.tr), onPressed: () { if (widget.onHide != null) widget.onHide!(); diff --git a/lib/widgets/attachments/attachment_list.dart b/lib/widgets/attachments/attachment_list.dart index 3606877..872d470 100644 --- a/lib/widgets/attachments/attachment_list.dart +++ b/lib/widgets/attachments/attachment_list.dart @@ -97,19 +97,14 @@ class _AttachmentListState extends State { @override Widget build(BuildContext context) { if (widget.attachmentsId.isEmpty) { - return Container(); + return const SizedBox(); } if (_isLoading) { - return AspectRatio( - aspectRatio: _aspectRatio, - child: Container( - decoration: BoxDecoration( - color: Theme.of(context).colorScheme.surfaceContainerHigh), - child: const Center( - child: CircularProgressIndicator(), - ), - ), + return Container( + decoration: BoxDecoration( + color: Theme.of(context).colorScheme.surfaceContainerHigh), + child: const LinearProgressIndicator(), ); }