@@ -325,6 +325,18 @@ | |||||
"packageUri": "lib/", | "packageUri": "lib/", | ||||
"languageVersion": "2.1" | "languageVersion": "2.1" | ||||
}, | }, | ||||
{ | |||||
"name": "permission_handler", | |||||
"rootUri": "file:///Users/fnuser/.pub-cache/git/permission_handler-b8c45c4c20221ac39fe083113fc360cc632f33a4/", | |||||
"packageUri": "lib/", | |||||
"languageVersion": "2.7" | |||||
}, | |||||
{ | |||||
"name": "permission_handler_platform_interface", | |||||
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/permission_handler_platform_interface-2.0.1", | |||||
"packageUri": "lib/", | |||||
"languageVersion": "2.6" | |||||
}, | |||||
{ | { | ||||
"name": "petitparser", | "name": "petitparser", | ||||
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/petitparser-2.4.0", | "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/petitparser-2.4.0", | ||||
@@ -602,7 +614,7 @@ | |||||
"languageVersion": "2.1" | "languageVersion": "2.1" | ||||
} | } | ||||
], | ], | ||||
"generated": "2020-09-29T09:31:08.197502Z", | |||||
"generated": "2020-09-30T07:04:49.977484Z", | |||||
"generator": "pub", | "generator": "pub", | ||||
"generatorVersion": "2.7.2" | "generatorVersion": "2.7.2" | ||||
} | } |
@@ -1,3 +1,5 @@ | |||||
// 添加插件 | |||||
def localProperties = new Properties() | def localProperties = new Properties() | ||||
def localPropertiesFile = rootProject.file('local.properties') | def localPropertiesFile = rootProject.file('local.properties') | ||||
if (localPropertiesFile.exists()) { | if (localPropertiesFile.exists()) { | ||||
@@ -59,3 +61,88 @@ dependencies { | |||||
androidTestImplementation 'androidx.test:runner:1.1.1' | androidTestImplementation 'androidx.test:runner:1.1.1' | ||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' | ||||
} | } | ||||
// 注册SecVerify的相关信息 | |||||
//MobSDK { | |||||
//// appKey "2ed488d929488" | |||||
//// appSecret "53d4a16298d283828f2444cdd6d6548a" | |||||
// //手机验证登录 | |||||
// SecVerify {} | |||||
// | |||||
// //短信 | |||||
// SMSSDK {} | |||||
// | |||||
// //调用MobPush,推送 | |||||
//// MobPush { | |||||
//// //设置角标开关(不需要可不设置) | |||||
////// badge true | |||||
//// //集成其他推送通道(可选) | |||||
//// devInfo { | |||||
//// //华为推送配置信息 | |||||
//// HUAWEI { | |||||
//// appId "${HUAWEI_PUSH_ID}" | |||||
//// } | |||||
//// //魅族推送配置信息 | |||||
//// MEIZU { | |||||
//// appId "${MEIZHU_PUSH_APPID}" | |||||
//// appKey "${MEIZHU_PUSH_APPKEY}" | |||||
//// } | |||||
//// //小米推送配置信息 | |||||
//// XIAOMI { | |||||
//// appId "${XIAOMI_PUSH_APPID}" | |||||
//// appKey "${XIAOMI_PUSH_APPKEY}" | |||||
//// } | |||||
//// //FCM推送通道配置 | |||||
////// FCM { | |||||
//// //设置默认推送通知显示图标 | |||||
////// iconRes "@mipmap/ic_launcher" | |||||
////// } | |||||
//// //OPPO推送配置信息 | |||||
//// OPPO { | |||||
//// appKey "${OPPO_PUSH_APPKEY}" | |||||
//// appSecret "${OPPO_PUSH_APPSECRET}" | |||||
//// } | |||||
//// //VIVO推送配置信息 | |||||
//// VIVO { | |||||
//// appId "${VIVO_PUSH_APPID}" | |||||
//// appKey "${VIVO_PUSH_APPKEY}" | |||||
//// } | |||||
//// } | |||||
//// } | |||||
// | |||||
// //分享 | |||||
// ShareSDK { | |||||
// loopShare true | |||||
// devInfo { | |||||
// SinaWeibo { | |||||
// enable true | |||||
// } | |||||
// Wechat { | |||||
//// appId "${Wechat_appid}" | |||||
//// appSecret "${Wechat_appSecret}" | |||||
// enable true | |||||
// withShareTicket true | |||||
// bypassApproval false | |||||
// } | |||||
// QQ { | |||||
// enable true | |||||
// } | |||||
// WechatMoments { | |||||
// enable true | |||||
// } | |||||
// WechatFavorite { | |||||
// enable true | |||||
// } | |||||
// QZone { | |||||
// enable true | |||||
// } | |||||
// } | |||||
// } | |||||
// | |||||
// //网页打开app,接受邀请码 | |||||
// MobLink { | |||||
//// uriScheme "${uri_Scheme}" | |||||
//// appLinkHost "${app_LinkHost}" | |||||
// } | |||||
//} |
@@ -29,4 +29,7 @@ | |||||
android:name="flutterEmbedding" | android:name="flutterEmbedding" | ||||
android:value="2" /> | android:value="2" /> | ||||
</application> | </application> | ||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> | |||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | |||||
</manifest> | </manifest> |
@@ -6,6 +6,8 @@ buildscript { | |||||
dependencies { | dependencies { | ||||
classpath 'com.android.tools.build:gradle:3.5.0' | classpath 'com.android.tools.build:gradle:3.5.0' | ||||
classpath "com.mob.sdk:MobSDK:2018.0319.1724" | |||||
} | } | ||||
} | } | ||||
@@ -10,6 +10,8 @@ import 'package:zhiying_base_widget/widgets/share/models/share_data_model.dart'; | |||||
import 'package:zhiying_base_widget/widgets/share/models/share_icon_model.dart'; | import 'package:zhiying_base_widget/widgets/share/models/share_icon_model.dart'; | ||||
import 'package:zhiying_comm/zhiying_comm.dart'; | import 'package:zhiying_comm/zhiying_comm.dart'; | ||||
import 'package:permission_handler/permission_handler.dart'; | |||||
class ShareAlert extends StatelessWidget { | class ShareAlert extends StatelessWidget { | ||||
final String skipIdentifier; | final String skipIdentifier; | ||||
final Widget child; | final Widget child; | ||||
@@ -62,10 +64,10 @@ class _ShareAlertContentState extends State<_ShareAlertContent> { | |||||
void initState() { | void initState() { | ||||
NetUtil.request('/api/v1/mod/${widget.skipIdentifier}', | NetUtil.request('/api/v1/mod/${widget.skipIdentifier}', | ||||
method: NetMethod.GET, onCache: (data) { | method: NetMethod.GET, onCache: (data) { | ||||
_parseData(data); | |||||
}, onSuccess: (data) { | |||||
_parseData(data); | |||||
}, onError: (err) {}); | |||||
_parseData(data); | |||||
}, onSuccess: (data) { | |||||
_parseData(data); | |||||
}, onError: (err) {}); | |||||
super.initState(); | super.initState(); | ||||
} | } | ||||
@@ -117,7 +119,7 @@ class _ShareAlertContentState extends State<_ShareAlertContent> { | |||||
), | ), | ||||
Container( | Container( | ||||
margin: | margin: | ||||
EdgeInsets.only(left: 12, right: 12, top: 10, bottom: 10), | |||||
EdgeInsets.only(left: 12, right: 12, top: 10, bottom: 10), | |||||
child: _createIcons(), | child: _createIcons(), | ||||
), | ), | ||||
GestureDetector( | GestureDetector( | ||||
@@ -186,6 +188,14 @@ class _ShareAlertContentState extends State<_ShareAlertContent> { | |||||
), | ), | ||||
), | ), | ||||
onTap: () { | onTap: () { | ||||
//检查是否有存储权限 | |||||
var status = await Permission.storage.status; | |||||
if (!status.isGranted) { | |||||
status = await Permission.storage.request(); | |||||
print(status); | |||||
return; | |||||
} | |||||
if (item.type == 'wx') { | if (item.type == 'wx') { | ||||
_shareByMob(ShareSDKPlatforms.wechatSession); | _shareByMob(ShareSDKPlatforms.wechatSession); | ||||
} else if (item.type == 'pyq') { | } else if (item.type == 'pyq') { | ||||
@@ -32,6 +32,11 @@ dependencies: | |||||
#字符检测 | #字符检测 | ||||
string_validator: 0.1.4 | string_validator: 0.1.4 | ||||
intl: 0.15.7 | intl: 0.15.7 | ||||
permission_handler: | |||||
git: | |||||
ref: 0.0.1 | |||||
url: http://192.168.0.138:3000/FnuoOS_Flutter_Components/permission_handler.git | |||||
zhiying_comm: | zhiying_comm: | ||||
path: ../zhiying_comm | path: ../zhiying_comm | ||||