@@ -6,6 +6,6 @@ export "FLUTTER_TARGET=/Users/random/code/flutter/project/hibok/lib/main.dart" | |||||
export "FLUTTER_BUILD_DIR=build" | export "FLUTTER_BUILD_DIR=build" | ||||
export "SYMROOT=${SOURCE_ROOT}/../build/ios" | export "SYMROOT=${SOURCE_ROOT}/../build/ios" | ||||
export "FLUTTER_FRAMEWORK_DIR=/Users/random/sdk/flutter_sdk/bin/cache/artifacts/engine/ios" | export "FLUTTER_FRAMEWORK_DIR=/Users/random/sdk/flutter_sdk/bin/cache/artifacts/engine/ios" | ||||
export "FLUTTER_BUILD_NAME=1.0.5" | |||||
export "FLUTTER_BUILD_NUMBER=6" | |||||
export "FLUTTER_BUILD_NAME=1.0.9" | |||||
export "FLUTTER_BUILD_NUMBER=13" | |||||
export "TRACK_WIDGET_CREATION=true" | export "TRACK_WIDGET_CREATION=true" |
@@ -542,7 +542,7 @@ | |||||
CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements; | CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements; | ||||
CODE_SIGN_IDENTITY = "Apple Development"; | CODE_SIGN_IDENTITY = "Apple Development"; | ||||
CODE_SIGN_STYLE = Automatic; | CODE_SIGN_STYLE = Automatic; | ||||
CURRENT_PROJECT_VERSION = 12; | |||||
CURRENT_PROJECT_VERSION = 13; | |||||
DEVELOPMENT_TEAM = QJ9M3998Q6; | DEVELOPMENT_TEAM = QJ9M3998Q6; | ||||
ENABLE_BITCODE = NO; | ENABLE_BITCODE = NO; | ||||
FRAMEWORK_SEARCH_PATHS = ( | FRAMEWORK_SEARCH_PATHS = ( | ||||
@@ -556,7 +556,7 @@ | |||||
"$(inherited)", | "$(inherited)", | ||||
"$(PROJECT_DIR)/Flutter", | "$(PROJECT_DIR)/Flutter", | ||||
); | ); | ||||
MARKETING_VERSION = 1.0.8; | |||||
MARKETING_VERSION = 1.0.9; | |||||
PRODUCT_BUNDLE_IDENTIFIER = com.chengyouhudong.hibok; | PRODUCT_BUNDLE_IDENTIFIER = com.chengyouhudong.hibok; | ||||
PRODUCT_NAME = "$(TARGET_NAME)"; | PRODUCT_NAME = "$(TARGET_NAME)"; | ||||
PROVISIONING_PROFILE_SPECIFIER = ""; | PROVISIONING_PROFILE_SPECIFIER = ""; | ||||
@@ -578,14 +578,14 @@ | |||||
CODE_SIGN_ENTITLEMENTS = "Share Extension/Share Extension.entitlements"; | CODE_SIGN_ENTITLEMENTS = "Share Extension/Share Extension.entitlements"; | ||||
CODE_SIGN_IDENTITY = "Apple Development"; | CODE_SIGN_IDENTITY = "Apple Development"; | ||||
CODE_SIGN_STYLE = Automatic; | CODE_SIGN_STYLE = Automatic; | ||||
CURRENT_PROJECT_VERSION = 12; | |||||
CURRENT_PROJECT_VERSION = 13; | |||||
DEVELOPMENT_TEAM = QJ9M3998Q6; | DEVELOPMENT_TEAM = QJ9M3998Q6; | ||||
ENABLE_BITCODE = YES; | ENABLE_BITCODE = YES; | ||||
GCC_C_LANGUAGE_STANDARD = gnu11; | GCC_C_LANGUAGE_STANDARD = gnu11; | ||||
INFOPLIST_FILE = "Share Extension/Info.plist"; | INFOPLIST_FILE = "Share Extension/Info.plist"; | ||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0; | IPHONEOS_DEPLOYMENT_TARGET = 9.0; | ||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; | ||||
MARKETING_VERSION = 1.0.8; | |||||
MARKETING_VERSION = 1.0.9; | |||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; | ||||
MTL_FAST_MATH = YES; | MTL_FAST_MATH = YES; | ||||
OTHER_LDFLAGS = ""; | OTHER_LDFLAGS = ""; | ||||
@@ -610,14 +610,14 @@ | |||||
CODE_SIGN_ENTITLEMENTS = "Share Extension/Share Extension.entitlements"; | CODE_SIGN_ENTITLEMENTS = "Share Extension/Share Extension.entitlements"; | ||||
CODE_SIGN_IDENTITY = "Apple Development"; | CODE_SIGN_IDENTITY = "Apple Development"; | ||||
CODE_SIGN_STYLE = Automatic; | CODE_SIGN_STYLE = Automatic; | ||||
CURRENT_PROJECT_VERSION = 12; | |||||
CURRENT_PROJECT_VERSION = 13; | |||||
DEVELOPMENT_TEAM = QJ9M3998Q6; | DEVELOPMENT_TEAM = QJ9M3998Q6; | ||||
ENABLE_BITCODE = YES; | ENABLE_BITCODE = YES; | ||||
GCC_C_LANGUAGE_STANDARD = gnu11; | GCC_C_LANGUAGE_STANDARD = gnu11; | ||||
INFOPLIST_FILE = "Share Extension/Info.plist"; | INFOPLIST_FILE = "Share Extension/Info.plist"; | ||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0; | IPHONEOS_DEPLOYMENT_TARGET = 9.0; | ||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; | ||||
MARKETING_VERSION = 1.0.8; | |||||
MARKETING_VERSION = 1.0.9; | |||||
MTL_FAST_MATH = YES; | MTL_FAST_MATH = YES; | ||||
OTHER_LDFLAGS = ""; | OTHER_LDFLAGS = ""; | ||||
PRODUCT_BUNDLE_IDENTIFIER = com.chengyouhudong.hibok.share; | PRODUCT_BUNDLE_IDENTIFIER = com.chengyouhudong.hibok.share; | ||||
@@ -640,14 +640,14 @@ | |||||
CODE_SIGN_ENTITLEMENTS = "Share Extension/Share ExtensionProfile.entitlements"; | CODE_SIGN_ENTITLEMENTS = "Share Extension/Share ExtensionProfile.entitlements"; | ||||
CODE_SIGN_IDENTITY = "Apple Development"; | CODE_SIGN_IDENTITY = "Apple Development"; | ||||
CODE_SIGN_STYLE = Automatic; | CODE_SIGN_STYLE = Automatic; | ||||
CURRENT_PROJECT_VERSION = 12; | |||||
CURRENT_PROJECT_VERSION = 13; | |||||
DEVELOPMENT_TEAM = QJ9M3998Q6; | DEVELOPMENT_TEAM = QJ9M3998Q6; | ||||
ENABLE_BITCODE = YES; | ENABLE_BITCODE = YES; | ||||
GCC_C_LANGUAGE_STANDARD = gnu11; | GCC_C_LANGUAGE_STANDARD = gnu11; | ||||
INFOPLIST_FILE = "Share Extension/Info.plist"; | INFOPLIST_FILE = "Share Extension/Info.plist"; | ||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0; | IPHONEOS_DEPLOYMENT_TARGET = 9.0; | ||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; | ||||
MARKETING_VERSION = 1.0.8; | |||||
MARKETING_VERSION = 1.0.9; | |||||
MTL_FAST_MATH = YES; | MTL_FAST_MATH = YES; | ||||
OTHER_LDFLAGS = ""; | OTHER_LDFLAGS = ""; | ||||
PRODUCT_BUNDLE_IDENTIFIER = com.chengyouhudong.hibok.share; | PRODUCT_BUNDLE_IDENTIFIER = com.chengyouhudong.hibok.share; | ||||
@@ -777,7 +777,7 @@ | |||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; | ||||
CODE_SIGN_IDENTITY = "Apple Development"; | CODE_SIGN_IDENTITY = "Apple Development"; | ||||
CODE_SIGN_STYLE = Automatic; | CODE_SIGN_STYLE = Automatic; | ||||
CURRENT_PROJECT_VERSION = 12; | |||||
CURRENT_PROJECT_VERSION = 13; | |||||
DEVELOPMENT_TEAM = ""; | DEVELOPMENT_TEAM = ""; | ||||
ENABLE_BITCODE = NO; | ENABLE_BITCODE = NO; | ||||
FRAMEWORK_SEARCH_PATHS = ( | FRAMEWORK_SEARCH_PATHS = ( | ||||
@@ -791,7 +791,7 @@ | |||||
"$(inherited)", | "$(inherited)", | ||||
"$(PROJECT_DIR)/Flutter", | "$(PROJECT_DIR)/Flutter", | ||||
); | ); | ||||
MARKETING_VERSION = 1.0.8; | |||||
MARKETING_VERSION = 1.0.9; | |||||
PRODUCT_BUNDLE_IDENTIFIER = com.chengyouhudong.hibok; | PRODUCT_BUNDLE_IDENTIFIER = com.chengyouhudong.hibok; | ||||
PRODUCT_NAME = "$(TARGET_NAME)"; | PRODUCT_NAME = "$(TARGET_NAME)"; | ||||
PROVISIONING_PROFILE_SPECIFIER = ""; | PROVISIONING_PROFILE_SPECIFIER = ""; | ||||
@@ -811,7 +811,7 @@ | |||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; | ||||
CODE_SIGN_IDENTITY = "Apple Development"; | CODE_SIGN_IDENTITY = "Apple Development"; | ||||
CODE_SIGN_STYLE = Automatic; | CODE_SIGN_STYLE = Automatic; | ||||
CURRENT_PROJECT_VERSION = 12; | |||||
CURRENT_PROJECT_VERSION = 13; | |||||
DEVELOPMENT_TEAM = QJ9M3998Q6; | DEVELOPMENT_TEAM = QJ9M3998Q6; | ||||
ENABLE_BITCODE = NO; | ENABLE_BITCODE = NO; | ||||
FRAMEWORK_SEARCH_PATHS = ( | FRAMEWORK_SEARCH_PATHS = ( | ||||
@@ -825,7 +825,7 @@ | |||||
"$(inherited)", | "$(inherited)", | ||||
"$(PROJECT_DIR)/Flutter", | "$(PROJECT_DIR)/Flutter", | ||||
); | ); | ||||
MARKETING_VERSION = 1.0.8; | |||||
MARKETING_VERSION = 1.0.9; | |||||
PRODUCT_BUNDLE_IDENTIFIER = com.chengyouhudong.hibok; | PRODUCT_BUNDLE_IDENTIFIER = com.chengyouhudong.hibok; | ||||
PRODUCT_NAME = "$(TARGET_NAME)"; | PRODUCT_NAME = "$(TARGET_NAME)"; | ||||
PROVISIONING_PROFILE_SPECIFIER = ""; | PROVISIONING_PROFILE_SPECIFIER = ""; | ||||
@@ -1,5 +1,7 @@ | |||||
import 'dart:convert'; | import 'dart:convert'; | ||||
import 'dart:io'; | import 'dart:io'; | ||||
import 'package:chat/home/audio_chat_view.dart'; | |||||
import 'package:chat/utils/screen.dart'; | |||||
import 'package:chat/utils/upload_util.dart'; | import 'package:chat/utils/upload_util.dart'; | ||||
import 'package:fixnum/fixnum.dart'; | import 'package:fixnum/fixnum.dart'; | ||||
import 'package:cached_network_image/cached_network_image.dart'; | import 'package:cached_network_image/cached_network_image.dart'; | ||||
@@ -216,10 +218,12 @@ class _ChatPageState extends State<ChatPage> { | |||||
MsgModel msg = MsgHandler.createSendMsg( | MsgModel msg = MsgHandler.createSendMsg( | ||||
ChatType.valueOf(originMsg.msgType), originMsg.msgContent); | ChatType.valueOf(originMsg.msgType), originMsg.msgContent); | ||||
msg.extraInfo = originMsg.extraInfo; | msg.extraInfo = originMsg.extraInfo; | ||||
if(originMsg.extraFile==null ||originMsg.extraFile.contains('http')){ | |||||
if (originMsg.extraFile == null || | |||||
originMsg.extraFile.contains('http')) { | |||||
msg.extraFile = originMsg.extraFile; | msg.extraFile = originMsg.extraFile; | ||||
}else{ | |||||
msg.extraFile = UploadUtil().getFullUrl(originMsg.extraFile, originMsg.sessionId, originMsg.channelType); | |||||
} else { | |||||
msg.extraFile = UploadUtil().getFullUrl( | |||||
originMsg.extraFile, originMsg.sessionId, originMsg.channelType); | |||||
} | } | ||||
msg.localFile = originMsg.localFile; | msg.localFile = originMsg.localFile; | ||||
@@ -281,7 +285,8 @@ class _ChatPageState extends State<ChatPage> { | |||||
userId: friendInfo.userId, | userId: friendInfo.userId, | ||||
pageType: SendMessagePageType.Remark, | pageType: SendMessagePageType.Remark, | ||||
originalName: Provider.of<RefNameProvider>(context) | originalName: Provider.of<RefNameProvider>(context) | ||||
.getRefName(friendInfo.userId, friendInfo.nickName)); | |||||
.getRefName( | |||||
friendInfo.userId, friendInfo.nickName)); | |||||
}, | }, | ||||
), | ), | ||||
); | ); | ||||
@@ -322,73 +327,187 @@ class _ChatPageState extends State<ChatPage> { | |||||
]; | ]; | ||||
}))); | }))); | ||||
return MultiProvider( | |||||
providers: [ | |||||
ChangeNotifierProvider(create: (_) => _keyboardIndexProvider), | |||||
Provider<bool>.value(value: false), | |||||
Provider<int>.value(value: widget.friendId), | |||||
], | |||||
child: GestureDetector( | |||||
onTap: hideKeyBoard, | |||||
child: ExtendedTextSelectionPointerHandler( | |||||
///选择文字,消除弹窗 | |||||
builder: (states) { | |||||
return Listener( | |||||
child: Scaffold( | |||||
resizeToAvoidBottomInset: false, | |||||
backgroundColor: const Color(0xFFE2E9F1), | |||||
appBar: AppBar( | |||||
title: Text( | |||||
'${Provider.of<RefNameProvider>(context).getRefName(friendInfo.userId, friendInfo.nickName)}', | |||||
textScaleFactor: 1.0, | |||||
style: TextStyle( | |||||
color: Constants.BlackTextColor, | |||||
fontSize: 16.47), | |||||
), | |||||
leading: CustomUI.buildCustomLeading(context), | |||||
titleSpacing: -10, | |||||
centerTitle: false, | |||||
elevation: 1, | |||||
actions: actions), | |||||
body: SafeArea( | |||||
child: Column( | |||||
children: <Widget>[ | |||||
NetStateWidget(), | |||||
widget.isTranslateButler | |||||
? _buildTranslationButler() | |||||
: Container(), | |||||
widget.isTranslateButler | |||||
? _buildServiceCard(true, () {}) | |||||
: Container(), | |||||
widget.isTranslateButler | |||||
? _buildServiceCard(false, () {}) | |||||
: Container(), | |||||
Expanded(child: _buildMessageList()), | |||||
InputBar(sendMsg: sendMsg), | |||||
], | |||||
))), | |||||
behavior: HitTestBehavior.translucent, | |||||
onPointerDown: (value) { | |||||
for (var state in states) { | |||||
if (!state.containsPosition(value.position)) { | |||||
//clear other selection | |||||
state.clearSelection(); | |||||
} | |||||
} | |||||
}, | |||||
onPointerMove: (value) { | |||||
//clear other selection | |||||
for (var state in states) { | |||||
if (!state.containsPosition(value.position)) { | |||||
return Stack( | |||||
children: <Widget>[ | |||||
MultiProvider( | |||||
providers: [ | |||||
ChangeNotifierProvider(create: (_) => _keyboardIndexProvider), | |||||
Provider<bool>.value(value: false), | |||||
Provider<int>.value(value: widget.friendId), | |||||
], | |||||
child: GestureDetector( | |||||
onTap: hideKeyBoard, | |||||
child: ExtendedTextSelectionPointerHandler( | |||||
///选择文字,消除弹窗 | |||||
builder: (states) { | |||||
return Listener( | |||||
child: Scaffold( | |||||
resizeToAvoidBottomInset: false, | |||||
backgroundColor: const Color(0xFFE2E9F1), | |||||
appBar: AppBar( | |||||
title: Text( | |||||
'${Provider.of<RefNameProvider>(context).getRefName(friendInfo.userId, friendInfo.nickName)}', | |||||
textScaleFactor: 1.0, | |||||
style: TextStyle( | |||||
color: Constants.BlackTextColor, | |||||
fontSize: 16.47), | |||||
), | |||||
leading: CustomUI.buildCustomLeading(context), | |||||
titleSpacing: -10, | |||||
centerTitle: false, | |||||
elevation: 1, | |||||
actions: actions), | |||||
body: SafeArea( | |||||
child: Column( | |||||
children: <Widget>[ | |||||
NetStateWidget(), | |||||
widget.isTranslateButler | |||||
? _buildTranslationButler() | |||||
: Container(), | |||||
widget.isTranslateButler | |||||
? _buildServiceCard(true, () {}) | |||||
: Container(), | |||||
widget.isTranslateButler | |||||
? _buildServiceCard(false, () {}) | |||||
: Container(), | |||||
Expanded(child: _buildMessageList()), | |||||
InputBar(sendMsg: sendMsg), | |||||
], | |||||
))), | |||||
behavior: HitTestBehavior.translucent, | |||||
onPointerDown: (value) { | |||||
for (var state in states) { | |||||
if (!state.containsPosition(value.position)) { | |||||
//clear other selection | |||||
state.clearSelection(); | |||||
} | |||||
} | |||||
}, | |||||
onPointerMove: (value) { | |||||
//clear other selection | //clear other selection | ||||
state.clearSelection(); | |||||
} | |||||
} | |||||
for (var state in states) { | |||||
if (!state.containsPosition(value.position)) { | |||||
//clear other selection | |||||
state.clearSelection(); | |||||
} | |||||
} | |||||
}, | |||||
); | |||||
}, | }, | ||||
); | |||||
}, | |||||
))); | |||||
))), | |||||
widget.isTranslateButler ? getAudioChatView() : Container(), | |||||
widget.isTranslateButler ? zoomAudioButton() : Container() | |||||
], | |||||
); | |||||
} | |||||
Widget getAudioChatView() { | |||||
if (friendInfo == null) { | |||||
return Container(); | |||||
} | |||||
return isActive == null | |||||
? Container() | |||||
: Offstage( | |||||
offstage: !isShowAudio, | |||||
child: AudioChatPage( | |||||
userInfo: friendInfo, | |||||
isTranslateButler: true, | |||||
translateButlerCloseCallBack: audioChatPageCallBack, | |||||
), | |||||
); | |||||
} | |||||
audioChatPageCallBack(int args) { | |||||
switch (args) { | |||||
case 1: | |||||
setState(() { | |||||
isShowAudio = !isShowAudio; | |||||
isShowZoomButton = true; | |||||
}); | |||||
break; | |||||
case 2: | |||||
setState(() { | |||||
isActive = false; | |||||
}); | |||||
break; | |||||
} | |||||
} | |||||
bool isShowAudio = false; | |||||
///控住连麦窗口是否显示 | |||||
bool isActive = true; | |||||
///控制连麦是否关闭 | |||||
bool isShowZoomButton = true; | |||||
GlobalKey mykey = GlobalKey(); | |||||
double dx = 0, dy = 0; | |||||
double zoomButtonSize = 60; | |||||
void dragEvent(DragUpdateDetails details) { | |||||
final RenderObject box = context.findRenderObject(); | |||||
// 获得自定义Widget的大小,用来计算Widget的中心锚点 | |||||
dx = details.globalPosition.dx - mykey.currentContext.size.width / 2; | |||||
dy = details.globalPosition.dy - mykey.currentContext.size.height / 2; | |||||
print('dx $dx dy $dy screen width:${Screen.width}'); | |||||
if (dx > Screen.width - zoomButtonSize) { | |||||
dx = Screen.width - zoomButtonSize; | |||||
} else if (dx < 0) { | |||||
dx = 0; | |||||
} | |||||
if (dy > Screen.height - zoomButtonSize) { | |||||
dy = Screen.height - zoomButtonSize; | |||||
} else if (dy < 0) { | |||||
dy = 0; | |||||
} | |||||
setState(() {}); | |||||
} | |||||
Widget zoomAudioButton() { | |||||
friendInfo == null | |||||
? Container() | |||||
: AudioChatPage( | |||||
userInfo: friendInfo, | |||||
); | |||||
if (friendInfo == null || !isShowZoomButton) { | |||||
return Container(); | |||||
} | |||||
Widget button = Container( | |||||
key: mykey, | |||||
color: Colors.blue, | |||||
width: 60, | |||||
height: 60, | |||||
); | |||||
return GestureDetector( | |||||
onHorizontalDragUpdate: dragEvent, | |||||
onVerticalDragUpdate: dragEvent, | |||||
onTap: (){ | |||||
setState(() { | |||||
isShowAudio = !isShowAudio; | |||||
isShowZoomButton = !isShowZoomButton; | |||||
}); | |||||
}, | |||||
child: Container( | |||||
child: Transform.translate( | |||||
offset: Offset(dx, dy), | |||||
child: Align( | |||||
alignment: Alignment.topLeft, | |||||
child: button, | |||||
), | |||||
), | |||||
), | |||||
); | |||||
} | } | ||||
Widget _buildTranslationButler() { | Widget _buildTranslationButler() { | ||||
@@ -426,31 +545,35 @@ class _ChatPageState extends State<ChatPage> { | |||||
child: Image.asset(R.assetsImagesDefaultNorAvatar))), | child: Image.asset(R.assetsImagesDefaultNorAvatar))), | ||||
Padding( | Padding( | ||||
padding: EdgeInsets.only(left: 10), | padding: EdgeInsets.only(left: 10), | ||||
child: Container(child: Column( | |||||
crossAxisAlignment: CrossAxisAlignment.start, | |||||
children: <Widget>[ | |||||
Text( | |||||
I18n.of(context).translation_butler , | |||||
textScaleFactor: 1.0, | |||||
overflow: TextOverflow.ellipsis, | |||||
maxLines: 1, | |||||
style: TextStyle( | |||||
color: AppColors.NewAppbarTextColor, fontSize: 15), | |||||
), | |||||
SizedBox(height: 5,), | |||||
Text( | |||||
coinTIme, | |||||
textScaleFactor: 1.0, | |||||
maxLines: 1, | |||||
style: TextStyle( | |||||
color: Color(0xFF797979), fontSize: 13), | |||||
) | |||||
], | |||||
),constraints:BoxConstraints(maxWidth: 135),), | |||||
child: Container( | |||||
child: Column( | |||||
crossAxisAlignment: CrossAxisAlignment.start, | |||||
children: <Widget>[ | |||||
Text( | |||||
I18n.of(context).translation_butler, | |||||
textScaleFactor: 1.0, | |||||
overflow: TextOverflow.ellipsis, | |||||
maxLines: 1, | |||||
style: TextStyle( | |||||
color: AppColors.NewAppbarTextColor, fontSize: 15), | |||||
), | |||||
SizedBox( | |||||
height: 5, | |||||
), | |||||
Text( | |||||
coinTIme, | |||||
textScaleFactor: 1.0, | |||||
maxLines: 1, | |||||
style: TextStyle(color: Color(0xFF797979), fontSize: 13), | |||||
) | |||||
], | |||||
), | |||||
constraints: BoxConstraints(maxWidth: 135), | |||||
), | |||||
), | ), | ||||
Expanded( | Expanded( | ||||
child: Container( | child: Container( | ||||
constraints:BoxConstraints(maxWidth: 130), | |||||
constraints: BoxConstraints(maxWidth: 130), | |||||
width: double.maxFinite, | width: double.maxFinite, | ||||
child: CountDownButton( | child: CountDownButton( | ||||
I18n.of(context).translation_butler_end_service, | I18n.of(context).translation_butler_end_service, | ||||
@@ -596,27 +719,23 @@ class _ChatPageState extends State<ChatPage> { | |||||
} | } | ||||
MsgModel msg; | MsgModel msg; | ||||
int count=0; | |||||
testBig(MsgModel msg)async{ | |||||
int count = 0; | |||||
for(int k=0;k<100;k++){ | |||||
testBig(MsgModel msg) async { | |||||
for (int k = 0; k < 100; k++) { | |||||
msg.msgContent = utf8.encode('测试$count'); | msg.msgContent = utf8.encode('测试$count'); | ||||
Int64 time = Int64((DateTime.now()).millisecondsSinceEpoch); | Int64 time = Int64((DateTime.now()).millisecondsSinceEpoch); | ||||
msg.time = time.toInt(); | msg.time = time.toInt(); | ||||
MsgHandler.insertMsgToDB(msg); | MsgHandler.insertMsgToDB(msg); | ||||
MsgHandler.sendChatMsg(msg); | MsgHandler.sendChatMsg(msg); | ||||
await Future.delayed(Duration(milliseconds: 500),(){}); | |||||
await Future.delayed(Duration(milliseconds: 500), () {}); | |||||
count++; | count++; | ||||
} | } | ||||
count=0; | |||||
count = 0; | |||||
print('发送完毕'); | print('发送完毕'); | ||||
showToast('发送完毕'); | showToast('发送完毕'); | ||||
} | } | ||||
void receiveMsg(args) { | void receiveMsg(args) { | ||||
if (mounted) { | if (mounted) { | ||||
setState(() {}); | setState(() {}); | ||||
@@ -62,7 +62,7 @@ class _PhotoPageState extends State<PhotoPage> | |||||
} else { | } else { | ||||
fileData = Uint8List.fromList(widget.msg.msgContent); | fileData = Uint8List.fromList(widget.msg.msgContent); | ||||
} | } | ||||
return GestureDetector( | |||||
return Material(color: Colors.black,child: GestureDetector( | |||||
onTap: () { | onTap: () { | ||||
Navigator.pop(context); | Navigator.pop(context); | ||||
}, | }, | ||||
@@ -74,30 +74,30 @@ class _PhotoPageState extends State<PhotoPage> | |||||
children: <Widget>[ | children: <Widget>[ | ||||
SingleChildScrollView( | SingleChildScrollView( | ||||
child: Column( | child: Column( | ||||
children: <Widget>[ | |||||
Container( | |||||
width: Screen.width, | |||||
constraints: BoxConstraints(minHeight: Screen.height), | |||||
child: ExtendedImage.memory( | |||||
fileData, | |||||
fit: BoxFit.fitWidth, | |||||
mode: ExtendedImageMode.gesture, | |||||
initGestureConfigHandler: (state) { | |||||
return GestureConfig( | |||||
minScale: 0.9, | |||||
animationMinScale: 0.7, | |||||
maxScale: 3.0, | |||||
animationMaxScale: 3.5, | |||||
speed: 1.0, | |||||
inertialSpeed: 100.0, | |||||
initialScale: 1.0, | |||||
inPageView: true, | |||||
initialAlignment: InitialAlignment.center, | |||||
); | |||||
}, | |||||
)) | |||||
], | |||||
)), | |||||
children: <Widget>[ | |||||
Container( | |||||
width: Screen.width, | |||||
constraints: BoxConstraints(minHeight: Screen.height), | |||||
child: ExtendedImage.memory( | |||||
fileData, | |||||
fit: BoxFit.fitWidth, | |||||
mode: ExtendedImageMode.gesture, | |||||
initGestureConfigHandler: (state) { | |||||
return GestureConfig( | |||||
minScale: 0.9, | |||||
animationMinScale: 0.7, | |||||
maxScale: 3.0, | |||||
animationMaxScale: 3.5, | |||||
speed: 1.0, | |||||
inertialSpeed: 100.0, | |||||
initialScale: 1.0, | |||||
inPageView: true, | |||||
initialAlignment: InitialAlignment.center, | |||||
); | |||||
}, | |||||
)) | |||||
], | |||||
)), | |||||
Positioned( | Positioned( | ||||
right: 10, | right: 10, | ||||
bottom: 10, | bottom: 10, | ||||
@@ -113,7 +113,7 @@ class _PhotoPageState extends State<PhotoPage> | |||||
child: Icon(Icons.save_alt, color: Colors.white70), | child: Icon(Icons.save_alt, color: Colors.white70), | ||||
)),)) | )),)) | ||||
], | ], | ||||
))); | |||||
))),); | |||||
} | } | ||||
saveToGallery() async { | saveToGallery() async { | ||||
@@ -33,8 +33,9 @@ import 'package:provider/provider.dart'; | |||||
class AudioChatPage extends StatefulWidget { | class AudioChatPage extends StatefulWidget { | ||||
final UserInfo userInfo; | final UserInfo userInfo; | ||||
final bool isReplay; | final bool isReplay; | ||||
AudioChatPage({this.userInfo, this.isReplay = false}); | |||||
final bool isTranslateButler; | |||||
final Function translateButlerCloseCallBack; | |||||
AudioChatPage({@required this.userInfo, this.isReplay = false, this.isTranslateButler,this.translateButlerCloseCallBack}); | |||||
@override | @override | ||||
_AudioChatPageState createState() => _AudioChatPageState(); | _AudioChatPageState createState() => _AudioChatPageState(); | ||||
} | } | ||||
@@ -215,7 +216,11 @@ class _AudioChatPageState extends State<AudioChatPage> { | |||||
_viewAudio(), | _viewAudio(), | ||||
isReply ? _replayToolBar() : _bottomToolBar(), | isReply ? _replayToolBar() : _bottomToolBar(), | ||||
], | ], | ||||
))) | |||||
))), | |||||
widget.isTranslateButler?Material(child: InkWell(child: Container(color: Colors.yellow,width: 60,height: 60,),onTap: (){ | |||||
widget.translateButlerCloseCallBack(1); | |||||
print('内页内页'); | |||||
},),):Container() | |||||
], | ], | ||||
))); | ))); | ||||
} | } | ||||
@@ -774,7 +779,13 @@ class _AudioChatPageState extends State<AudioChatPage> { | |||||
if (!isQuit) { | if (!isQuit) { | ||||
if (Navigator.canPop(context)) { | if (Navigator.canPop(context)) { | ||||
isQuit = true; | isQuit = true; | ||||
Navigator.of(context).pop(); | |||||
if(widget.translateButlerCloseCallBack!=null){ | |||||
widget.translateButlerCloseCallBack(2); | |||||
}else{ | |||||
Navigator.of(context).pop(); | |||||
} | |||||
SoundUtils().stop(); | SoundUtils().stop(); | ||||
callingTimer?.cancel(); | callingTimer?.cancel(); | ||||
} | } | ||||
@@ -75,18 +75,18 @@ class TranslationButlerPageState extends State<TranslationButlerPage> { | |||||
Future.delayed(Duration(seconds: 1), () { | Future.delayed(Duration(seconds: 1), () { | ||||
CustomUI.buildTranslationHelperOrderDialog(context,true); | |||||
// Navigator.of(context).push( | |||||
// new MaterialPageRoute( | |||||
// builder: (context) { | |||||
// return ChatPage( | |||||
// key: Key('Chat'), | |||||
// friendId: 100006, | |||||
// isTranslateButler: true, | |||||
// ); | |||||
// }, | |||||
// ), | |||||
// ); | |||||
// CustomUI.buildTranslationHelperOrderDialog(context,true); | |||||
Navigator.of(context).push( | |||||
new MaterialPageRoute( | |||||
builder: (context) { | |||||
return ChatPage( | |||||
key: Key('Chat'), | |||||
friendId: 100029, | |||||
isTranslateButler: true, | |||||
); | |||||
}, | |||||
), | |||||
); | |||||
}); | }); | ||||
@@ -44,9 +44,9 @@ class HttpUtil { | |||||
//static const String BaseUrl = 'http://192.168.0.223:7001/'; | //static const String BaseUrl = 'http://192.168.0.223:7001/'; | ||||
//static const String BaseUrl = 'http://192.168.0.207:9080/'; | //static const String BaseUrl = 'http://192.168.0.207:9080/'; | ||||
// static const String BaseUrl = 'http://120.79.107.63:9080/'; | |||||
static const String BaseUrl = 'http://120.79.107.63:9080/'; | |||||
//static const String BaseUrl = 'http://192.168.0.177:9016/'; | //static const String BaseUrl = 'http://192.168.0.177:9016/'; | ||||
static const String BaseUrl = 'https://datasm.chengyouhd.com/'; | |||||
// static const String BaseUrl = 'https://datasm.chengyouhd.com/'; | |||||
static HttpUtil _getInstance() { | static HttpUtil _getInstance() { | ||||
if (_instance == null) { | if (_instance == null) { | ||||