pickFile method

Future<AttachmentResult?> pickFile({
  1. bool photosOnly = false,
})

Launches the device file picker to select any document or file.

Implementation

Future<AttachmentResult?> pickFile({bool photosOnly = false}) async {
  try {
    final String? path = await _channel.invokeMethod('pickFile', {
      'photosOnly': photosOnly,
    });
    if (path != null) {
      return _resultFromPath(path);
    }
    return null;
  } catch (e) {
    debugPrint('PixelToPdfService: pickFile error: $e');
    return null;
  }
}