Skip to content

Commit

Permalink
結果がないことを表示する
Browse files Browse the repository at this point in the history
  • Loading branch information
poppingmoon committed Dec 17, 2023
1 parent 1c19d11 commit 117c934
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/view/common/pushable_listview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class PushableListView<T> extends ConsumerStatefulWidget {
final bool shrinkWrap;
final ScrollPhysics? physics;
final bool showAd;
final bool hideIsEmpty;

const PushableListView({
super.key,
Expand All @@ -26,6 +27,7 @@ class PushableListView<T> extends ConsumerStatefulWidget {
this.physics,
this.additionalErrorInfo,
this.showAd = true,
this.hideIsEmpty = false,
});

@override
Expand Down Expand Up @@ -125,6 +127,14 @@ class PushableListViewState<T> extends ConsumerState<PushableListView<T>> {
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();
}

Expand Down
1 change: 1 addition & 0 deletions lib/view/note_create_page/drive_file_select_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class DriveFileSelectDialogState extends ConsumerState<DriveFileSelectDialog> {
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
showAd: false,
hideIsEmpty: true,
initializeFuture: () async {
final misskey = ref.read(misskeyProvider(widget.account));
final response = await misskey.drive.folders.folders(
Expand Down
1 change: 1 addition & 0 deletions lib/view/note_detail_page/note_detail_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ class NoteDetailPageState extends ConsumerState<NoteDetailPage> {
child: PushableListView(
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
hideIsEmpty: true,
initializeFuture: () async {
final repliesResult = await ref
.read(misskeyProvider(widget.account))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class FolderSelectDialogState extends ConsumerState<FolderSelectDialog> {
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
showAd: false,
hideIsEmpty: true,
initializeFuture: () async {
final misskey = ref.read(misskeyProvider(widget.account));
final response = await misskey.drive.folders.folders(
Expand Down

0 comments on commit 117c934

Please sign in to comment.