getPathAndRenameFile method
Implementation
String getPathAndRenameFile(String? newName) {
final directoryPath = substring(0, lastIndexOf('/'));
final extension = split('.').last;
if (newName != null) {
return '$directoryPath/$newName.$extension';
} else {
return '$directoryPath/${DateTime.now().millisecondsSinceEpoch}.$extension';
}
}