pickFiles static method

Future<List<XFile>?> pickFiles({
  1. List<String>? allowedExtensions,
})

Implementation

static Future<List<XFile>?> pickFiles({
  List<String>? allowedExtensions,
}) async {
  FilePickerResult? result = await FilePicker.platform.pickFiles(
    allowMultiple: true,
    allowedExtensions: allowedExtensions,
  );

  if (result != null) {
    return result.files.map((e) => XFile(e.path!)).toList();
  }
  return null;
}