Skip to content

Share plugin: share more than text #19607

Closed

Description

@modulovalue

There is a flutter plugin for sharing text.

Official 'Share plugin'

What's missing is the ability to share files with specific MIME types (e.g. image/png)

#7111 was supposed to track the progress on this.

Related issues:
#9817 #9817 #15790 #16743

In a nutshell:

The Share plugin should provide a way to share more than text.

Edit:
Check out the esys-flutter-share plugin if you want to share images.

Activity

  1. changed the title [-]Share plugin: Share more than text[/-] [+]Share plugin: share more than text[/+] on Jul 20, 2018
  2. added this to the milestone on Jul 20, 2018
  3. pablote commented on Aug 3, 2018

    @pablote

    I'd really need this to share files. There's a bunch of unofficial libs around but they don't work very well. Seems like a key piece of functionality that shouldn't be missing.

  4. zoechi commented on Dec 6, 2018

    @zoechi
    Contributor

    Duplicate of #9817

    I'm closing this because the other has more discussion.
    There is also a community plugin available now.

  5. modulovalue commented on Dec 6, 2018

    @modulovalue
    Author

    @zoechi This is not a duplicate. #9817 is (only) about sharing images. I think this is such an essential feature and should be supported by an official flutter plugin.

    There is no ambiguity or multiple interpretations of this feature. Android and iOS support it natively therefore flutter should also do that.

  6. zoechi commented on Dec 6, 2018

    @zoechi
    Contributor

    I don't think there is much difference once you are beyond sharing text.
    But of course we can keep this more generic issue open as well.

  7. reopened this on Dec 6, 2018
  8. zoechi commented on Dec 6, 2018

    @zoechi
    Contributor

    Did you check the plugin mentioned in #9817?

  9. modulovalue commented on Dec 6, 2018

    @modulovalue
    Author

    Yes and unfortunately it's only for text & images. I've added a link to it in the issue description.

  10. pboos commented on Dec 7, 2018

    @pboos

    For those interested, I just created a pull request that adds file sharing to the share plugin for both ios and android.

    flutter-team-archive/plugins#970

  11. 22 remaining items

  12. steve28100 commented on Apr 22, 2020

    @steve28100

    You can share images with this plugin.

    dependencies:
      esys_flutter_share: ^1.0.1
    

    import 'package:esys_flutter_share/esys_flutter_share.dart';
    ``
    Share file:

    final ByteData bytes = await rootBundle.load('assets/image1.png');
    await Share.file('esys image', 'esys.png', bytes.buffer.asUint8List(), 'image/png');
    

    Share file from url:

    var request = await HttpClient().getUrl(Uri.parse('https://shop.esys.eu/media/image/6f/8f/af/amlog_transport-berwachung.jpg'));
    var response = await request.close();
    Uint8List bytes = await consolidateHttpClientResponseBytes(response);
    await Share.file('ESYS AMLOG', 'amlog.jpg', bytes, 'image/jpg');
    

    read more at
    https://pub.dev/packages/esys_flutter_share#-readme-tab-

    The problem is

    This plugin is maintained by flutter.
    But the one you told was from someone else. The plugin has some bugs in android 10 and some different models. I have samsung it is not working. The plugin was last updated on 2019.

    Right that library also have problem when sharing image and text in IOS also it seems not updated anymore. Is there any solution that we can use for share both image and text?

  13. Gulnur1 commented on May 28, 2020

    @Gulnur1
  14. added
    P3Issues that are less important to the Flutter project
    on May 29, 2020
  15. li8607 commented on Jul 9, 2020

    @li8607
  16. removed this from the milestone on Aug 17, 2020
  17. GManzke commented on Aug 28, 2020

    @GManzke

    Was fixed today!! 👏👏👏👏👏🏆🏆🏆🏆

    Share pub link

  18. iapicca commented on Aug 30, 2020

    @iapicca
  19. TahaTesser commented on Aug 31, 2020

    @TahaTesser
    Contributor

    Thanks @GManzke @iapicca
    Closing as fixed. If you disagree, please write in the comments and I will reopen it.
    Thank you

  20. ceosss commented on May 17, 2021

    @ceosss

    Hey @TahaTesser ,
    I'm using this share plugin by flutter.
    And I'm trying to share an image as well as text,
    but only text gets shared while sharing on Whatsapp.
    Here is the code.

    Future<void> shareApp({@required String referralCode}) async {
    
      final ByteData bytes = await rootBundle.load('assets/images/share.jpg');
    
      final Uint8List list = bytes.buffer.asUint8List();
    
      final tempDir = await getTemporaryDirectory();
    
      final file = await new File('${tempDir.path}/image.jpg').create();
    
      file.writeAsBytesSync(list);
    
      Share.shareFiles(
        ['${tempDir.path}/image.jpg'],
        text:
            "Hey! Download the app and use this referral code $referralCode.",
      );
    
    }
    
  21. TahaTesser commented on May 18, 2021

    @TahaTesser
    Contributor

    @ceosss
    Please file a new issue with the details

  22. samuelprogmattic commented on Jun 3, 2021

    @samuelprogmattic

    ar response = await request.close();
    Uint8List bytes = await consolidateHttpClientResponseBytes(response);
    await Share.file('ESYS AMLOG', 'amlog.jpg', bytes, 'image/jpg');

    i also want to share text as well with image how to that

  23. github-actions commented on Jul 31, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  24. locked as resolved and limited conversation to collaborators on Jul 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilitycustomer: crowdAffects or could affect many people, though not necessarily a specific customer.p: shareThe Share pluginpackageflutter/packages repository. See also p: labels.waiting for PR to land (fixed)A fix is in flightwould be a good packageSeparate Flutter package should be made for this

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions