deleteFiles function
Implementation
void deleteFiles(List<String> paths) {
stdout.write(
'${ColorsText.blue}Do you want to delete these files? (y/n): ${ColorsText.reset}');
String? answer = stdin.readLineSync();
if (answer != null &&
(answer == 'y' ||
answer == 'Y' ||
answer == 'Yes' ||
answer == 'yes' ||
answer == 'YES')) {
print('');
for (var path in paths) {
_deleteFile(path);
}
print(
'\n${ColorsText.green}✓ Files deleted successfully${ColorsText.reset}\n');
} else {
print('${ColorsText.yellow}Deletion cancelled${ColorsText.reset}\n');
}
}