planMove static method
Pure move/rename decision (no I/O).
When the destination is an existing folder the item keeps its own name (a plain move); otherwise the destination's basename becomes the new name (a move-and-rename).
Implementation
static ({String destName, bool isRename}) planMove({
required String srcPath,
required String destPath,
required bool destIsExistingFolder,
}) =>
destIsExistingFolder
? (destName: p.basename(srcPath), isRename: false)
: (destName: p.basename(destPath), isRename: true);