From 6f5bad17e048fbd03e675c996509d8cbdff1f754 Mon Sep 17 00:00:00 2001 From: poppingmoon <63451158+poppingmoon@users.noreply.github.com> Date: Wed, 30 Aug 2023 18:51:33 +0900 Subject: [PATCH] =?UTF-8?q?=E7=B5=90=E6=9E=9C=E3=81=8C=E3=81=AA=E3=81=84?= =?UTF-8?q?=E3=81=93=E3=81=A8=E3=82=92=E8=A1=A8=E7=A4=BA=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/view/common/pushable_listview.dart | 10 ++++++++++ .../note_create_page/drive_file_select_dialog.dart | 1 + lib/view/note_detail_page/note_detail_page.dart | 1 + .../import_export_page/folder_select_dialog.dart | 1 + 4 files changed, 13 insertions(+) diff --git a/lib/view/common/pushable_listview.dart b/lib/view/common/pushable_listview.dart index 288e2643a..4af7680b6 100644 --- a/lib/view/common/pushable_listview.dart +++ b/lib/view/common/pushable_listview.dart @@ -13,6 +13,7 @@ class PushableListView extends ConsumerStatefulWidget { final Object listKey; final bool shrinkWrap; final ScrollPhysics? physics; + final bool hideIsEmpty; const PushableListView({ super.key, @@ -23,6 +24,7 @@ class PushableListView extends ConsumerStatefulWidget { this.shrinkWrap = false, this.physics, this.additionalErrorInfo, + this.hideIsEmpty = false, }); @override @@ -115,6 +117,14 @@ class PushableListViewState extends ConsumerState> { itemBuilder: (context, index) { if (items.length == index) { if (isFinalPage) { + if (items.isEmpty && !widget.hideIsEmpty) { + return const Center( + child: Padding( + padding: EdgeInsets.all(10), + child: Text("ありません"), + ), + ); + } return Container(); } diff --git a/lib/view/note_create_page/drive_file_select_dialog.dart b/lib/view/note_create_page/drive_file_select_dialog.dart index d58be56fd..47725fa94 100644 --- a/lib/view/note_create_page/drive_file_select_dialog.dart +++ b/lib/view/note_create_page/drive_file_select_dialog.dart @@ -69,6 +69,7 @@ class DriveFileSelectDialogState extends ConsumerState { PushableListView( shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), + hideIsEmpty: true, initializeFuture: () async { final misskey = ref.read(misskeyProvider(widget.account)); final response = await misskey.drive.folders.folders( diff --git a/lib/view/note_detail_page/note_detail_page.dart b/lib/view/note_detail_page/note_detail_page.dart index a78cfdb58..f3da16792 100644 --- a/lib/view/note_detail_page/note_detail_page.dart +++ b/lib/view/note_detail_page/note_detail_page.dart @@ -101,6 +101,7 @@ class NoteDetailPageState extends ConsumerState { child: PushableListView( physics: const NeverScrollableScrollPhysics(), shrinkWrap: true, + hideIsEmpty: true, initializeFuture: () async { final repliesResult = await ref .read(misskeyProvider(widget.account)) diff --git a/lib/view/settings_page/import_export_page/folder_select_dialog.dart b/lib/view/settings_page/import_export_page/folder_select_dialog.dart index 39871bc9d..72cc64a6d 100644 --- a/lib/view/settings_page/import_export_page/folder_select_dialog.dart +++ b/lib/view/settings_page/import_export_page/folder_select_dialog.dart @@ -63,6 +63,7 @@ class FolderSelectDialogState extends ConsumerState { PushableListView( shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), + hideIsEmpty: true, initializeFuture: () async { final misskey = ref.read(misskeyProvider(widget.account)); final response = await misskey.drive.folders.folders(