|
|
@ -7,6 +7,7 @@ import 'package:dating_touchme_app/model/home/post_comment_data.dart'; |
|
|
import 'package:dating_touchme_app/pages/home/report_page.dart'; |
|
|
import 'package:dating_touchme_app/pages/home/report_page.dart'; |
|
|
import 'package:dating_touchme_app/pages/home/user_information_page.dart'; |
|
|
import 'package:dating_touchme_app/pages/home/user_information_page.dart'; |
|
|
import 'package:easy_refresh/easy_refresh.dart'; |
|
|
import 'package:easy_refresh/easy_refresh.dart'; |
|
|
|
|
|
import 'package:flutter/foundation.dart'; |
|
|
import 'package:flutter/material.dart'; |
|
|
import 'package:flutter/material.dart'; |
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
import 'package:get/get.dart'; |
|
|
import 'package:get/get.dart'; |
|
|
@ -45,6 +46,33 @@ class TimelineInfo extends StatelessWidget { |
|
|
color: const Color.fromRGBO(51, 51, 51, 1) |
|
|
color: const Color.fromRGBO(51, 51, 51, 1) |
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
|
|
|
actions: [ |
|
|
|
|
|
Container( |
|
|
|
|
|
margin: EdgeInsets.only(right: 14.w), |
|
|
|
|
|
child: PopupMenuButton<String>( |
|
|
|
|
|
tooltip: "", |
|
|
|
|
|
padding: EdgeInsets.zero, |
|
|
|
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14)), |
|
|
|
|
|
color: Colors.white, |
|
|
|
|
|
elevation: 8, |
|
|
|
|
|
offset: Offset(0, 32.w), // 相对按钮下移一点 |
|
|
|
|
|
itemBuilder: (context) => [ |
|
|
|
|
|
const PopupMenuItem(value: 'report', child: Text('举报')), |
|
|
|
|
|
], |
|
|
|
|
|
onSelected: (v) { |
|
|
|
|
|
if (v == 'report') { |
|
|
|
|
|
print("举报"); |
|
|
|
|
|
Get.to(() => ReportPage(id: id,)); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
child: Icon( |
|
|
|
|
|
Icons.keyboard_control, |
|
|
|
|
|
size: 24.w, |
|
|
|
|
|
color: const Color.fromRGBO(51, 51, 51, 1), |
|
|
|
|
|
), // 你的小圆按钮 |
|
|
|
|
|
), |
|
|
|
|
|
) |
|
|
|
|
|
], |
|
|
), |
|
|
), |
|
|
body: Stack( |
|
|
body: Stack( |
|
|
children: [ |
|
|
children: [ |
|
|
@ -138,28 +166,7 @@ class TimelineInfo extends StatelessWidget { |
|
|
) |
|
|
) |
|
|
], |
|
|
], |
|
|
), |
|
|
), |
|
|
PopupMenuButton<String>( |
|
|
|
|
|
tooltip: "", |
|
|
|
|
|
padding: EdgeInsets.zero, |
|
|
|
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14)), |
|
|
|
|
|
color: Colors.white, |
|
|
|
|
|
elevation: 8, |
|
|
|
|
|
offset: Offset(0, 32.w), // 相对按钮下移一点 |
|
|
|
|
|
itemBuilder: (context) => [ |
|
|
|
|
|
const PopupMenuItem(value: 'report', child: Text('举报')), |
|
|
|
|
|
], |
|
|
|
|
|
onSelected: (v) { |
|
|
|
|
|
if (v == 'report') { |
|
|
|
|
|
print("举报"); |
|
|
|
|
|
Get.to(() => ReportPage(id: id,)); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
child: Icon( |
|
|
|
|
|
Icons.keyboard_control, |
|
|
|
|
|
size: 15.w, |
|
|
|
|
|
color: const Color.fromRGBO(51, 51, 51, 1), |
|
|
|
|
|
), // 你的小圆按钮 |
|
|
|
|
|
), |
|
|
|
|
|
|
|
|
|
|
|
], |
|
|
], |
|
|
), |
|
|
), |
|
|
Container( |
|
|
Container( |
|
|
@ -247,7 +254,9 @@ class TimelineInfo extends StatelessWidget { |
|
|
) |
|
|
) |
|
|
], |
|
|
], |
|
|
).onTap((){ |
|
|
).onTap((){ |
|
|
controller.showInput.value = true; |
|
|
|
|
|
|
|
|
controller.focusNode.value.requestFocus(); |
|
|
|
|
|
|
|
|
|
|
|
// controller.update(); |
|
|
|
|
|
|
|
|
}), |
|
|
}), |
|
|
], |
|
|
], |
|
|
@ -271,15 +280,36 @@ class TimelineInfo extends StatelessWidget { |
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
if(controller.showInput.value) Positioned.fill( |
|
|
|
|
|
child: Container( |
|
|
|
|
|
color: const Color.fromRGBO(0, 0, 0, .4), |
|
|
|
|
|
).onTap((){ |
|
|
|
|
|
controller.showInput.value = false; |
|
|
|
|
|
|
|
|
// if(controller.showInput.value) Positioned.fill( |
|
|
|
|
|
// child: Container( |
|
|
|
|
|
// color: const Color.fromRGBO(0, 0, 0, .4), |
|
|
|
|
|
// ).onTap((){ |
|
|
|
|
|
// controller.showInput.value = false; |
|
|
|
|
|
// FocusScope.of(context).unfocus(); |
|
|
|
|
|
// |
|
|
|
|
|
// }), |
|
|
|
|
|
// ), |
|
|
|
|
|
ListenableBuilder( |
|
|
|
|
|
listenable: controller.focusNode.value, // 直接监听焦点节点 |
|
|
|
|
|
builder: (context, child) { |
|
|
|
|
|
// 只有当焦点状态改变时,这段 builder 才会运行 |
|
|
|
|
|
return Visibility( |
|
|
|
|
|
visible: controller.focusNode.value.hasFocus, |
|
|
|
|
|
child: GestureDetector( |
|
|
|
|
|
onTap: () { |
|
|
|
|
|
|
|
|
}), |
|
|
|
|
|
|
|
|
FocusScope.of(context).unfocus(); |
|
|
|
|
|
controller.parentId.value = "0"; |
|
|
|
|
|
}, |
|
|
|
|
|
child: Container( |
|
|
|
|
|
color: const Color.fromRGBO(0, 0, 0, .4), |
|
|
|
|
|
// 这里放遮罩层的内容 |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
); |
|
|
|
|
|
}, |
|
|
), |
|
|
), |
|
|
if(controller.showInput.value) Positioned( |
|
|
|
|
|
|
|
|
Positioned( |
|
|
left: 0, |
|
|
left: 0, |
|
|
bottom: 0, |
|
|
bottom: 0, |
|
|
child: Container( |
|
|
child: Container( |
|
|
@ -296,8 +326,8 @@ class TimelineInfo extends StatelessWidget { |
|
|
borderRadius: BorderRadius.all(Radius.circular(40.w)) |
|
|
borderRadius: BorderRadius.all(Radius.circular(40.w)) |
|
|
), |
|
|
), |
|
|
child: TextField( |
|
|
child: TextField( |
|
|
|
|
|
focusNode: controller.focusNode.value, |
|
|
controller: controller.messageController.value, |
|
|
controller: controller.messageController.value, |
|
|
autofocus: true, |
|
|
|
|
|
style: TextStyle( |
|
|
style: TextStyle( |
|
|
fontSize: ScreenUtil().setWidth(14), |
|
|
fontSize: ScreenUtil().setWidth(14), |
|
|
height: 1 |
|
|
height: 1 |
|
|
@ -437,7 +467,10 @@ class _CommentItemState extends State<CommentItem> { |
|
|
), |
|
|
), |
|
|
).onTap((){ |
|
|
).onTap((){ |
|
|
widget.controller.parentId.value = widget.item.id ?? "0"; |
|
|
widget.controller.parentId.value = widget.item.id ?? "0"; |
|
|
widget.controller.showInput.value = true; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
widget.controller.focusNode.value.requestFocus(); |
|
|
|
|
|
|
|
|
}), |
|
|
}), |
|
|
], |
|
|
], |
|
|
), |
|
|
), |
|
|
|