11 changed files with 471 additions and 150 deletions
Split View
Diff Options
-
BINassets/images/avatar_pendant.png
-
BINassets/images/join_room_icon.png
-
BINassets/images/matchmaker_tag.png
-
3lib/generated/assets.dart
-
225lib/im/im_manager.dart
-
49lib/pages/discover/settlement_page.dart
-
1lib/pages/mine/my_wallet_page.dart
-
142lib/widget/live/live_room_notice_chat_panel.dart
-
4lib/widget/live/live_room_user_header.dart
-
34lib/widget/live/live_room_user_profile_dialog.dart
-
163lib/widget/live/today_task_dialog.dart
@ -0,0 +1,163 @@ |
|||
import 'package:dating_touchme_app/controller/discover/room_controller.dart'; |
|||
import 'package:dating_touchme_app/extension/ex_widget.dart'; |
|||
import 'package:dating_touchme_app/model/discover/task_data.dart'; |
|||
import 'package:dating_touchme_app/pages/discover/task_detail.dart'; |
|||
import 'package:flutter/material.dart'; |
|||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; |
|||
import 'package:get/get.dart'; |
|||
import 'package:tdesign_flutter/tdesign_flutter.dart'; |
|||
|
|||
class TodayTaskDialog extends StatefulWidget { |
|||
const TodayTaskDialog({super.key}); |
|||
|
|||
@override |
|||
State<TodayTaskDialog> createState() => _TodayTaskDialogState(); |
|||
} |
|||
|
|||
class _TodayTaskDialogState extends State<TodayTaskDialog> { |
|||
@override |
|||
Widget build(BuildContext context) { |
|||
|
|||
final roomController = Get.find<RoomController>(); |
|||
return ClipRRect( |
|||
borderRadius: BorderRadius.vertical(top: Radius.circular(9.w)), |
|||
child: Material( |
|||
color: Colors.white, |
|||
child: Container( |
|||
width: 375.w, |
|||
height: 336.w, |
|||
decoration: BoxDecoration( |
|||
gradient: LinearGradient( |
|||
begin: Alignment.topCenter, |
|||
end: Alignment.bottomCenter, |
|||
colors: [ |
|||
Color.fromRGBO(236, 224, 255, 1), // 0% |
|||
Color.fromRGBO(247, 247, 247, 1), // 100% |
|||
], |
|||
), |
|||
), |
|||
child: Column( |
|||
children: [ |
|||
SizedBox( |
|||
height: 77.w, |
|||
child: Row( |
|||
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|||
children: [ |
|||
Container( |
|||
width: 68.w, |
|||
padding: EdgeInsets.only(left: 15.w), |
|||
alignment: Alignment.centerLeft, |
|||
child: Icon( |
|||
Icons.keyboard_arrow_left, |
|||
size: 26.w, |
|||
color: const Color.fromRGBO(144, 144, 144, 1), |
|||
), |
|||
), |
|||
Text( |
|||
"今日任务", |
|||
style: TextStyle( |
|||
fontSize: 21.w, |
|||
fontWeight: FontWeight.w700 |
|||
), |
|||
), |
|||
Container( |
|||
width: 68.w, |
|||
height: 22.w, |
|||
decoration: BoxDecoration( |
|||
borderRadius: BorderRadius.horizontal(left: Radius.circular(22.w)), |
|||
color: Colors.white |
|||
), |
|||
child: Center( |
|||
child: Text( |
|||
"任务详情", |
|||
style: TextStyle( |
|||
fontSize: 12.w, |
|||
color: const Color.fromRGBO(144, 144, 144, 1) |
|||
), |
|||
), |
|||
), |
|||
).onTap(() async { |
|||
// 隐藏键盘 |
|||
FocusScope.of(context).unfocus(); |
|||
// 隐藏 overlay |
|||
await SmartDialog.dismiss(); |
|||
Get.to(() => TaskDetail()); |
|||
}) |
|||
], |
|||
), |
|||
), |
|||
SingleChildScrollView( |
|||
child: Container( |
|||
padding: EdgeInsets.symmetric(horizontal: 12.w), |
|||
child: Column( |
|||
children: [ |
|||
...roomController.taskData.value.subList!.map((e){ |
|||
return TaskItem(item: e,); |
|||
}) |
|||
], |
|||
), |
|||
), |
|||
) |
|||
], |
|||
), |
|||
), |
|||
), |
|||
); |
|||
} |
|||
} |
|||
|
|||
|
|||
class TaskItem extends StatefulWidget { |
|||
final SubList item; |
|||
const TaskItem({super.key, required this.item}); |
|||
|
|||
@override |
|||
State<TaskItem> createState() => _TaskItemState(); |
|||
} |
|||
|
|||
class _TaskItemState extends State<TaskItem> { |
|||
@override |
|||
Widget build(BuildContext context) { |
|||
return Container( |
|||
width: 350.w, |
|||
margin: EdgeInsets.only(bottom: 10.w), |
|||
padding: EdgeInsets.only( |
|||
top: 15.w, |
|||
right: 10.w, |
|||
bottom: 21.w, |
|||
left: 12.w |
|||
), |
|||
child: Column( |
|||
children: [ |
|||
Row( |
|||
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|||
children: [ |
|||
Text( |
|||
widget.item.subTaskDesc ?? "", |
|||
style: TextStyle( |
|||
fontSize: 14.w |
|||
), |
|||
), |
|||
Text( |
|||
"${widget.item.completeCount ?? ""}/${widget.item.requiredCount ?? ""}${widget.item.sort == 1 ? "分钟" : widget.item.sort == 2 ? "对" : "人"}", |
|||
style: TextStyle( |
|||
fontSize: 12.w, |
|||
color: const Color.fromRGBO(144, 144, 144, 1) |
|||
), |
|||
) |
|||
], |
|||
), |
|||
SizedBox(height: 10.w,), |
|||
TDProgress( |
|||
type: TDProgressType.linear, |
|||
value: ((widget.item.completeCount ?? 0) / (widget.item.requiredCount ?? 0)), |
|||
strokeWidth: 6, |
|||
progressLabelPosition: TDProgressLabelPosition.inside, |
|||
showLabel: false, |
|||
) |
|||
], |
|||
), |
|||
); |
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save