improved last collection entry deletion
This commit is contained in:
parent
46928d8458
commit
5b018fbe75
2 changed files with 11 additions and 3 deletions
|
@ -137,7 +137,7 @@ class FullscreenBodyState extends State<FullscreenBody> with SingleTickerProvide
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final entry = entries[_currentHorizontalPage];
|
final entry = _currentHorizontalPage < entries.length ? entries[_currentHorizontalPage] : null;
|
||||||
return WillPopScope(
|
return WillPopScope(
|
||||||
onWillPop: () {
|
onWillPop: () {
|
||||||
if (_currentVerticalPage == 1) {
|
if (_currentVerticalPage == 1) {
|
||||||
|
@ -311,7 +311,11 @@ class FullscreenBodyState extends State<FullscreenBody> with SingleTickerProvide
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (confirmed == null || !confirmed) return;
|
if (confirmed == null || !confirmed) return;
|
||||||
if (!await collection.delete(entry)) showFeedback('Failed');
|
if (!await collection.delete(entry)) {
|
||||||
|
showFeedback('Failed');
|
||||||
|
} else if (entries.isEmpty) {
|
||||||
|
Navigator.pop(context);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
showRenameDialog(ImageEntry entry) async {
|
showRenameDialog(ImageEntry entry) async {
|
||||||
|
|
|
@ -31,7 +31,11 @@ class _FullscreenBottomOverlayState extends State<FullscreenBottomOverlay> {
|
||||||
ImageEntry _lastEntry;
|
ImageEntry _lastEntry;
|
||||||
OverlayMetadata _lastDetails;
|
OverlayMetadata _lastDetails;
|
||||||
|
|
||||||
ImageEntry get entry => widget.entries[widget.index];
|
ImageEntry get entry {
|
||||||
|
final entries = widget.entries;
|
||||||
|
final index = widget.index;
|
||||||
|
return index < entries.length ? entries[index] : null;
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
|
|
Loading…
Reference in a new issue