exportToStorage method

Future<String?> exportToStorage(
  1. {String? subject,
  2. String? text,
  3. Rect? sharePositionOrigin,
  4. String? fileName,
  5. bool share = true}
)

Export the file to the external storage. This shows a file dialog allowing to select the file name and location and will return the finally selected, absolute path to the file.

The optional subject parameter can be used to populate a subject if the user chooses to send an email on Android or iOS.

The optional sharePositionOrigin parameter can be used to specify a global origin rect for the share sheet to popover from on iPads. It has no effect on non-iPads.

The optional share parameter indicates whether Android shows a share dialog or a save as dialog.

Implementation

Future<String?> exportToStorage({
  String? subject,
  String? text,
  Rect? sharePositionOrigin,
  String? fileName,
  bool share = true,
}) {
  assert(
      fileName != null || this.fileName != null,
      'You nether provided a file name nor an original file name could be'
      'found for the path. You probably created a FilePickerCross from'
      'an Uint8List and tried to export it without providing a file name.');
  return exportToExternalStorage(
    bytes: toUint8List(),
    fileName: fileName ?? this.fileName!,
    subject: subject,
    text: text,
    sharePositionOrigin: sharePositionOrigin,
    share: share,
  );
}