generateCommandLineArguments method
Implementation
List<String> generateCommandLineArguments(
String dialogTitle, {
String fileFilter = '',
String fileName = '',
String initialDirectory = '',
bool multipleFiles = false,
bool pickDirectory = false,
bool saveFile = false,
}) {
final arguments = ['-e'];
String argument = 'choose ';
if (pickDirectory) {
argument += 'folder ';
} else {
argument += 'file ';
if (saveFile) {
argument += 'name ';
if (fileName.isNotEmpty) {
argument += 'default name "$fileName" ';
}
} else {
if (fileFilter.isNotEmpty) {
argument += 'of type {$fileFilter} ';
}
if (multipleFiles) {
argument += 'with multiple selections allowed ';
}
}
}
if (initialDirectory.isNotEmpty) {
argument += 'default location "$initialDirectory" ';
}
argument += 'with prompt "$dialogTitle"';
arguments.add(argument);
return arguments;
}