mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-02-25 10:58:50 +01:00
Refactoring: unify fn naming
This commit is contained in:
parent
7bb41887b3
commit
0f3dbda458
5 changed files with 191 additions and 197 deletions
|
@ -209,7 +209,7 @@ class _AlbumBrowserState extends State<AlbumBrowser>
|
||||||
);
|
);
|
||||||
if (isEditMode) {
|
if (isEditMode) {
|
||||||
content = Listener(
|
content = Listener(
|
||||||
onPointerMove: _onEditModePointerMove,
|
onPointerMove: _onEditPointerMove,
|
||||||
child: content,
|
child: content,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -254,13 +254,13 @@ class _AlbumBrowserState extends State<AlbumBrowser>
|
||||||
icon: const Icon(Icons.share),
|
icon: const Icon(Icons.share),
|
||||||
tooltip: L10n.global().shareTooltip,
|
tooltip: L10n.global().shareTooltip,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
_onSelectionAppBarSharePressed(context);
|
_onSelectionSharePressed(context);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: const Icon(Icons.remove),
|
icon: const Icon(Icons.remove),
|
||||||
tooltip: L10n.global().removeSelectedFromAlbumTooltip,
|
tooltip: L10n.global().removeSelectedFromAlbumTooltip,
|
||||||
onPressed: _onSelectionAppBarRemovePressed,
|
onPressed: _onSelectionRemovePressed,
|
||||||
),
|
),
|
||||||
PopupMenuButton<_SelectionMenuOption>(
|
PopupMenuButton<_SelectionMenuOption>(
|
||||||
tooltip: MaterialLocalizations.of(context).moreButtonTooltip,
|
tooltip: MaterialLocalizations.of(context).moreButtonTooltip,
|
||||||
|
@ -280,12 +280,12 @@ class _AlbumBrowserState extends State<AlbumBrowser>
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: const Icon(Icons.text_fields),
|
icon: const Icon(Icons.text_fields),
|
||||||
tooltip: L10n.global().albumAddTextTooltip,
|
tooltip: L10n.global().albumAddTextTooltip,
|
||||||
onPressed: _onEditAppBarAddTextPressed,
|
onPressed: _onEditAddTextPressed,
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: const Icon(Icons.sort_by_alpha),
|
icon: const Icon(Icons.sort_by_alpha),
|
||||||
tooltip: L10n.global().sortTooltip,
|
tooltip: L10n.global().sortTooltip,
|
||||||
onPressed: _onEditAppBarSortPressed,
|
onPressed: _onEditSortPressed,
|
||||||
),
|
),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@ -324,7 +324,19 @@ class _AlbumBrowserState extends State<AlbumBrowser>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onSelectionAppBarSharePressed(BuildContext context) {
|
void _onSelectionMenuSelected(
|
||||||
|
BuildContext context, _SelectionMenuOption option) {
|
||||||
|
switch (option) {
|
||||||
|
case _SelectionMenuOption.download:
|
||||||
|
_onSelectionDownloadPressed();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
_log.shout("[_onSelectionMenuSelected] Unknown option: $option");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void _onSelectionSharePressed(BuildContext context) {
|
||||||
assert(platform_k.isAndroid);
|
assert(platform_k.isAndroid);
|
||||||
final selected = selectedListItems
|
final selected = selectedListItems
|
||||||
.whereType<_FileListItem>()
|
.whereType<_FileListItem>()
|
||||||
|
@ -344,7 +356,7 @@ class _AlbumBrowserState extends State<AlbumBrowser>
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _onSelectionAppBarRemovePressed() async {
|
Future<void> _onSelectionRemovePressed() async {
|
||||||
final selectedIndexes =
|
final selectedIndexes =
|
||||||
selectedListItems.map((e) => (e as _ListItem).index).toList();
|
selectedListItems.map((e) => (e as _ListItem).index).toList();
|
||||||
final selectedItems = _sortedItems.takeIndex(selectedIndexes).toList();
|
final selectedItems = _sortedItems.takeIndex(selectedIndexes).toList();
|
||||||
|
@ -372,18 +384,6 @@ class _AlbumBrowserState extends State<AlbumBrowser>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onSelectionMenuSelected(
|
|
||||||
BuildContext context, _SelectionMenuOption option) {
|
|
||||||
switch (option) {
|
|
||||||
case _SelectionMenuOption.download:
|
|
||||||
_onSelectionDownloadPressed();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
_log.shout("[_onSelectionMenuSelected] Unknown option: $option");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void _onSelectionDownloadPressed() {
|
void _onSelectionDownloadPressed() {
|
||||||
final selected = selectedListItems
|
final selected = selectedListItems
|
||||||
.whereType<_FileListItem>()
|
.whereType<_FileListItem>()
|
||||||
|
@ -395,55 +395,7 @@ class _AlbumBrowserState extends State<AlbumBrowser>
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onEditAppBarSortPressed() {
|
void _onEditPointerMove(PointerMoveEvent event) {
|
||||||
final sortProvider = _editAlbum!.sortProvider;
|
|
||||||
showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (context) => FancyOptionPicker(
|
|
||||||
title: L10n.global().sortOptionDialogTitle,
|
|
||||||
items: [
|
|
||||||
FancyOptionPickerItem(
|
|
||||||
label: L10n.global().sortOptionTimeDescendingLabel,
|
|
||||||
isSelected: sortProvider is AlbumTimeSortProvider &&
|
|
||||||
!sortProvider.isAscending,
|
|
||||||
onSelect: () {
|
|
||||||
_onSortNewestPressed();
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
FancyOptionPickerItem(
|
|
||||||
label: L10n.global().sortOptionTimeAscendingLabel,
|
|
||||||
isSelected: sortProvider is AlbumTimeSortProvider &&
|
|
||||||
sortProvider.isAscending,
|
|
||||||
onSelect: () {
|
|
||||||
_onSortOldestPressed();
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _onSortOldestPressed() {
|
|
||||||
_editAlbum = _editAlbum!.copyWith(
|
|
||||||
sortProvider: const AlbumTimeSortProvider(isAscending: true),
|
|
||||||
);
|
|
||||||
setState(() {
|
|
||||||
_transformItems();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
void _onSortNewestPressed() {
|
|
||||||
_editAlbum = _editAlbum!.copyWith(
|
|
||||||
sortProvider: const AlbumTimeSortProvider(isAscending: false),
|
|
||||||
);
|
|
||||||
setState(() {
|
|
||||||
_transformItems();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
void _onEditModePointerMove(PointerMoveEvent event) {
|
|
||||||
assert(isEditMode);
|
assert(isEditMode);
|
||||||
if (!_isDragging) {
|
if (!_isDragging) {
|
||||||
return;
|
return;
|
||||||
|
@ -455,7 +407,7 @@ class _AlbumBrowserState extends State<AlbumBrowser>
|
||||||
}
|
}
|
||||||
final maxExtent =
|
final maxExtent =
|
||||||
_itemListMaxExtent ?? _scrollController.position.maxScrollExtent;
|
_itemListMaxExtent ?? _scrollController.position.maxScrollExtent;
|
||||||
_log.fine("[_onEditModePointerMove] Begin scrolling down");
|
_log.fine("[_onEditPointerMove] Begin scrolling down");
|
||||||
if (_scrollController.offset <
|
if (_scrollController.offset <
|
||||||
_scrollController.position.maxScrollExtent) {
|
_scrollController.position.maxScrollExtent) {
|
||||||
_scrollController.animateTo(maxExtent,
|
_scrollController.animateTo(maxExtent,
|
||||||
|
@ -470,7 +422,7 @@ class _AlbumBrowserState extends State<AlbumBrowser>
|
||||||
if (_isDragScrollingDown == false) {
|
if (_isDragScrollingDown == false) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_log.fine("[_onEditModePointerMove] Begin scrolling up");
|
_log.fine("[_onEditPointerMove] Begin scrolling up");
|
||||||
if (_scrollController.offset > 0) {
|
if (_scrollController.offset > 0) {
|
||||||
_scrollController.animateTo(0,
|
_scrollController.animateTo(0,
|
||||||
duration: Duration(
|
duration: Duration(
|
||||||
|
@ -479,13 +431,13 @@ class _AlbumBrowserState extends State<AlbumBrowser>
|
||||||
_isDragScrollingDown = false;
|
_isDragScrollingDown = false;
|
||||||
}
|
}
|
||||||
} else if (_isDragScrollingDown != null) {
|
} else if (_isDragScrollingDown != null) {
|
||||||
_log.fine("[_onEditModePointerMove] Stop scrolling");
|
_log.fine("[_onEditPointerMove] Stop scrolling");
|
||||||
_scrollController.jumpTo(_scrollController.offset);
|
_scrollController.jumpTo(_scrollController.offset);
|
||||||
_isDragScrollingDown = null;
|
_isDragScrollingDown = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onItemMoved(int fromIndex, int toIndex, bool isBefore) {
|
void _onEditItemMoved(int fromIndex, int toIndex, bool isBefore) {
|
||||||
if (fromIndex == toIndex) {
|
if (fromIndex == toIndex) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -505,7 +457,55 @@ class _AlbumBrowserState extends State<AlbumBrowser>
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onEditAppBarAddTextPressed() {
|
void _onEditSortPressed() {
|
||||||
|
final sortProvider = _editAlbum!.sortProvider;
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) => FancyOptionPicker(
|
||||||
|
title: L10n.global().sortOptionDialogTitle,
|
||||||
|
items: [
|
||||||
|
FancyOptionPickerItem(
|
||||||
|
label: L10n.global().sortOptionTimeDescendingLabel,
|
||||||
|
isSelected: sortProvider is AlbumTimeSortProvider &&
|
||||||
|
!sortProvider.isAscending,
|
||||||
|
onSelect: () {
|
||||||
|
_onEditSortNewestPressed();
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
FancyOptionPickerItem(
|
||||||
|
label: L10n.global().sortOptionTimeAscendingLabel,
|
||||||
|
isSelected: sortProvider is AlbumTimeSortProvider &&
|
||||||
|
sortProvider.isAscending,
|
||||||
|
onSelect: () {
|
||||||
|
_onEditSortOldestPressed();
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _onEditSortOldestPressed() {
|
||||||
|
_editAlbum = _editAlbum!.copyWith(
|
||||||
|
sortProvider: const AlbumTimeSortProvider(isAscending: true),
|
||||||
|
);
|
||||||
|
setState(() {
|
||||||
|
_transformItems();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void _onEditSortNewestPressed() {
|
||||||
|
_editAlbum = _editAlbum!.copyWith(
|
||||||
|
sortProvider: const AlbumTimeSortProvider(isAscending: false),
|
||||||
|
);
|
||||||
|
setState(() {
|
||||||
|
_transformItems();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void _onEditAddTextPressed() {
|
||||||
showDialog<String>(
|
showDialog<String>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => SimpleInputDialog(
|
builder: (context) => SimpleInputDialog(
|
||||||
|
@ -529,7 +529,7 @@ class _AlbumBrowserState extends State<AlbumBrowser>
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onLabelItemEditPressed(AlbumLabelItem item, int index) {
|
void _onEditLabelItemEditPressed(AlbumLabelItem item, int index) {
|
||||||
showDialog<String>(
|
showDialog<String>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => SimpleInputDialog(
|
builder: (context) => SimpleInputDialog(
|
||||||
|
@ -590,9 +590,9 @@ class _AlbumBrowserState extends State<AlbumBrowser>
|
||||||
previewUrl: previewUrl,
|
previewUrl: previewUrl,
|
||||||
onTap: () => _onItemTap(i),
|
onTap: () => _onItemTap(i),
|
||||||
onDropBefore: (dropItem) =>
|
onDropBefore: (dropItem) =>
|
||||||
_onItemMoved((dropItem as _ListItem).index, i, true),
|
_onEditItemMoved((dropItem as _ListItem).index, i, true),
|
||||||
onDropAfter: (dropItem) =>
|
onDropAfter: (dropItem) =>
|
||||||
_onItemMoved((dropItem as _ListItem).index, i, false),
|
_onEditItemMoved((dropItem as _ListItem).index, i, false),
|
||||||
onDragStarted: () {
|
onDragStarted: () {
|
||||||
_isDragging = true;
|
_isDragging = true;
|
||||||
},
|
},
|
||||||
|
@ -608,9 +608,9 @@ class _AlbumBrowserState extends State<AlbumBrowser>
|
||||||
previewUrl: previewUrl,
|
previewUrl: previewUrl,
|
||||||
onTap: () => _onItemTap(i),
|
onTap: () => _onItemTap(i),
|
||||||
onDropBefore: (dropItem) =>
|
onDropBefore: (dropItem) =>
|
||||||
_onItemMoved((dropItem as _ListItem).index, i, true),
|
_onEditItemMoved((dropItem as _ListItem).index, i, true),
|
||||||
onDropAfter: (dropItem) =>
|
onDropAfter: (dropItem) =>
|
||||||
_onItemMoved((dropItem as _ListItem).index, i, false),
|
_onEditItemMoved((dropItem as _ListItem).index, i, false),
|
||||||
onDragStarted: () {
|
onDragStarted: () {
|
||||||
_isDragging = true;
|
_isDragging = true;
|
||||||
},
|
},
|
||||||
|
@ -627,11 +627,11 @@ class _AlbumBrowserState extends State<AlbumBrowser>
|
||||||
yield _EditLabelListItem(
|
yield _EditLabelListItem(
|
||||||
index: i,
|
index: i,
|
||||||
text: item.text,
|
text: item.text,
|
||||||
onEditPressed: () => _onLabelItemEditPressed(item, i),
|
onEditPressed: () => _onEditLabelItemEditPressed(item, i),
|
||||||
onDropBefore: (dropItem) =>
|
onDropBefore: (dropItem) =>
|
||||||
_onItemMoved((dropItem as _ListItem).index, i, true),
|
_onEditItemMoved((dropItem as _ListItem).index, i, true),
|
||||||
onDropAfter: (dropItem) =>
|
onDropAfter: (dropItem) =>
|
||||||
_onItemMoved((dropItem as _ListItem).index, i, false),
|
_onEditItemMoved((dropItem as _ListItem).index, i, false),
|
||||||
onDragStarted: () {
|
onDragStarted: () {
|
||||||
_isDragging = true;
|
_isDragging = true;
|
||||||
},
|
},
|
||||||
|
|
|
@ -244,7 +244,7 @@ class _DynamicAlbumBrowserState extends State<DynamicAlbumBrowser>
|
||||||
onSelectedMenuItem: (option) {
|
onSelectedMenuItem: (option) {
|
||||||
switch (option) {
|
switch (option) {
|
||||||
case _menuValueConvertBasic:
|
case _menuValueConvertBasic:
|
||||||
_onAppBarConvertBasicPressed(context);
|
_onConvertBasicPressed(context);
|
||||||
break;
|
break;
|
||||||
case _menuValueDownload:
|
case _menuValueDownload:
|
||||||
_onDownloadPressed();
|
_onDownloadPressed();
|
||||||
|
@ -264,7 +264,7 @@ class _DynamicAlbumBrowserState extends State<DynamicAlbumBrowser>
|
||||||
icon: const Icon(Icons.share),
|
icon: const Icon(Icons.share),
|
||||||
tooltip: L10n.global().shareTooltip,
|
tooltip: L10n.global().shareTooltip,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
_onSelectionAppBarSharePressed(context);
|
_onSelectionSharePressed(context);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
PopupMenuButton<_SelectionMenuOption>(
|
PopupMenuButton<_SelectionMenuOption>(
|
||||||
|
@ -289,7 +289,7 @@ class _DynamicAlbumBrowserState extends State<DynamicAlbumBrowser>
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: const Icon(Icons.sort_by_alpha),
|
icon: const Icon(Icons.sort_by_alpha),
|
||||||
tooltip: L10n.global().sortTooltip,
|
tooltip: L10n.global().sortTooltip,
|
||||||
onPressed: _onEditAppBarSortPressed,
|
onPressed: _onEditSortPressed,
|
||||||
),
|
),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@ -309,7 +309,7 @@ class _DynamicAlbumBrowserState extends State<DynamicAlbumBrowser>
|
||||||
album: widget.album));
|
album: widget.album));
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _onAppBarConvertBasicPressed(BuildContext context) async {
|
Future<void> _onConvertBasicPressed(BuildContext context) async {
|
||||||
final result = await showDialog<bool>(
|
final result = await showDialog<bool>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => AlertDialog(
|
builder: (context) => AlertDialog(
|
||||||
|
@ -335,7 +335,7 @@ class _DynamicAlbumBrowserState extends State<DynamicAlbumBrowser>
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_log.info(
|
_log.info(
|
||||||
"[_onAppBarConvertBasicPressed] Converting album '${_album!.name}' to static");
|
"[_onConvertBasicPressed] Converting album '${_album!.name}' to static");
|
||||||
final albumRepo = AlbumRepo(AlbumCachedDataSource());
|
final albumRepo = AlbumRepo(AlbumCachedDataSource());
|
||||||
try {
|
try {
|
||||||
await UpdateAlbum(albumRepo)(
|
await UpdateAlbum(albumRepo)(
|
||||||
|
@ -356,7 +356,7 @@ class _DynamicAlbumBrowserState extends State<DynamicAlbumBrowser>
|
||||||
}
|
}
|
||||||
} catch (e, stackTrace) {
|
} catch (e, stackTrace) {
|
||||||
_log.shout(
|
_log.shout(
|
||||||
"[_onAppBarConvertBasicPressed] Failed while converting to basic album",
|
"[_onConvertBasicPressed] Failed while converting to basic album",
|
||||||
e,
|
e,
|
||||||
stackTrace);
|
stackTrace);
|
||||||
SnackBarManager().showSnackBar(SnackBar(
|
SnackBarManager().showSnackBar(SnackBar(
|
||||||
|
@ -374,7 +374,22 @@ class _DynamicAlbumBrowserState extends State<DynamicAlbumBrowser>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onSelectionAppBarSharePressed(BuildContext context) {
|
void _onSelectionMenuSelected(
|
||||||
|
BuildContext context, _SelectionMenuOption option) {
|
||||||
|
switch (option) {
|
||||||
|
case _SelectionMenuOption.delete:
|
||||||
|
_onSelectionDeletePressed();
|
||||||
|
break;
|
||||||
|
case _SelectionMenuOption.download:
|
||||||
|
_onSelectionDownloadPressed();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
_log.shout("[_onSelectionMenuSelected] Unknown option: $option");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void _onSelectionSharePressed(BuildContext context) {
|
||||||
assert(platform_k.isAndroid);
|
assert(platform_k.isAndroid);
|
||||||
final selected = selectedListItems
|
final selected = selectedListItems
|
||||||
.whereType<_FileListItem>()
|
.whereType<_FileListItem>()
|
||||||
|
@ -387,22 +402,7 @@ class _DynamicAlbumBrowserState extends State<DynamicAlbumBrowser>
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onSelectionMenuSelected(
|
void _onSelectionDeletePressed() async {
|
||||||
BuildContext context, _SelectionMenuOption option) {
|
|
||||||
switch (option) {
|
|
||||||
case _SelectionMenuOption.delete:
|
|
||||||
_onSelectionAppBarDeletePressed();
|
|
||||||
break;
|
|
||||||
case _SelectionMenuOption.download:
|
|
||||||
_onSelectionDownloadPressed();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
_log.shout("[_onSelectionMenuSelected] Unknown option: $option");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void _onSelectionAppBarDeletePressed() async {
|
|
||||||
SnackBarManager().showSnackBar(SnackBar(
|
SnackBarManager().showSnackBar(SnackBar(
|
||||||
content: Text(L10n.global()
|
content: Text(L10n.global()
|
||||||
.deleteSelectedProcessingNotification(selectedListItems.length)),
|
.deleteSelectedProcessingNotification(selectedListItems.length)),
|
||||||
|
@ -424,7 +424,7 @@ class _DynamicAlbumBrowserState extends State<DynamicAlbumBrowser>
|
||||||
successes.add(item);
|
successes.add(item);
|
||||||
} catch (e, stacktrace) {
|
} catch (e, stacktrace) {
|
||||||
_log.shout(
|
_log.shout(
|
||||||
"[_onSelectionAppBarDeletePressed] Failed while removing file" +
|
"[_onSelectionDeletePressed] Failed while removing file" +
|
||||||
(shouldLogFileName ? ": ${item.file.path}" : ""),
|
(shouldLogFileName ? ": ${item.file.path}" : ""),
|
||||||
e,
|
e,
|
||||||
stacktrace);
|
stacktrace);
|
||||||
|
@ -466,7 +466,7 @@ class _DynamicAlbumBrowserState extends State<DynamicAlbumBrowser>
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onEditAppBarSortPressed() {
|
void _onEditSortPressed() {
|
||||||
final sortProvider = _editAlbum!.sortProvider;
|
final sortProvider = _editAlbum!.sortProvider;
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
|
@ -478,7 +478,7 @@ class _DynamicAlbumBrowserState extends State<DynamicAlbumBrowser>
|
||||||
isSelected: sortProvider is AlbumTimeSortProvider &&
|
isSelected: sortProvider is AlbumTimeSortProvider &&
|
||||||
!sortProvider.isAscending,
|
!sortProvider.isAscending,
|
||||||
onSelect: () {
|
onSelect: () {
|
||||||
_onSortNewestPressed();
|
_onEditSortNewestPressed();
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
@ -487,7 +487,7 @@ class _DynamicAlbumBrowserState extends State<DynamicAlbumBrowser>
|
||||||
isSelected: sortProvider is AlbumTimeSortProvider &&
|
isSelected: sortProvider is AlbumTimeSortProvider &&
|
||||||
sortProvider.isAscending,
|
sortProvider.isAscending,
|
||||||
onSelect: () {
|
onSelect: () {
|
||||||
_onSortOldestPressed();
|
_onEditSortOldestPressed();
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
@ -496,7 +496,7 @@ class _DynamicAlbumBrowserState extends State<DynamicAlbumBrowser>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onSortOldestPressed() {
|
void _onEditSortOldestPressed() {
|
||||||
_editAlbum = _editAlbum!.copyWith(
|
_editAlbum = _editAlbum!.copyWith(
|
||||||
sortProvider: const AlbumTimeSortProvider(isAscending: true),
|
sortProvider: const AlbumTimeSortProvider(isAscending: true),
|
||||||
);
|
);
|
||||||
|
@ -505,7 +505,7 @@ class _DynamicAlbumBrowserState extends State<DynamicAlbumBrowser>
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onSortNewestPressed() {
|
void _onEditSortNewestPressed() {
|
||||||
_editAlbum = _editAlbum!.copyWith(
|
_editAlbum = _editAlbum!.copyWith(
|
||||||
sortProvider: const AlbumTimeSortProvider(isAscending: false),
|
sortProvider: const AlbumTimeSortProvider(isAscending: false),
|
||||||
);
|
);
|
||||||
|
|
|
@ -157,7 +157,7 @@ class _HomeAlbumsState extends State<HomeAlbums>
|
||||||
icon: const Icon(Icons.delete),
|
icon: const Icon(Icons.delete),
|
||||||
tooltip: L10n.global().deleteTooltip,
|
tooltip: L10n.global().deleteTooltip,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
_onSelectionAppBarDeletePressed();
|
_onSelectionDeletePressed();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -191,7 +191,7 @@ class _HomeAlbumsState extends State<HomeAlbums>
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case _menuValueImport:
|
case _menuValueImport:
|
||||||
_onAppBarImportPressed(context);
|
_onImportPressed(context);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -307,6 +307,17 @@ class _HomeAlbumsState extends State<HomeAlbums>
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _onSearchPressed(BuildContext context) {
|
||||||
|
showSearch(
|
||||||
|
context: context,
|
||||||
|
delegate: AlbumSearchDelegate(context, widget.account),
|
||||||
|
).then((value) {
|
||||||
|
if (value is Album) {
|
||||||
|
_openAlbum(context, value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
void _onSortPressed(BuildContext context) {
|
void _onSortPressed(BuildContext context) {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
|
@ -357,12 +368,12 @@ class _HomeAlbumsState extends State<HomeAlbums>
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onAppBarImportPressed(BuildContext context) {
|
void _onImportPressed(BuildContext context) {
|
||||||
Navigator.of(context).pushNamed(AlbumImporter.routeName,
|
Navigator.of(context).pushNamed(AlbumImporter.routeName,
|
||||||
arguments: AlbumImporterArguments(widget.account));
|
arguments: AlbumImporterArguments(widget.account));
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _onSelectionAppBarDeletePressed() async {
|
Future<void> _onSelectionDeletePressed() async {
|
||||||
final selected = selectedListItems
|
final selected = selectedListItems
|
||||||
.whereType<_AlbumListItem>()
|
.whereType<_AlbumListItem>()
|
||||||
.map((e) => e.album)
|
.map((e) => e.album)
|
||||||
|
@ -384,7 +395,7 @@ class _HomeAlbumsState extends State<HomeAlbums>
|
||||||
await Remove(fileRepo, albumRepo)(widget.account, f);
|
await Remove(fileRepo, albumRepo)(widget.account, f);
|
||||||
} catch (e, stacktrace) {
|
} catch (e, stacktrace) {
|
||||||
_log.shout(
|
_log.shout(
|
||||||
"[_onSelectionAppBarDeletePressed] Failed while removing file" +
|
"[_onSelectionDeletePressed] Failed while removing file" +
|
||||||
(shouldLogFileName ? ": ${f.path}" : ""),
|
(shouldLogFileName ? ": ${f.path}" : ""),
|
||||||
e,
|
e,
|
||||||
stacktrace);
|
stacktrace);
|
||||||
|
@ -405,17 +416,6 @@ class _HomeAlbumsState extends State<HomeAlbums>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onSearchPressed(BuildContext context) {
|
|
||||||
showSearch(
|
|
||||||
context: context,
|
|
||||||
delegate: AlbumSearchDelegate(context, widget.account),
|
|
||||||
).then((value) {
|
|
||||||
if (value is Album) {
|
|
||||||
_openAlbum(context, value);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Transform an Album list to grid items
|
/// Transform an Album list to grid items
|
||||||
void _transformItems(List<ListAlbumBlocItem> items) {
|
void _transformItems(List<ListAlbumBlocItem> items) {
|
||||||
final sort = _getSortFromPref();
|
final sort = _getSortFromPref();
|
||||||
|
|
|
@ -185,14 +185,14 @@ class _HomePhotosState extends State<HomePhotos>
|
||||||
icon: const Icon(Icons.share),
|
icon: const Icon(Icons.share),
|
||||||
tooltip: L10n.global().shareTooltip,
|
tooltip: L10n.global().shareTooltip,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
_onSelectionAppBarSharePressed(context);
|
_onSelectionSharePressed(context);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: const Icon(Icons.playlist_add),
|
icon: const Icon(Icons.playlist_add),
|
||||||
tooltip: L10n.global().addToAlbumTooltip,
|
tooltip: L10n.global().addToAlbumTooltip,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
_onAddToAlbumPressed(context);
|
_onSelectionAddToAlbumPressed(context);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
PopupMenuButton<_SelectionMenuOption>(
|
PopupMenuButton<_SelectionMenuOption>(
|
||||||
|
@ -212,7 +212,7 @@ class _HomePhotosState extends State<HomePhotos>
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
onSelected: (option) {
|
onSelected: (option) {
|
||||||
_onSelectionAppBarMenuSelected(context, option);
|
_onSelectionMenuSelected(context, option);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -357,7 +357,30 @@ class _HomePhotosState extends State<HomePhotos>
|
||||||
arguments: ViewerArguments(widget.account, _backingFiles, index));
|
arguments: ViewerArguments(widget.account, _backingFiles, index));
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onSelectionAppBarSharePressed(BuildContext context) {
|
void _onRefreshSelected() {
|
||||||
|
_hasFiredMetadataTask.value = false;
|
||||||
|
_reqRefresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
void _onSelectionMenuSelected(
|
||||||
|
BuildContext context, _SelectionMenuOption option) {
|
||||||
|
switch (option) {
|
||||||
|
case _SelectionMenuOption.archive:
|
||||||
|
_onSelectionArchivePressed(context);
|
||||||
|
break;
|
||||||
|
case _SelectionMenuOption.delete:
|
||||||
|
_onSelectionDeletePressed(context);
|
||||||
|
break;
|
||||||
|
case _SelectionMenuOption.download:
|
||||||
|
_onSelectionDownloadPressed();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
_log.shout("[_onSelectionMenuSelected] Unknown option: $option");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void _onSelectionSharePressed(BuildContext context) {
|
||||||
assert(platform_k.isAndroid);
|
assert(platform_k.isAndroid);
|
||||||
final selected = selectedListItems
|
final selected = selectedListItems
|
||||||
.whereType<_FileListItem>()
|
.whereType<_FileListItem>()
|
||||||
|
@ -370,7 +393,7 @@ class _HomePhotosState extends State<HomePhotos>
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _onAddToAlbumPressed(BuildContext context) async {
|
Future<void> _onSelectionAddToAlbumPressed(BuildContext context) async {
|
||||||
try {
|
try {
|
||||||
final value = await showDialog<Album>(
|
final value = await showDialog<Album>(
|
||||||
context: context,
|
context: context,
|
||||||
|
@ -383,7 +406,7 @@ class _HomePhotosState extends State<HomePhotos>
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_log.info("[_onAddToAlbumPressed] Album picked: ${value.name}");
|
_log.info("[_onSelectionAddToAlbumPressed] Album picked: ${value.name}");
|
||||||
await NotifiedAction(
|
await NotifiedAction(
|
||||||
() async {
|
() async {
|
||||||
assert(value.provider is AlbumStaticProvider);
|
assert(value.provider is AlbumStaticProvider);
|
||||||
|
@ -402,11 +425,11 @@ class _HomePhotosState extends State<HomePhotos>
|
||||||
failureText: L10n.global().addSelectedToAlbumFailureNotification,
|
failureText: L10n.global().addSelectedToAlbumFailureNotification,
|
||||||
)();
|
)();
|
||||||
} catch (e, stackTrace) {
|
} catch (e, stackTrace) {
|
||||||
_log.shout("[_onAddToAlbumPressed] Exception", e, stackTrace);
|
_log.shout("[_onSelectionAddToAlbumPressed] Exception", e, stackTrace);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onDownloadPressed() {
|
void _onSelectionDownloadPressed() {
|
||||||
final selected = selectedListItems
|
final selected = selectedListItems
|
||||||
.whereType<_FileListItem>()
|
.whereType<_FileListItem>()
|
||||||
.map((e) => e.file)
|
.map((e) => e.file)
|
||||||
|
@ -417,7 +440,7 @@ class _HomePhotosState extends State<HomePhotos>
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _onArchivePressed(BuildContext context) async {
|
Future<void> _onSelectionArchivePressed(BuildContext context) async {
|
||||||
final selectedFiles = selectedListItems
|
final selectedFiles = selectedListItems
|
||||||
.whereType<_FileListItem>()
|
.whereType<_FileListItem>()
|
||||||
.map((e) => e.file)
|
.map((e) => e.file)
|
||||||
|
@ -439,7 +462,7 @@ class _HomePhotosState extends State<HomePhotos>
|
||||||
L10n.global().archiveSelectedFailureNotification(failures.length),
|
L10n.global().archiveSelectedFailureNotification(failures.length),
|
||||||
onActionError: (file, e, stackTrace) {
|
onActionError: (file, e, stackTrace) {
|
||||||
_log.shout(
|
_log.shout(
|
||||||
"[_onArchivePressed] Failed while archiving file" +
|
"[_onSelectionArchivePressed] Failed while archiving file" +
|
||||||
(shouldLogFileName ? ": ${file.path}" : ""),
|
(shouldLogFileName ? ": ${file.path}" : ""),
|
||||||
e,
|
e,
|
||||||
stackTrace);
|
stackTrace);
|
||||||
|
@ -447,7 +470,7 @@ class _HomePhotosState extends State<HomePhotos>
|
||||||
)();
|
)();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _onDeletePressed(BuildContext context) async {
|
Future<void> _onSelectionDeletePressed(BuildContext context) async {
|
||||||
final selectedFiles = selectedListItems
|
final selectedFiles = selectedListItems
|
||||||
.whereType<_FileListItem>()
|
.whereType<_FileListItem>()
|
||||||
.map((e) => e.file)
|
.map((e) => e.file)
|
||||||
|
@ -469,7 +492,7 @@ class _HomePhotosState extends State<HomePhotos>
|
||||||
L10n.global().deleteSelectedFailureNotification(failures.length),
|
L10n.global().deleteSelectedFailureNotification(failures.length),
|
||||||
onActionError: (file, e, stackTrace) {
|
onActionError: (file, e, stackTrace) {
|
||||||
_log.shout(
|
_log.shout(
|
||||||
"[_onDeletePressed] Failed while removing file" +
|
"[_onSelectionDeletePressed] Failed while removing file" +
|
||||||
(shouldLogFileName ? ": ${file.path}" : ""),
|
(shouldLogFileName ? ": ${file.path}" : ""),
|
||||||
e,
|
e,
|
||||||
stackTrace);
|
stackTrace);
|
||||||
|
@ -477,32 +500,6 @@ class _HomePhotosState extends State<HomePhotos>
|
||||||
)();
|
)();
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onSelectionAppBarMenuSelected(
|
|
||||||
BuildContext context, _SelectionMenuOption option) {
|
|
||||||
switch (option) {
|
|
||||||
case _SelectionMenuOption.archive:
|
|
||||||
_onArchivePressed(context);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case _SelectionMenuOption.delete:
|
|
||||||
_onDeletePressed(context);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case _SelectionMenuOption.download:
|
|
||||||
_onDownloadPressed();
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
_log.shout("[_onSelectionAppBarMenuSelected] Unknown option: $option");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void _onRefreshSelected() {
|
|
||||||
_hasFiredMetadataTask.value = false;
|
|
||||||
_reqRefresh();
|
|
||||||
}
|
|
||||||
|
|
||||||
void _onMetadataTaskStateChanged(MetadataTaskStateChangedEvent ev) {
|
void _onMetadataTaskStateChanged(MetadataTaskStateChangedEvent ev) {
|
||||||
if (ev.state == MetadataTaskState.idle) {
|
if (ev.state == MetadataTaskState.idle) {
|
||||||
_metadataTaskProcessCount = 0;
|
_metadataTaskProcessCount = 0;
|
||||||
|
|
|
@ -267,14 +267,14 @@ class _PersonBrowserState extends State<PersonBrowser>
|
||||||
icon: const Icon(Icons.share),
|
icon: const Icon(Icons.share),
|
||||||
tooltip: L10n.global().shareTooltip,
|
tooltip: L10n.global().shareTooltip,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
_onSharePressed(context);
|
_onSelectionSharePressed(context);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: const Icon(Icons.playlist_add),
|
icon: const Icon(Icons.playlist_add),
|
||||||
tooltip: L10n.global().addToAlbumTooltip,
|
tooltip: L10n.global().addToAlbumTooltip,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
_onAddToAlbumPressed(context);
|
_onSelectionAddToAlbumPressed(context);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
PopupMenuButton<_SelectionMenuOption>(
|
PopupMenuButton<_SelectionMenuOption>(
|
||||||
|
@ -294,7 +294,7 @@ class _PersonBrowserState extends State<PersonBrowser>
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
onSelected: (option) {
|
onSelected: (option) {
|
||||||
_onOptionMenuSelected(context, option);
|
_onSelectionMenuSelected(context, option);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -320,7 +320,25 @@ class _PersonBrowserState extends State<PersonBrowser>
|
||||||
arguments: ViewerArguments(widget.account, _backingFiles!, index));
|
arguments: ViewerArguments(widget.account, _backingFiles!, index));
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onSharePressed(BuildContext context) {
|
void _onSelectionMenuSelected(
|
||||||
|
BuildContext context, _SelectionMenuOption option) {
|
||||||
|
switch (option) {
|
||||||
|
case _SelectionMenuOption.archive:
|
||||||
|
_onSelectionArchivePressed(context);
|
||||||
|
break;
|
||||||
|
case _SelectionMenuOption.delete:
|
||||||
|
_onSelectionDeletePressed(context);
|
||||||
|
break;
|
||||||
|
case _SelectionMenuOption.download:
|
||||||
|
_onSelectionDownloadPressed();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
_log.shout("[_onSelectionMenuSelected] Unknown option: $option");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void _onSelectionSharePressed(BuildContext context) {
|
||||||
assert(platform_k.isAndroid);
|
assert(platform_k.isAndroid);
|
||||||
final selected =
|
final selected =
|
||||||
selectedListItems.whereType<_ListItem>().map((e) => e.file).toList();
|
selectedListItems.whereType<_ListItem>().map((e) => e.file).toList();
|
||||||
|
@ -331,7 +349,7 @@ class _PersonBrowserState extends State<PersonBrowser>
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _onAddToAlbumPressed(BuildContext context) async {
|
Future<void> _onSelectionAddToAlbumPressed(BuildContext context) async {
|
||||||
try {
|
try {
|
||||||
final value = await showDialog<Album>(
|
final value = await showDialog<Album>(
|
||||||
context: context,
|
context: context,
|
||||||
|
@ -344,7 +362,7 @@ class _PersonBrowserState extends State<PersonBrowser>
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_log.info("[_onAddToAlbumPressed] Album picked: ${value.name}");
|
_log.info("[_onSelectionAddToAlbumPressed] Album picked: ${value.name}");
|
||||||
await NotifiedAction(
|
await NotifiedAction(
|
||||||
() async {
|
() async {
|
||||||
assert(value.provider is AlbumStaticProvider);
|
assert(value.provider is AlbumStaticProvider);
|
||||||
|
@ -363,11 +381,11 @@ class _PersonBrowserState extends State<PersonBrowser>
|
||||||
failureText: L10n.global().addSelectedToAlbumFailureNotification,
|
failureText: L10n.global().addSelectedToAlbumFailureNotification,
|
||||||
)();
|
)();
|
||||||
} catch (e, stackTrace) {
|
} catch (e, stackTrace) {
|
||||||
_log.shout("[_onAddToAlbumPressed] Exception", e, stackTrace);
|
_log.shout("[_onSelectionAddToAlbumPressed] Exception", e, stackTrace);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onDownloadPressed() {
|
void _onSelectionDownloadPressed() {
|
||||||
final selected =
|
final selected =
|
||||||
selectedListItems.whereType<_ListItem>().map((e) => e.file).toList();
|
selectedListItems.whereType<_ListItem>().map((e) => e.file).toList();
|
||||||
DownloadHandler().downloadFiles(widget.account, selected);
|
DownloadHandler().downloadFiles(widget.account, selected);
|
||||||
|
@ -376,7 +394,7 @@ class _PersonBrowserState extends State<PersonBrowser>
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _onArchivePressed(BuildContext context) async {
|
Future<void> _onSelectionArchivePressed(BuildContext context) async {
|
||||||
final selectedFiles =
|
final selectedFiles =
|
||||||
selectedListItems.whereType<_ListItem>().map((e) => e.file).toList();
|
selectedListItems.whereType<_ListItem>().map((e) => e.file).toList();
|
||||||
setState(() {
|
setState(() {
|
||||||
|
@ -396,7 +414,7 @@ class _PersonBrowserState extends State<PersonBrowser>
|
||||||
L10n.global().archiveSelectedFailureNotification(failures.length),
|
L10n.global().archiveSelectedFailureNotification(failures.length),
|
||||||
onActionError: (file, e, stackTrace) {
|
onActionError: (file, e, stackTrace) {
|
||||||
_log.shout(
|
_log.shout(
|
||||||
"[_onArchivePressed] Failed while archiving file" +
|
"[_onSelectionArchivePressed] Failed while archiving file" +
|
||||||
(shouldLogFileName ? ": ${file.path}" : ""),
|
(shouldLogFileName ? ": ${file.path}" : ""),
|
||||||
e,
|
e,
|
||||||
stackTrace);
|
stackTrace);
|
||||||
|
@ -404,7 +422,7 @@ class _PersonBrowserState extends State<PersonBrowser>
|
||||||
)();
|
)();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _onDeletePressed(BuildContext context) async {
|
Future<void> _onSelectionDeletePressed(BuildContext context) async {
|
||||||
final selectedFiles =
|
final selectedFiles =
|
||||||
selectedListItems.whereType<_ListItem>().map((e) => e.file).toList();
|
selectedListItems.whereType<_ListItem>().map((e) => e.file).toList();
|
||||||
setState(() {
|
setState(() {
|
||||||
|
@ -424,7 +442,7 @@ class _PersonBrowserState extends State<PersonBrowser>
|
||||||
L10n.global().deleteSelectedFailureNotification(failures.length),
|
L10n.global().deleteSelectedFailureNotification(failures.length),
|
||||||
onActionError: (file, e, stackTrace) {
|
onActionError: (file, e, stackTrace) {
|
||||||
_log.shout(
|
_log.shout(
|
||||||
"[_onDeletePressed] Failed while removing file" +
|
"[_onSelectionDeletePressed] Failed while removing file" +
|
||||||
(shouldLogFileName ? ": ${file.path}" : ""),
|
(shouldLogFileName ? ": ${file.path}" : ""),
|
||||||
e,
|
e,
|
||||||
stackTrace);
|
stackTrace);
|
||||||
|
@ -432,27 +450,6 @@ class _PersonBrowserState extends State<PersonBrowser>
|
||||||
)();
|
)();
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onOptionMenuSelected(
|
|
||||||
BuildContext context, _SelectionMenuOption option) {
|
|
||||||
switch (option) {
|
|
||||||
case _SelectionMenuOption.archive:
|
|
||||||
_onArchivePressed(context);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case _SelectionMenuOption.delete:
|
|
||||||
_onDeletePressed(context);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case _SelectionMenuOption.download:
|
|
||||||
_onDownloadPressed();
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
_log.shout("[_onOptionMenuSelected] Unknown option: $option");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void _onFilePropertyUpdated(FilePropertyUpdatedEvent ev) {
|
void _onFilePropertyUpdated(FilePropertyUpdatedEvent ev) {
|
||||||
if (_backingFiles?.containsIf(ev.file, (a, b) => a.fileId == b.fileId) !=
|
if (_backingFiles?.containsIf(ev.file, (a, b) => a.fileId == b.fileId) !=
|
||||||
true) {
|
true) {
|
||||||
|
|
Loading…
Reference in a new issue