@@ -108,33 +108,33 @@ android { | |||||
// 应用信息配置 | // 应用信息配置 | ||||
productFlavors { | |||||
// 智夜生活 | |||||
zhiying { | |||||
applicationId "cn.zhios.zhiying" | |||||
versionCode 39 | |||||
dimension "app" | |||||
versionName '1.2.39' | |||||
// 签名信息 | |||||
signingConfig signingConfigs.zhiying | |||||
} | |||||
} | |||||
// 打包脚本 | |||||
android.applicationVariants.all { variant -> | |||||
if (variant.buildType.name != "debug") { | |||||
variant.getPackageApplicationProvider().get().outputDirectory = new File(project.rootDir.absolutePath + "/app/build/outputs/apk") | |||||
} | |||||
variant.outputs.all { output -> | |||||
def outputFile = output.outputFile | |||||
if (outputFile != null && outputFile.name.endsWith('.apk')) { | |||||
//这里修改apk文件名 | |||||
def fileName = "${variant.productFlavors[0].name}_${releaseTime()}01_&V${variant.productFlavors[0].versionCode}.apk" | |||||
outputFileName = fileName | |||||
} | |||||
} | |||||
} | |||||
// productFlavors { | |||||
// // 智夜生活 | |||||
// zhiying { | |||||
// applicationId "cn.zhios.zhiying" | |||||
// versionCode 39 | |||||
// dimension "app" | |||||
// versionName '1.2.39' | |||||
// // 签名信息 | |||||
// signingConfig signingConfigs.zhiying | |||||
// } | |||||
// } | |||||
// | |||||
// // 打包脚本 | |||||
// android.applicationVariants.all { variant -> | |||||
// if (variant.buildType.name != "debug") { | |||||
// variant.getPackageApplicationProvider().get().outputDirectory = new File(project.rootDir.absolutePath + "/app/build/outputs/apk") | |||||
// } | |||||
// | |||||
// variant.outputs.all { output -> | |||||
// def outputFile = output.outputFile | |||||
// if (outputFile != null && outputFile.name.endsWith('.apk')) { | |||||
// //这里修改apk文件名 | |||||
// def fileName = "${variant.productFlavors[0].name}_${releaseTime()}01_&V${variant.productFlavors[0].versionCode}.apk" | |||||
// outputFileName = fileName | |||||
// } | |||||
// } | |||||
// } | |||||
configurations.all { | configurations.all { | ||||
resolutionStrategy.eachDependency { DependencyResolveDetails details -> | resolutionStrategy.eachDependency { DependencyResolveDetails details -> | ||||
@@ -24,13 +24,20 @@ | |||||
<uses-feature android:name="android.hardware.camera" /> | <uses-feature android:name="android.hardware.camera" /> | ||||
<uses-feature android:name="android.hardware.camera.autofocus" /> | <uses-feature android:name="android.hardware.camera.autofocus" /> | ||||
<uses-permission android:name="android.permission.INTERNET" /> | |||||
<!-- Permissions options for the `ignoreBatteryOptimizations` group --> | |||||
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" /> | |||||
<application | <application | ||||
android:name="cn.zhios.zhiying_base_widget_example.MyFlutterApplication" | android:name="cn.zhios.zhiying_base_widget_example.MyFlutterApplication" | ||||
android:allowBackup="true" | |||||
android:icon="@mipmap/ic_launcher" | android:icon="@mipmap/ic_launcher" | ||||
android:label="@string/app_name" | android:label="@string/app_name" | ||||
android:allowBackup="true" | |||||
android:usesCleartextTraffic="true" | android:usesCleartextTraffic="true" | ||||
tools:replace="android:name, android:allowBackup"> | tools:replace="android:name, android:allowBackup"> | ||||
<activity | <activity | ||||
android:name=".MainActivity" | android:name=".MainActivity" | ||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" | android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" | ||||
@@ -61,6 +68,18 @@ | |||||
<meta-data | <meta-data | ||||
android:name="flutterEmbedding" | android:name="flutterEmbedding" | ||||
android:value="2" /> | android:value="2" /> | ||||
<provider | |||||
android:name="androidx.core.content.FileProvider" | |||||
android:authorities="com.zhiying.demo.fileprovider" | |||||
android:exported="false" | |||||
android:grantUriPermissions="true"> | |||||
<meta-data | |||||
android:name="android.support.FILE_PROVIDER_PATHS" | |||||
android:resource="@xml/zhiying_file_path" /> | |||||
</provider> | |||||
</application> | </application> | ||||
</manifest> | </manifest> |
@@ -0,0 +1,3 @@ | |||||
<paths xmlns:android="http://schemas.android.com/apk/res/android"> | |||||
<files-path name="my_images" path="cache/"/> | |||||
</paths> |
@@ -144,4 +144,12 @@ class _DefaultCupertinoLocalizations extends CupertinoLocalizations { | |||||
@override | @override | ||||
String get todayLabel => "今天"; | String get todayLabel => "今天"; | ||||
@override | |||||
// TODO: implement modalBarrierDismissLabel | |||||
String get modalBarrierDismissLabel => "关闭"; | |||||
@override | |||||
String tabSemanticsLabel({int tabIndex, int tabCount}) { | |||||
} | |||||
} | } |
@@ -38,7 +38,7 @@ dev_dependencies: | |||||
zhiying_moments: | zhiying_moments: | ||||
#path: ../zhiying_moments | #path: ../zhiying_moments | ||||
git: | git: | ||||
ref: 0.1.0 | |||||
ref: 0.1.1 | |||||
url: http://192.168.0.138:3000/FnuoOS_ZhiYing/zhiying_moments.git | url: http://192.168.0.138:3000/FnuoOS_ZhiYing/zhiying_moments.git | ||||
# For information on the generic Dart part of this file, see the | # For information on the generic Dart part of this file, see the | ||||
@@ -6,6 +6,7 @@ import 'dart:ui'; | |||||
import 'package:cached_network_image/cached_network_image.dart'; | import 'package:cached_network_image/cached_network_image.dart'; | ||||
import 'package:flutter/material.dart'; | import 'package:flutter/material.dart'; | ||||
import 'package:fluttertoast/fluttertoast.dart'; | import 'package:fluttertoast/fluttertoast.dart'; | ||||
import 'package:more_picture_share/more_picture_share.dart'; | |||||
import 'package:path_provider/path_provider.dart'; | import 'package:path_provider/path_provider.dart'; | ||||
import 'package:permission_handler/permission_handler.dart'; | import 'package:permission_handler/permission_handler.dart'; | ||||
import 'package:share_extend/share_extend.dart'; | import 'package:share_extend/share_extend.dart'; | ||||
@@ -17,6 +18,7 @@ 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_base_widget/widgets/share/share_alert_content.dart'; | import 'package:zhiying_base_widget/widgets/share/share_alert_content.dart'; | ||||
import 'package:zhiying_comm/zhiying_comm.dart'; | import 'package:zhiying_comm/zhiying_comm.dart'; | ||||
import 'dart:io'; | |||||
class ShareAlert extends StatefulWidget { | class ShareAlert extends StatefulWidget { | ||||
final String skipIdentifier; | final String skipIdentifier; | ||||
@@ -202,7 +204,16 @@ class _ShareAlertContentState extends State<_ShareAlertContent> { | |||||
print(status); | print(status); | ||||
return; | return; | ||||
} | } | ||||
int count = 0; | |||||
if (widget.model.poster != null) { | |||||
count++; | |||||
} | |||||
count += (widget.model?.image?.length ?? 0); | |||||
// 多图分享 | |||||
if (count > 1) { | |||||
_shareMultipleImages(item.type); | |||||
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') { | ||||
@@ -214,7 +225,7 @@ class _ShareAlertContentState extends State<_ShareAlertContent> { | |||||
} else if (item.type == 'weibo') { | } else if (item.type == 'weibo') { | ||||
_shareByMob(ShareSDKPlatforms.sina); | _shareByMob(ShareSDKPlatforms.sina); | ||||
} else if (item.type == 'more_setting') { | } else if (item.type == 'more_setting') { | ||||
_shareBySystem(); | |||||
_shareBySystem(item.type); | |||||
} | } | ||||
}, | }, | ||||
); | ); | ||||
@@ -222,16 +233,8 @@ class _ShareAlertContentState extends State<_ShareAlertContent> { | |||||
// mob分享,只能单图分享,多图分享调用系统分享 | // mob分享,只能单图分享,多图分享调用系统分享 | ||||
void _shareByMob(ShareSDKPlatform plateform) async { | void _shareByMob(ShareSDKPlatform plateform) async { | ||||
int count = 0; | |||||
if (widget.model.poster != null) { | |||||
count++; | |||||
} | |||||
count += (widget.model?.image?.length ?? 0); | |||||
// 多图分享 | |||||
if (count > 1) { | |||||
_shareMultipleImages(); | |||||
return; | |||||
} | |||||
Loading.show(context); | Loading.show(context); | ||||
Timer(Duration(milliseconds: 2000),(){ | Timer(Duration(milliseconds: 2000),(){ | ||||
@@ -303,7 +306,7 @@ class _ShareAlertContentState extends State<_ShareAlertContent> { | |||||
} | } | ||||
// 系统分享,只能分享图片或者文字,不能组合分享 | // 系统分享,只能分享图片或者文字,不能组合分享 | ||||
void _shareBySystem() async { | |||||
void _shareBySystem(String type) async { | |||||
int count = 0; | int count = 0; | ||||
if (widget.model.poster != null) { | if (widget.model.poster != null) { | ||||
count++; | count++; | ||||
@@ -311,7 +314,7 @@ class _ShareAlertContentState extends State<_ShareAlertContent> { | |||||
count += (widget.model?.image?.length ?? 0); | count += (widget.model?.image?.length ?? 0); | ||||
// 多图分享 | // 多图分享 | ||||
if (count > 1) { | if (count > 1) { | ||||
_shareMultipleImages(); | |||||
_shareMultipleImages(type); | |||||
return; | return; | ||||
} | } | ||||
@@ -341,7 +344,7 @@ class _ShareAlertContentState extends State<_ShareAlertContent> { | |||||
try { | try { | ||||
// 保存到本地路径 | // 保存到本地路径 | ||||
final tempDir = await getTemporaryDirectory(); | final tempDir = await getTemporaryDirectory(); | ||||
final file = await File('${tempDir.path}/image.jpg').create(); | |||||
final file = await File('${tempDir.path}/image.png').create(); | |||||
file.writeAsBytesSync(widget.model.poster); | file.writeAsBytesSync(widget.model.poster); | ||||
path = file.path; | path = file.path; | ||||
@@ -356,17 +359,20 @@ class _ShareAlertContentState extends State<_ShareAlertContent> { | |||||
} | } | ||||
// 多图分享,调用系统分享 | // 多图分享,调用系统分享 | ||||
void _shareMultipleImages() async { | |||||
void _shareMultipleImages(String type) async { | |||||
List<String> paths = List(); | List<String> paths = List(); | ||||
String path = await _savePoster(); | String path = await _savePoster(); | ||||
if (path != null && path != '') { | if (path != null && path != '') { | ||||
paths.add(path); | paths.add(path); | ||||
} | } | ||||
Loading.show(context); | Loading.show(context); | ||||
List<String> downPaths = await ImageDownloadUtil.download(widget.model.image); | List<String> downPaths = await ImageDownloadUtil.download(widget.model.image); | ||||
paths.addAll(downPaths); | paths.addAll(downPaths); | ||||
ShareExtend.shareMultiple(paths, "image", subject: ""); | |||||
if(Platform.isAndroid&&type=='wx'){ | |||||
MorePictureShare.shareWeixinPics(paths); | |||||
}else{ | |||||
ShareExtend.shareMultiple(paths, "image", subject: ""); | |||||
} | |||||
Loading.dismiss(); | Loading.dismiss(); | ||||
} | } | ||||
} | } |
@@ -14,7 +14,8 @@ dependencies: | |||||
flutter_swiper: ^1.1.6 | flutter_swiper: ^1.1.6 | ||||
bloc: ^4.0.0 | bloc: ^4.0.0 | ||||
event_bus: ^1.1.1 | event_bus: ^1.1.1 | ||||
pull_to_refresh: ^1.6.1 | |||||
pull_to_refresh: | |||||
path: ../../1.22.0_master/flutter_pulltorefresh | |||||
flutter_cupertino_date_picker: | flutter_cupertino_date_picker: | ||||
path: ../../1.22.0_master/flutter-cupertino-date-picker | path: ../../1.22.0_master/flutter-cupertino-date-picker | ||||
image_picker: ^0.6.7+3 | image_picker: ^0.6.7+3 | ||||
@@ -39,6 +40,8 @@ dependencies: | |||||
ref: 0.0.1 | ref: 0.0.1 | ||||
url: http://192.168.0.138:3000/FnuoOS_Flutter_Components/permission_handler.git | url: http://192.168.0.138:3000/FnuoOS_Flutter_Components/permission_handler.git | ||||
more_picture_share: | |||||
path: ../more_picture_share | |||||
intl: 0.16.1 | intl: 0.16.1 | ||||