mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-02-25 02:48:54 +01:00
Show something in a empty browser
This commit is contained in:
parent
f412556f65
commit
c6f2cebf12
4 changed files with 90 additions and 48 deletions
|
@ -581,6 +581,10 @@
|
|||
"@listNoResultsText": {
|
||||
"description": "When there's nothing in a list"
|
||||
},
|
||||
"listEmptyText": "Empty",
|
||||
"@listEmptyText": {
|
||||
"description": "When there's nothing in a list"
|
||||
},
|
||||
"albumTrashLabel": "Trash",
|
||||
"@albumTrashLabel": {
|
||||
"description": "Deleted photos"
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"el": [
|
||||
"listEmptyText",
|
||||
"albumTrashLabel",
|
||||
"restoreTooltip",
|
||||
"restoreSelectedProcessingNotification",
|
||||
|
@ -18,6 +19,7 @@
|
|||
"albumSearchTextFieldHint",
|
||||
"clearTooltip",
|
||||
"listNoResultsText",
|
||||
"listEmptyText",
|
||||
"albumTrashLabel",
|
||||
"restoreTooltip",
|
||||
"restoreSelectedProcessingNotification",
|
||||
|
|
|
@ -18,6 +18,7 @@ import 'package:nc_photos/pref.dart';
|
|||
import 'package:nc_photos/snack_bar_manager.dart';
|
||||
import 'package:nc_photos/theme.dart';
|
||||
import 'package:nc_photos/use_case/update_property.dart';
|
||||
import 'package:nc_photos/widget/empty_list_indicator.dart';
|
||||
import 'package:nc_photos/widget/photo_list_item.dart';
|
||||
import 'package:nc_photos/widget/selectable_item_stream_list_mixin.dart';
|
||||
import 'package:nc_photos/widget/selection_app_bar.dart';
|
||||
|
@ -95,6 +96,22 @@ class _ArchiveBrowserState extends State<ArchiveBrowser>
|
|||
}
|
||||
|
||||
Widget _buildContent(BuildContext context, ScanDirBlocState state) {
|
||||
if (state is ScanDirBlocSuccess && itemStreamListItems.isEmpty) {
|
||||
return Column(
|
||||
children: [
|
||||
AppBar(
|
||||
title: Text(L10n.of(context).albumArchiveLabel),
|
||||
elevation: 0,
|
||||
),
|
||||
Expanded(
|
||||
child: EmptyListIndicator(
|
||||
icon: Icons.archive_outlined,
|
||||
text: L10n.of(context).listEmptyText,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
} else {
|
||||
return Stack(
|
||||
children: [
|
||||
buildItemStreamListOuter(
|
||||
|
@ -124,6 +141,7 @@ class _ArchiveBrowserState extends State<ArchiveBrowser>
|
|||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Widget _buildAppBar(BuildContext context) {
|
||||
if (isSelectionMode) {
|
||||
|
|
|
@ -19,6 +19,7 @@ import 'package:nc_photos/snack_bar_manager.dart';
|
|||
import 'package:nc_photos/theme.dart';
|
||||
import 'package:nc_photos/use_case/remove.dart';
|
||||
import 'package:nc_photos/use_case/restore_trashbin.dart';
|
||||
import 'package:nc_photos/widget/empty_list_indicator.dart';
|
||||
import 'package:nc_photos/widget/photo_list_item.dart';
|
||||
import 'package:nc_photos/widget/selectable_item_stream_list_mixin.dart';
|
||||
import 'package:nc_photos/widget/selection_app_bar.dart';
|
||||
|
@ -97,6 +98,22 @@ class _TrashbinBrowserState extends State<TrashbinBrowser>
|
|||
}
|
||||
|
||||
Widget _buildContent(BuildContext context, LsTrashbinBlocState state) {
|
||||
if (state is LsTrashbinBlocSuccess && itemStreamListItems.isEmpty) {
|
||||
return Column(
|
||||
children: [
|
||||
AppBar(
|
||||
title: Text(L10n.of(context).albumTrashLabel),
|
||||
elevation: 0,
|
||||
),
|
||||
Expanded(
|
||||
child: EmptyListIndicator(
|
||||
icon: Icons.delete_outline,
|
||||
text: L10n.of(context).listEmptyText,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
} else {
|
||||
return Stack(
|
||||
children: [
|
||||
buildItemStreamListOuter(
|
||||
|
@ -126,6 +143,7 @@ class _TrashbinBrowserState extends State<TrashbinBrowser>
|
|||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Widget _buildAppBar(BuildContext context) {
|
||||
if (isSelectionMode) {
|
||||
|
|
Loading…
Reference in a new issue