shareFilesWithResult static method

  1. @Deprecated("Use shareXFiles instead.")
Future<ShareResult> shareFilesWithResult(
  1. List<String> paths, {
  2. List<String>? mimeTypes,
  3. String? subject,
  4. String? text,
  5. Rect? sharePositionOrigin,
})

Behaves exactly like shareFiles while providing feedback on how the user interacted with the share-sheet. Until the returned future is completed, any other call to any share method that returns a result might result in a PlatformException (on Android).

Because IOS, Android and macOS provide different feedback on share-sheet interaction, a result on IOS will be more specific than on Android or macOS. While on IOS the selected action can inform its caller that it was completed or dismissed midway (actions are free to return whatever they want), Android and macOS only record if the user selected an action or outright dismissed the share-sheet. It is not guaranteed that the user actually shared something.

Currently only implemented on IOS, Android and macOS.

Will gracefully fall back to the non result variant if not implemented for the current environment and return ShareResult.unavailable.

Implementation

@Deprecated("Use shareXFiles instead.")
static Future<ShareResult> shareFilesWithResult(
  List<String> paths, {
  List<String>? mimeTypes,
  String? subject,
  String? text,
  Rect? sharePositionOrigin,
}) async {
  assert(paths.isNotEmpty);
  assert(paths.every((element) => element.isNotEmpty));
  return _platform.shareFilesWithResult(
    paths,
    mimeTypes: mimeTypes,
    subject: subject,
    text: text,
    sharePositionOrigin: sharePositionOrigin,
  );
}