Browse Source

复制弹窗更改;

wr_202303
wurong 4 months ago
parent
commit
cfcad24009
  1. 441
      lib/im/chat_details_page.dart

441
lib/im/chat_details_page.dart

@ -335,9 +335,6 @@ class _ChatDetailsPage extends State<ChatDetailsPage>
refresh().then((value) { refresh().then((value) {
refreshState(); refreshState();
}); });
// setState(() {
// copyIndex = 0;
// });
}, },
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
@ -457,90 +454,90 @@ class _ChatDetailsPage extends State<ChatDetailsPage>
// SizedBox( // SizedBox(
// height: 16.h, // height: 16.h,
// ), // ),
if (copyIndex == 1) // if (copyIndex == -1)
Stack( // Stack(
alignment: Alignment.bottomCenter, // alignment: Alignment.bottomCenter,
children: [ // children: [
Container( // Container(
padding: EdgeInsets.only(bottom: 13.h), // padding: EdgeInsets.only(bottom: 13.h),
child: Container( // child: Container(
width: 180.w, // width: 180.w,
decoration: BoxDecoration( // decoration: BoxDecoration(
color: Color(0xFF2A2A2A), // color: Color(0xFF2A2A2A),
borderRadius: BorderRadius.circular(6), // borderRadius: BorderRadius.circular(6),
), // ),
padding: EdgeInsets.symmetric( // padding: EdgeInsets.symmetric(
horizontal: 32.w, // horizontal: 32.w,
vertical: 7.5.h, // vertical: 7.5.h,
), // ),
child: Row( // child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, // mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, // crossAxisAlignment: CrossAxisAlignment.center,
children: [ // children: [
GestureDetector( // GestureDetector(
onTap: () { // onTap: () {
setState(() { // setState(() {
copyIndex = 0; // copyIndex = 0;
this.copy(tex); // this.copy(tex);
}); // });
}, // },
child: Column( // child: Column(
children: [ // children: [
Image.asset( // Image.asset(
"assets/image/icon_chat_copy.webp", // "assets/image/icon_chat_copy.webp",
height: 16, // height: 16,
width: 16, // width: 16,
), // ),
SizedBox( // SizedBox(
height: 2.h, // height: 2.h,
), // ),
Text( // Text(
"复制", // "复制",
textAlign: TextAlign.center, // textAlign: TextAlign.center,
style: TextStyle( // style: TextStyle(
color: Colors.white, // color: Colors.white,
fontSize: 12.sp, // fontSize: 12.sp,
fontWeight: MyFontWeight.regular, // fontWeight: MyFontWeight.regular,
), // ),
), // ),
], // ],
), // ),
), // ),
GestureDetector( // GestureDetector(
onTap: () {}, // onTap: () {},
child: Column( // child: Column(
children: [ // children: [
Image.asset( // Image.asset(
"assets/image/icon_chat_delete.webp", // "assets/image/icon_chat_delete.webp",
height: 16, // height: 16,
width: 16, // width: 16,
), // ),
SizedBox( // SizedBox(
height: 2.h, // height: 2.h,
), // ),
Text( // Text(
S.of(context).shanchu, // S.of(context).shanchu,
textAlign: TextAlign.center, // textAlign: TextAlign.center,
style: TextStyle( // style: TextStyle(
color: Colors.white, // color: Colors.white,
fontSize: 12.sp, // fontSize: 12.sp,
fontWeight: MyFontWeight.regular, // fontWeight: MyFontWeight.regular,
), // ),
), // ),
], // ],
), // ),
) // )
], // ],
), // ),
), // ),
), // ),
Image.asset( // Image.asset(
"assets/image/icon_copy_j.webp", // "assets/image/icon_copy_j.webp",
height: 17, // height: 17,
width: 17, // width: 17,
), // ),
], // ],
), // ),
/// not self /// not self
if (!isSelf && isText) if (!isSelf && isText)
@ -617,88 +614,88 @@ class _ChatDetailsPage extends State<ChatDetailsPage>
), ),
), ),
if (copyIndex == 1) // if (copyIndex == 1)
Stack( // Stack(
alignment: Alignment.bottomCenter, // alignment: Alignment.bottomCenter,
children: [ // children: [
Container( // Container(
padding: EdgeInsets.only(bottom: 13.h), // padding: EdgeInsets.only(bottom: 13.h),
child: Container( // child: Container(
width: 180.w, // width: 180.w,
decoration: BoxDecoration( // decoration: BoxDecoration(
color: Color(0xFF2A2A2A), // color: Color(0xFF2A2A2A),
borderRadius: BorderRadius.circular(6), // borderRadius: BorderRadius.circular(6),
), // ),
padding: // padding:
EdgeInsets.symmetric(horizontal: 32.w, vertical: 7.5.h), // EdgeInsets.symmetric(horizontal: 32.w, vertical: 7.5.h),
child: Row( // child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, // mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, // crossAxisAlignment: CrossAxisAlignment.center,
children: [ // children: [
GestureDetector( // GestureDetector(
onTap: () { // onTap: () {
setState(() { // setState(() {
copyIndex = 0; // copyIndex = 0;
this.copy(tex); // this.copy(tex);
}); // });
}, // },
child: Column( // child: Column(
children: [ // children: [
Image.asset( // Image.asset(
"assets/image/icon_chat_copy.webp", // "assets/image/icon_chat_copy.webp",
height: 16, // height: 16,
width: 16, // width: 16,
), // ),
SizedBox( // SizedBox(
height: 2.h, // height: 2.h,
), // ),
Text( // Text(
"复制", // "复制",
textAlign: TextAlign.center, // textAlign: TextAlign.center,
style: TextStyle( // style: TextStyle(
color: Colors.white, // color: Colors.white,
fontSize: 12.sp, // fontSize: 12.sp,
fontWeight: MyFontWeight.regular, // fontWeight: MyFontWeight.regular,
), // ),
), // ),
], // ],
), // ),
), // ),
GestureDetector( // GestureDetector(
onTap: () {}, // onTap: () {},
child: Column( // child: Column(
children: [ // children: [
Image.asset( // Image.asset(
"assets/image/icon_chat_delete.webp", // "assets/image/icon_chat_delete.webp",
height: 16, // height: 16,
width: 16, // width: 16,
), // ),
SizedBox( // SizedBox(
height: 2.h, // height: 2.h,
), // ),
Text( // Text(
S.of(context).shanchu, // S.of(context).shanchu,
textAlign: TextAlign.center, // textAlign: TextAlign.center,
style: TextStyle( // style: TextStyle(
color: Colors.white, // color: Colors.white,
fontSize: 12.sp, // fontSize: 12.sp,
fontWeight: MyFontWeight.regular, // fontWeight: MyFontWeight.regular,
), // ),
), // ),
], // ],
), // ),
) // )
], // ],
), // ),
), // ),
), // ),
Image.asset( // Image.asset(
"assets/image/icon_copy_j.webp", // "assets/image/icon_copy_j.webp",
height: 17, // height: 17,
width: 17, // width: 17,
), // ),
], // ],
), // ),
/// self /// self
if (isSelf && isText) if (isSelf && isText)
@ -757,6 +754,7 @@ class _ChatDetailsPage extends State<ChatDetailsPage>
onLongPress: () { onLongPress: () {
setState(() { setState(() {
copyIndex = 1; copyIndex = 1;
// showCustomDialog(position);
}); });
}, },
child: Text( child: Text(
@ -1114,64 +1112,89 @@ class _ChatDetailsPage extends State<ChatDetailsPage>
); );
} }
showCustomDialog(BuildContext context, int position) { ///
showCustomDialog(int position) {
showDialog( showDialog(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return new AlertDialog( return AlertDialog(
backgroundColor: Color(0xFF2A2A2A), // backgroundColor: Color(0xFF2A2A2A),
elevation: 0, // elevation: 0,
contentPadding: EdgeInsets.only( contentPadding: EdgeInsets.only(
top: 8.h, top: 8.h,
bottom: 5.h, bottom: 5.h,
), ),
content: Container( content: Container(
height: 40.h, width: 160.w,
// width:20.w, height:50.h,
alignment: Alignment.center, decoration: BoxDecoration(
color: Color(0xFF2A2A2A),
borderRadius: BorderRadius.circular(6),
),
padding: EdgeInsets.symmetric(
horizontal: 32.w,
vertical: 7.5.h,
),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Column( GestureDetector(
children: [ onTap: () {
Image.asset( setState(() {
"assets/image/icon_chat_copy.webp", copyIndex = 0;
height: 16, this.copy(tex);
width: 16, });
), },
Text( child: Column(
"复制", children: [
textAlign: TextAlign.center, Image.asset(
style: TextStyle( "assets/image/icon_chat_copy.webp",
color: Colors.white, height: 16,
fontSize: 12.sp, width: 16,
fontWeight: MyFontWeight.regular,
), ),
), SizedBox(
], height: 2.h,
),
Text(
"复制",
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
],
),
), ),
Column( GestureDetector(
children: [ onTap: () {},
Image.asset( child: Column(
"assets/image/icon_chat_delete.webp", children: [
height: 16, Image.asset(
width: 16, "assets/image/icon_chat_delete.webp",
), height: 16,
Text( width: 16,
S.of(context).shanchu,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
), ),
), SizedBox(
], height: 2.h,
),
Text(
S.of(context).shanchu,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
],
),
) )
], ],
), ),
), )
); );
}); });
} }

Loading…
Cancel
Save