fixed overwrite on internal copy, DST drift in widget anchors, inline errors without controller and removed dead room lookup

This commit is contained in:
2026-09-27 17:37:31 +02:00
parent ee1240f71a
commit 2664378b17
13 changed files with 86 additions and 152 deletions
+8 -16
View File
@@ -7,8 +7,8 @@ import 'remote_file_ref.dart';
/// Server-side WebDAV copy of [source] into [targetFolderPath]. On a 412
/// conflict the user is asked whether to overwrite; on confirmation the call
/// is retried with `overwrite: true`. Returns true when the file ended up at
/// the target, false when the user cancelled.
/// is retried with `overwrite: true` inside the dialog. Returns true when the
/// file ended up at the target, false when the user cancelled.
Future<bool> copyRemoteFileTo({
required BuildContext context,
required RemoteFileRef source,
@@ -27,19 +27,11 @@ Future<bool> copyRemoteFileTo({
} on DynamiteApiException catch (e) {
if (e.statusCode != 412) rethrow;
if (!context.mounted) return false;
final overwrite = await showDialog<bool>(
context: context,
builder: (ctx) => ConfirmDialog(
title: 'Datei existiert bereits',
content:
'"${source.name}" existiert in /$targetFolderPath. Überschreiben?',
confirmButton: 'Überschreiben',
cancelButton: 'Abbrechen',
onConfirm: () => Navigator.of(ctx).pop(true),
),
);
if (overwrite != true) return false;
await webdav.copy(src, dstUri, overwrite: true);
return true;
return ConfirmDialog(
title: 'Datei existiert bereits',
content: '"${source.name}" existiert in /$targetFolderPath. Überschreiben?',
confirmButton: 'Überschreiben',
onConfirmAsync: () => webdav.copy(src, dstUri, overwrite: true),
).ask(context);
}
}