flutter_apopen 0.0.6

Flutter Android iOS

A Flutter plugin for AliPay SocialSDK to Share.

official documents #

Before use Apopen,please read the official documents.

support #

  • Share Text
  • Share ImageUrl
  • Share Image with UInt8List(byte[])
  • Share WebPage(ImageUrl)
  • Share WebPage(Image with UInt8List(byte[]))

Dependencies #

Add the following dependencies in your pubspec.yaml file:

dependencies:
  flutter_apopen: ^${latestVersion}

Register ApOpenSDK via flutter_apopen #

    import 'package:flutter_apopen/flutter_apopen.dart' as apopen;
    apopen.registerAP(appId: "2019111369123863");

Share #

ShareText #

  void shareText() async {
    var result = await apopen.shareText('This is a Share Text');
    print(result);
  } 

ShareText #

  void shareText() async {
    var result = await apopen.shareText('This is a Share Text');
    print(result);
  } 

ShareImageUrl #

  void shareImageUrl() async{
    var result = await apopen.shareImageUrl('http://XXX.jpg');
    print(result);
  }

ShareImageData #

  void shareImageData() async{
    String assetPath = 'images/test.png';
    ByteData byteData = await rootBundle.load(assetPath);
    Uint8List pngBytes = byteData.buffer.asUint8List();

    var result = await apopen.shareImageData(pngBytes);
    print(result);
  }

ShareWebWithImageData #

    void shareWebWithImageData() async{
      String assetPath = 'images/test.png';
      ByteData byteData = await rootBundle.load(assetPath);
      Uint8List pngBytes = byteData.buffer.asUint8List();

      var result = await apopen.shareWebAndImgData(
        imageData: pngBytes,
        wepageUrl: 'https://www.XXX.com',
        title: 'Text Title',
        desc: 'Text desc',
        );
      print(result);    
    }

ShareWebWithImageUrl #

    void shareWebWithImageUrl() async{
      var result = await apopen.shareWebAndImgUrl(
        imageUrl: 'http://XXX.jpg',
        wepageUrl: 'https://www.XXX.com',
        title: 'Text Title',
        desc: 'Text desc',
        );
      print(result);
    }    
1
likes
70
pub points
0%
popularity

A Flutter plugin for AliPay SocialSDK to Share.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

devsun.965@gmail.com

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_apopen