openFiles method
Opens a file dialog for loading files and returns a list of file paths.
Returns an empty list if the user cancels the operation.
Implementation
@override
Future<List<XFile>> openFiles({
List<XTypeGroup>? acceptedTypeGroups,
String? initialDirectory,
String? confirmButtonText,
}) async {
final FileDialogResult result = await _hostApi.showOpenDialog(
SelectionOptions(
allowMultiple: true,
selectFolders: false,
allowedTypes: _typeGroupsFromXTypeGroups(acceptedTypeGroups),
),
initialDirectory,
confirmButtonText);
return result.paths.map((String? path) => XFile(path!)).toList();
}