From cc936648dc53f9e5b2e814b3eb8fe1814b71dd13 Mon Sep 17 00:00:00 2001 From: jiahao <283739569@qq.com> Date: Thu, 26 Mar 2020 09:24:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E7=89=87=E5=8F=91=E9=80=81=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios/Flutter/flutter_export_environment.sh | 4 +-- ios/Podfile.lock | 6 ++++ ios/Runner.xcodeproj/project.pbxproj | 2 +- lib/chat/ChatPageItem.dart | 33 +++++++++++++-------- lib/chat/company_server_view.dart | 2 +- lib/chat/download_item.dart | 6 ++-- lib/chat/full_img_view.dart | 7 +++-- lib/chat/group_chat_item.dart | 36 +++++++++++++---------- lib/chat/input_bar.dart | 4 +-- lib/chat/util_keyboard.dart | 2 +- 10 files changed, 63 insertions(+), 39 deletions(-) diff --git a/ios/Flutter/flutter_export_environment.sh b/ios/Flutter/flutter_export_environment.sh index 4496333..ff59f0b 100755 --- a/ios/Flutter/flutter_export_environment.sh +++ b/ios/Flutter/flutter_export_environment.sh @@ -1,8 +1,8 @@ #!/bin/sh # This is a generated file; do not edit or check into version control. export "FLUTTER_ROOT=/Users/random/sdk/flutter_sdk" -export "FLUTTER_APPLICATION_PATH=/Users/random/code/flutter/project/qunliao" -export "FLUTTER_TARGET=/Users/random/code/flutter/project/qunliao/lib/main.dart" +export "FLUTTER_APPLICATION_PATH=/Users/random/code/flutter/project/Hibok" +export "FLUTTER_TARGET=/Users/random/code/flutter/project/Hibok/lib/main.dart" export "FLUTTER_BUILD_DIR=build" export "SYMROOT=${SOURCE_ROOT}/../build/ios" export "FLUTTER_FRAMEWORK_DIR=/Users/random/sdk/flutter_sdk/bin/cache/artifacts/engine/ios" diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 7e8bdbd..ebd70eb 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -127,6 +127,8 @@ PODS: - Flutter - share (0.5.2): - Flutter + - share_extend (0.0.1): + - Flutter - shared_preferences (0.0.1): - Flutter - shared_preferences_macos (0.0.1): @@ -189,6 +191,7 @@ DEPENDENCIES: - photo_manager (from `.symlinks/plugins/photo_manager/ios`) - receive_sharing_intent (from `.symlinks/plugins/receive_sharing_intent/ios`) - share (from `.symlinks/plugins/share/ios`) + - share_extend (from `.symlinks/plugins/share_extend/ios`) - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) - shared_preferences_macos (from `.symlinks/plugins/shared_preferences_macos/ios`) - shared_preferences_web (from `.symlinks/plugins/shared_preferences_web/ios`) @@ -298,6 +301,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/receive_sharing_intent/ios" share: :path: ".symlinks/plugins/share/ios" + share_extend: + :path: ".symlinks/plugins/share_extend/ios" shared_preferences: :path: ".symlinks/plugins/shared_preferences/ios" shared_preferences_macos: @@ -370,6 +375,7 @@ SPEC CHECKSUMS: Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 receive_sharing_intent: c0d87310754e74c0f9542947e7cbdf3a0335a3b1 share: bae0a282aab4483288913fc4dc0b935d4b491f2e + share_extend: b6748dc53695587891126a89533b862b92548c7b shared_preferences: 430726339841afefe5142b9c1f50cb6bd7793e01 shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087 shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 6a452f2..6ce8972 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -778,7 +778,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 12; - DEVELOPMENT_TEAM = QJ9M3998Q6; + DEVELOPMENT_TEAM = ""; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", diff --git a/lib/chat/ChatPageItem.dart b/lib/chat/ChatPageItem.dart index 4f06c4a..6e75478 100644 --- a/lib/chat/ChatPageItem.dart +++ b/lib/chat/ChatPageItem.dart @@ -1019,19 +1019,26 @@ class _ChatPageItemState extends State ImageProvider provider = MemoryImage(Uint8List.fromList(imgData)); var imgSize = _getImgSize(); - return GestureDetector( - child: Container( - width: imgSize.width, - height: imgSize.height, - child: ClipRRect( - child: Image( - image: provider ?? AssetImage(R.assetsImagesIcAlbum), - ), - borderRadius: BorderRadius.circular(5), - )), - onTap: () async { - showFullImg(context, widget.msg); - }); + + return DownloadItem( + isAutoDown: false, + msg: widget.msg, + onFinishTap: (){ + widget.hideKeyboard(); + showFullImg(context, widget.msg); + }, + child: Container( + width: imgSize.width, + height: imgSize.height, + child: ClipRRect( + child: Image( + image: provider ?? AssetImage(R.assetsImagesIcAlbum), + ), + borderRadius: BorderRadius.circular(5), + ), + ), + ); + } _receiveVideo(BuildContext context, List imgData, diff --git a/lib/chat/company_server_view.dart b/lib/chat/company_server_view.dart index 7a59cec..1915b01 100644 --- a/lib/chat/company_server_view.dart +++ b/lib/chat/company_server_view.dart @@ -178,7 +178,7 @@ class _CompanyServerPageState extends State { if (imgSize > ImgSizeLimit) { print('图片大于 $ImgSizeLimit,压缩'); //发送压缩图 - sendImg = await WidgetUtil.getCompressImg(imgFile.absolute.path); + sendImg = await WidgetUtil.getCompressImg(imgFile.absolute.path ); isNeedUpload = true; } else { sendImg = imgFile.readAsBytesSync(); diff --git a/lib/chat/download_item.dart b/lib/chat/download_item.dart index f05a832..44297da 100644 --- a/lib/chat/download_item.dart +++ b/lib/chat/download_item.dart @@ -12,12 +12,14 @@ class DownloadItem extends StatefulWidget { final bool isShowProgress; final bool isAutoDown; final Function onComplete; + final Function onFinishTap; DownloadItem( {this.msg, this.child, this.isShowProgress = true, this.isAutoDown = true, - this.onComplete}); + this.onComplete, + this.onFinishTap}); @override _DownloadItemState createState() => _DownloadItemState(); } @@ -129,7 +131,7 @@ class _DownloadItemState extends State { (widget.msg.state != MsgState.Downloading && widget.msg.state != MsgState.DownloadSuccess); return InkWell( - onTap: isNeedDown ? downloadRes : null, + onTap: isNeedDown ? downloadRes : widget.onFinishTap, child: Stack( alignment: Alignment.center, children: [widget.child, _downloadWidget()], diff --git a/lib/chat/full_img_view.dart b/lib/chat/full_img_view.dart index ed6e04a..d4cd273 100644 --- a/lib/chat/full_img_view.dart +++ b/lib/chat/full_img_view.dart @@ -56,6 +56,7 @@ class _PhotoPageState extends State Widget build(BuildContext context) { Uint8List fileData; if (widget.msg.localFile != null) { + print('本地了'); fileData = File(widget.msg.localFile).readAsBytesSync(); } else { fileData = Uint8List.fromList(widget.msg.msgContent); @@ -99,15 +100,17 @@ class _PhotoPageState extends State Positioned( right: 10, bottom: 10, - child: InkWell( + child: Material(child: InkWell( onTap: saveToGallery, child: Container( + width: 50, + height: 50, padding: EdgeInsets.all(5), decoration: BoxDecoration( color: Colors.grey.withAlpha(150), borderRadius: BorderRadius.circular(8)), child: Icon(Icons.save_alt, color: Colors.white70), - ))) + )),)) ], ))); } diff --git a/lib/chat/group_chat_item.dart b/lib/chat/group_chat_item.dart index 5f3eda9..01f630d 100644 --- a/lib/chat/group_chat_item.dart +++ b/lib/chat/group_chat_item.dart @@ -1036,21 +1036,27 @@ class _GroupChatPageItemState extends State ImageProvider provider = MemoryImage(Uint8List.fromList(imgData)); var imgSize = _getImgSize(); - return GestureDetector( - child: Container( - alignment: Alignment.centerLeft, - width: imgSize.width, - height: imgSize.height, - child: ClipRRect( - child: Image( - image: provider ?? AssetImage(R.assetsImagesIcAlbum), - ), - borderRadius: BorderRadius.circular(5), - )), - onTap: () async { - widget.hideKeyboard(); - showFullImg(context, widget.msg); - }); + + return DownloadItem( + isAutoDown: false, + msg: widget.msg, + onFinishTap: (){ + widget.hideKeyboard(); + showFullImg(context, widget.msg); + }, + child: Container( + alignment: Alignment.centerLeft, + width: imgSize.width, + height: imgSize.height, + child: ClipRRect( + child: Image( + image: provider ?? AssetImage(R.assetsImagesIcAlbum), + ), + borderRadius: BorderRadius.circular(5), + ), + ), + ); + } _receiveVideo(BuildContext context, List imgData, diff --git a/lib/chat/input_bar.dart b/lib/chat/input_bar.dart index a222ba9..5904532 100644 --- a/lib/chat/input_bar.dart +++ b/lib/chat/input_bar.dart @@ -732,8 +732,8 @@ class InputBarState extends State bool isNeedUpload = false; if (imgSize > ImgSizeLimit) { print('图片大于 $ImgSizeLimit,压缩'); - //发送压缩图 - sendImg = await WidgetUtil.getCompressImg(imgFile.absolute.path); + //发送压缩图 WidgetUtil.getCompressImg(path,quality: 80,percentage: 80); + sendImg = await WidgetUtil.getCompressImg(imgFile.absolute.path ); isNeedUpload = true; } else { sendImg = imgFile.readAsBytesSync(); diff --git a/lib/chat/util_keyboard.dart b/lib/chat/util_keyboard.dart index 94b843f..698ecdc 100644 --- a/lib/chat/util_keyboard.dart +++ b/lib/chat/util_keyboard.dart @@ -392,7 +392,7 @@ class _UtilKeyboardState extends State { File file =await FileCacheMgr().writeFile(DateTime.now().millisecondsSinceEpoch.toString(),thumbnail); File compressedFile = await FlutterNativeImage.compressImage(file.path, - quality: 20, percentage: 10); + quality: 30, percentage: 40); thumbnail =compressedFile.readAsBytesSync().toList();