plus_plugins icon indicating copy to clipboard operation
plus_plugins copied to clipboard

[Bug]:

Open hoanganhnth opened this issue 1 year ago • 0 comments

Platform

Android 10

Plugin

share_plus

Version

^8.0.3

Flutter SDK

3.22.1

Steps to reproduce

Crash app on android when transfer file image

image

Code Sample

final result = await ShareUtils.shareFiles(
      [File("$directory/screenshot.png").path],
      subject: "Chia sẻ", 

s ShareUtils {
  static Future<void> share(
    String text, {
    String? subject,
    Rect? sharePositionOrigin,
  }) async {
    final result = await Share.share(text,
        subject: subject, sharePositionOrigin: sharePositionOrigin);
    // AppAnalyticService.share
    //     .logShareEvent(method: result.raw, contentType: 'text', itemId: text);
    return;
  }

  static Future<void> shareFiles(
    List<String> paths, {
    List<String>? mimeTypes,
    String? subject,
    String? text,
    Rect? sharePositionOrigin,
  }) async {
    final result = await Share.shareXFiles([
      XFile(
        paths[0],
      )
    ], subject: subject, text: text, sharePositionOrigin: sharePositionOrigin);
    // AppAnalyticService.share.logShareEvent(
    //     method: result.raw, contentType: 'image', itemId: paths.first);
    return;
  }
}

Logs

d

Flutter Doctor

flutter doctor -v

Checklist before submitting a bug

  • [X] I searched issues in this repository and couldn't find such bug/problem
  • [X] I Google'd a solution and I couldn't find it
  • [X] I searched on StackOverflow for a solution and I couldn't find it
  • [X] I read the README.md file of the plugin
  • [X] I'm using the latest version of the plugin
  • [X] All dependencies are up to date with flutter pub upgrade
  • [X] I did a flutter clean
  • [X] I tried running the example project

hoanganhnth avatar Jun 05 '24 09:06 hoanganhnth