xcmd_Save method
dynamic
xcmd_Save()
Da chiamare ogni volta che si vuole salvare il dato Clonato in quello Originale
Implementation
xcmd_Save() async {
//se è new gli do ID, prima di save che sovrascrive
if (itemInEdit_Clone.id == "") {
itemInEdit_Clone.id = Uuid().v4();
}
editedPage.value = false;
itemInEdit_Clone.copyProps(itemInEdit_Clone, widget.itemInEdit);
if (media_isActive) {
Directory direct_AUDIO = Directory("${XLibStorage.filePath}/AUDIO/");
List<FileSystemEntity> liAudioToPush = List<FileSystemEntity>.empty(growable: true);
// liMediaToPush
liAudioToPush.addAll(direct_AUDIO.listSync());
for (var i in liAudioToPush) {
if (i.path.contains("DONE").not()) {
i.renameSync(i.path.replaceFirst("_", "_DONE"));
print(i.path);
// await setAudio(File.fromUri(i.uri).readAsBytesSync(), "AUDIO/${i.path}");
}
}
}
_xFillBottomBarActions();
//_xFillBottomBarActions(editedPage.value);
await xOnSaveAfter();
}