ddshare_fluttify 0.1.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 58

钉钉分享组件 #

DingTalk Share plugin, developed based on the fluttify engine. Supports both Android and IOS, text sharing, picture sharing, web page sharing. 钉钉分享的Flutter插件,同时支持Android和IOS。支持检测、分享文本、分享图片、分享网页。

安装: #

dependencies:
  flutter:
    sdk: flutter
  ddshare_fluttify: ^0.1.0

导入: #

import 'package:ddshare_fluttify/ddshare_fluttify.dart';

配置 #

ios端 #

  1. 在Other Linker Flags添加 -all_load 选项;

  1. 将申请的appId添加到URL Types中作为钉钉回调的scheme, identifier 填写dingtalk; URL Schemes填写申请的AppId。 iOS9及以后的系统需要将钉钉和分享SDK的scheme配置在Info.plist。LSApplicationQueriesSchemes列表中,scheme分别为 dingtalk, dingtalk-open

Android端 #

暂不需要配置

高级配置,可参考钉钉官方文档 #

钉钉分享介入流程

使用 #

// 1. 初始化,前往钉钉开放平台申请
DDSharePlugin.init("dingoalgfg9lln5ltgtmwg");
// 2. 检测是否安装了钉钉
bool flag = await DDSharePlugin.isDDAppInstalled();
// 3. 检测是否支持分享到好友
bool flag = await DDSharePlugin.isDDSupportAPI();
// 4. 检测是都支持分享到Ding
bool flag = await DDSharePlugin.isDDSupportDingAPI();
// 5. 分享文本
DDSharePlugin.sendTextMessage("一个简单的文本分享");
// 6. 分享网络图片
DDSharePlugin.sendOnlineImage(picUrl);
// 7. 分享本地图片(仅支持Android)
File imageFile = File('图片的本地地址');
DDSharePlugin.sendLocalImage(image);
// 8. 分享网页
String url = "https://www.badu.com";
String title = "这是标题";
String content = "这里是分享的文本内容";
// 缩略图
String thumbUrl = "https://t.alipayobjects.com/images/rmsweb/T1vs0gXXhlXXXXXXXX.jpg";
await DDSharePlugin.sendWebPageMessage(url, title: title, content: content, thumbUrl: thumbUrl);

// 分享回调(仅Android)
DDSharePlugin.setCallback((int flag) {
if (flag == 1)
  showToast('分享成功!');
else if (flag == 0)
  showToast('取消分享!');
else
  showToast('分享失败!');
});

开源不易,老铁们多多支持,顺手点个赞也是支持!😃 #

image.pngimage.png

0.1.0 #

支持Flutter 1.12.13

0.0.1+3 #

钉钉分享的Flutter插件,同时支持Android和IOS。支持检测、分享文本、分享图片、分享网页。

0.0.1+2 #

修改说明

0.0.1+1 #

优化代码结构

0.0.1 #

首次发布,同时支持Android和IOS端分享

example/README.md

钉钉分享插件,支持Android和iOS #

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  ddshare_fluttify: ^0.1.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:ddshare_fluttify/ddshare_fluttify.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
36
Health:
Code health derived from static analysis. [more]
75
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
58
Learn more about scoring.

We analyzed this package on Jan 19, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4
  • Flutter: 1.12.13+hotfix.5

Health suggestions

Fix lib/src/android/object_factory.g.dart. (-13.09 points)

Analysis of lib/src/android/object_factory.g.dart reported 28 hints, including:

line 15 col 5: Name non-constant identifiers using lowerCamelCase.

line 28 col 5: Name non-constant identifiers using lowerCamelCase.

line 41 col 5: Name non-constant identifiers using lowerCamelCase.

line 53 col 5: Name non-constant identifiers using lowerCamelCase.

line 66 col 5: Name non-constant identifiers using lowerCamelCase.

Fix lib/src/android/com/android/dingtalk/share/ddsharemodule/DDShareApiV2.g.dart. (-4.89 points)

Analysis of lib/src/android/com/android/dingtalk/share/ddsharemodule/DDShareApiV2.g.dart reported 10 hints, including:

line 21 col 16: This method overrides a method annotated as @mustCallSuper in 'com_android_dingtalk_share_ddsharemodule_IDDShareApi', but doesn't invoke the overridden method.

line 44 col 16: This method overrides a method annotated as @mustCallSuper in 'com_android_dingtalk_share_ddsharemodule_IDDShareApi', but doesn't invoke the overridden method.

line 67 col 16: This method overrides a method annotated as @mustCallSuper in 'com_android_dingtalk_share_ddsharemodule_IDDShareApi', but doesn't invoke the overridden method.

line 90 col 16: This method overrides a method annotated as @mustCallSuper in 'com_android_dingtalk_share_ddsharemodule_IDDShareApi', but doesn't invoke the overridden method.

line 152 col 16: This method overrides a method annotated as @mustCallSuper in 'com_android_dingtalk_share_ddsharemodule_IDDShareApi', but doesn't invoke the overridden method.

Fix lib/src/android/com/android/dingtalk/share/ddsharemodule/message/DDAudioMessage.g.dart. (-2.48 points)

Analysis of lib/src/android/com/android/dingtalk/share/ddsharemodule/message/DDAudioMessage.g.dart reported 5 hints:

line 22 col 16: This method overrides a method annotated as @mustCallSuper in 'com_android_dingtalk_share_ddsharemodule_message_DDMediaMessage_IMediaObject', but doesn't invoke the overridden method.

line 45 col 16: This method overrides a method annotated as @mustCallSuper in 'com_android_dingtalk_share_ddsharemodule_message_DDMediaMessage_IMediaObject', but doesn't invoke the overridden method.

line 68 col 15: This method overrides a method annotated as @mustCallSuper in 'com_android_dingtalk_share_ddsharemodule_message_DDMediaMessage_IMediaObject', but doesn't invoke the overridden method.

line 91 col 16: This method overrides a method annotated as @mustCallSuper in 'com_android_dingtalk_share_ddsharemodule_message_DDMediaMessage_IMediaObject', but doesn't invoke the overridden method.

line 114 col 15: This method overrides a method annotated as @mustCallSuper in 'com_android_dingtalk_share_ddsharemodule_message_DDMediaMessage_IMediaObject', but doesn't invoke the overridden method.

Fix additional 7 files with analysis or formatting issues. (-14.88 points)

Additional issues in the following files:

  • lib/src/android/com/android/dingtalk/share/ddsharemodule/message/DDFileMessage.g.dart (5 hints)
  • lib/src/android/com/android/dingtalk/share/ddsharemodule/message/DDImageMessage.g.dart (5 hints)
  • lib/src/android/com/android/dingtalk/share/ddsharemodule/message/DDTextMessage.g.dart (5 hints)
  • lib/src/android/com/android/dingtalk/share/ddsharemodule/message/DDVideoMessage.g.dart (5 hints)
  • lib/src/android/com/android/dingtalk/share/ddsharemodule/message/DDWebpageMessage.g.dart (5 hints)
  • lib/src/android/com/android/dingtalk/share/ddsharemodule/message/DDZhiFuBaoMesseage.g.dart (5 hints)
  • lib/src/dart/ddshare.dart (Run flutter format to format lib/src/dart/ddshare.dart.)

Maintenance issues and suggestions

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (foundation_fluttify).

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.6.0 <3.0.0
flutter 0.0.0
foundation_fluttify ^0.3.0 0.3.0 0.4.6
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test