Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PushableListViewの読み込み件数が0のときアイコンを表示しない #280

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions lib/view/common/pushable_listview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class PushableListView<T> extends HookConsumerWidget {
final bool shrinkWrap;
final ScrollPhysics? physics;
final bool showAd;
final bool hideIsEmpty;

const PushableListView({
required this.initializeFuture,
Expand All @@ -29,6 +30,7 @@ class PushableListView<T> extends HookConsumerWidget {
this.physics,
this.additionalErrorInfo,
this.showAd = true,
this.hideIsEmpty = false,
});

@override
Expand Down Expand Up @@ -99,6 +101,14 @@ class PushableListView<T> extends HookConsumerWidget {
if (isFinalPage.value) {
return Container();
}
if (items.isEmpty && !widget.hideIsEmpty) {
return const Center(
child: Padding(
padding: EdgeInsets.all(10),
child: Text("なんもないで"),
),
);
}

if (ref.read(
generalSettingsRepositoryProvider
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 @@ -66,6 +66,7 @@ class DriveFileSelectDialog extends HookConsumerWidget
child: Column(
children: [
PushableListView(
hideIsEmpty: true,
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
showAd: false,
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 @@ -82,6 +82,7 @@ class NoteDetailPage extends ConsumerWidget implements AutoRouteWrapper {
AsyncData(:final value) => ListView.builder(
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
hideIsEmpty: true,
itemCount: value.length,
itemBuilder: (context, index) {
return MisskeyNote(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,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