|
@@ -442,78 +442,79 @@ class _ChatPageState extends State<ChatPage> { |
|
|
})));
|
|
|
})));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return WillPopScope(
|
|
|
|
|
|
child: Stack(
|
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
|
MultiProvider(
|
|
|
|
|
|
providers: [
|
|
|
|
|
|
ChangeNotifierProvider(create: (_) => _keyboardIndexProvider),
|
|
|
|
|
|
Provider<bool>.value(value: false),
|
|
|
|
|
|
Provider<int>.value(value: widget.friendId),
|
|
|
|
|
|
],
|
|
|
|
|
|
child: GestureDetector(
|
|
|
|
|
|
onTapDown: (args){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,onTap:(){
|
|
|
|
|
|
goBackCheck();
|
|
|
|
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
titleSpacing: -10,
|
|
|
|
|
|
centerTitle: false,
|
|
|
|
|
|
elevation: 1,
|
|
|
|
|
|
actions: actions),
|
|
|
|
|
|
body: SafeArea(
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
|
NetStateWidget(),
|
|
|
|
|
|
(isTranslateButler)
|
|
|
|
|
|
? _buildTranslationButler()
|
|
|
|
|
|
: Container(),
|
|
|
|
|
|
Expanded(child: _buildMessageList()),
|
|
|
|
|
|
InputBar(sendMsg: sendMsg,isTranslateHK: isTranslateButler,),
|
|
|
|
|
|
],
|
|
|
|
|
|
))),
|
|
|
|
|
|
behavior: HitTestBehavior.translucent,
|
|
|
|
|
|
onPointerDown: (value) {
|
|
|
|
|
|
for (var state in states) {
|
|
|
|
|
|
if (!state.containsPosition(value.position)) {
|
|
|
|
|
|
//clear other selection
|
|
|
|
|
|
state.clearSelection();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
onPointerMove: (value) {
|
|
|
|
|
|
|
|
|
var allItem = Stack(
|
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
|
MultiProvider(
|
|
|
|
|
|
providers: [
|
|
|
|
|
|
ChangeNotifierProvider(create: (_) => _keyboardIndexProvider),
|
|
|
|
|
|
Provider<bool>.value(value: false),
|
|
|
|
|
|
Provider<int>.value(value: widget.friendId),
|
|
|
|
|
|
],
|
|
|
|
|
|
child: GestureDetector(
|
|
|
|
|
|
onTapDown: (args){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,onTap:(){
|
|
|
|
|
|
goBackCheck();
|
|
|
|
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
titleSpacing: -10,
|
|
|
|
|
|
centerTitle: false,
|
|
|
|
|
|
elevation: 1,
|
|
|
|
|
|
actions: actions),
|
|
|
|
|
|
body: SafeArea(
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
|
NetStateWidget(),
|
|
|
|
|
|
(isTranslateButler)
|
|
|
|
|
|
? _buildTranslationButler()
|
|
|
|
|
|
: Container(),
|
|
|
|
|
|
Expanded(child: _buildMessageList()),
|
|
|
|
|
|
InputBar(sendMsg: sendMsg,isTranslateHK: isTranslateButler,),
|
|
|
|
|
|
],
|
|
|
|
|
|
))),
|
|
|
|
|
|
behavior: HitTestBehavior.translucent,
|
|
|
|
|
|
onPointerDown: (value) {
|
|
|
|
|
|
for (var state in states) {
|
|
|
|
|
|
if (!state.containsPosition(value.position)) {
|
|
|
//clear other selection
|
|
|
//clear other selection
|
|
|
for (var state in states) {
|
|
|
|
|
|
if (!state.containsPosition(value.position)) {
|
|
|
|
|
|
//clear other selection
|
|
|
|
|
|
state.clearSelection();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
state.clearSelection();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
},
|
|
|
},
|
|
|
))),
|
|
|
|
|
|
isTranslateButler ? getAudioChatView() : Container(),
|
|
|
|
|
|
isTranslateButler ? zoomAudioButton() : Container()
|
|
|
|
|
|
],
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
onPointerMove: (value) {
|
|
|
|
|
|
//clear other selection
|
|
|
|
|
|
for (var state in states) {
|
|
|
|
|
|
if (!state.containsPosition(value.position)) {
|
|
|
|
|
|
//clear other selection
|
|
|
|
|
|
state.clearSelection();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
);
|
|
|
|
|
|
},
|
|
|
|
|
|
))),
|
|
|
|
|
|
isTranslateButler ? getAudioChatView() : Container(),
|
|
|
|
|
|
isTranslateButler ? zoomAudioButton() : Container()
|
|
|
|
|
|
],
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
return isTranslateButler?WillPopScope(
|
|
|
|
|
|
child: allItem,
|
|
|
onWillPop: () {
|
|
|
onWillPop: () {
|
|
|
if(isTranslateButler && !isTranslateButlerFinish){
|
|
|
if(isTranslateButler && !isTranslateButlerFinish){
|
|
|
if(UserData().isTranslateUser){
|
|
|
if(UserData().isTranslateUser){
|
|
@@ -538,7 +539,7 @@ class _ChatPageState extends State<ChatPage> { |
|
|
}else{
|
|
|
}else{
|
|
|
Navigator.of(context).pop(); }
|
|
|
Navigator.of(context).pop(); }
|
|
|
return Future.value(false);
|
|
|
return Future.value(false);
|
|
|
});
|
|
|
|
|
|
|
|
|
}):allItem;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|