You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
226 lines
8.0 KiB
226 lines
8.0 KiB
import 'package:common_utils/common_utils.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_markdown/flutter_markdown.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:get/get.dart';
|
|
|
|
import '../controllers/meeting_details_controller.dart';
|
|
import 'speaker_bottom_sheet.dart';
|
|
|
|
class SummaryTab extends GetView<MeetingDetailsController> {
|
|
const SummaryTab({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final isDarkMode = Theme.of(context).brightness == Brightness.dark;
|
|
|
|
return Stack(
|
|
children: [
|
|
SingleChildScrollView(
|
|
padding: EdgeInsets.only(bottom: 80.w),
|
|
child: Obx(
|
|
() => Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Padding(
|
|
padding: EdgeInsets.symmetric(vertical: 10.w),
|
|
child: Text(
|
|
controller.meetingData.value.title,
|
|
style: TextStyle(
|
|
fontSize: 20.sp,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
),
|
|
Row(
|
|
children: [
|
|
Container(
|
|
padding:
|
|
EdgeInsets.symmetric(horizontal: 5.w, vertical: 2.w),
|
|
margin: EdgeInsets.only(right: 10.w),
|
|
decoration: BoxDecoration(
|
|
color: isDarkMode ? Colors.grey[900] : Colors.grey[200],
|
|
borderRadius: BorderRadius.circular(4.w),
|
|
),
|
|
child: Text(
|
|
controller.meetingData.value.type,
|
|
style: TextStyle(
|
|
color:
|
|
isDarkMode ? Colors.grey[400] : Colors.grey[500],
|
|
fontSize: 10.sp,
|
|
),
|
|
),
|
|
),
|
|
Icon(
|
|
Icons.calendar_month,
|
|
size: 14.w,
|
|
color: isDarkMode ? Colors.grey[400] : Colors.grey[500],
|
|
),
|
|
2.horizontalSpace,
|
|
Text(
|
|
DateUtil.formatDateMs(
|
|
controller.meetingData.value.creationtime,
|
|
format: DateFormats.y_mo_d_h_m,
|
|
),
|
|
style: TextStyle(
|
|
color: isDarkMode ? Colors.grey[400] : Colors.grey[500],
|
|
fontSize: 12.sp,
|
|
),
|
|
),
|
|
10.horizontalSpace,
|
|
Icon(
|
|
Icons.access_time,
|
|
size: 14.w,
|
|
color: isDarkMode ? Colors.grey[400] : Colors.grey[500],
|
|
),
|
|
2.horizontalSpace,
|
|
Text(
|
|
'${controller.meetingData.value.seconds}s',
|
|
style: TextStyle(
|
|
color: isDarkMode ? Colors.grey[400] : Colors.grey[500],
|
|
fontSize: 12.sp,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
Padding(
|
|
padding: EdgeInsets.symmetric(vertical: 10.w),
|
|
child: Divider(
|
|
height: 1,
|
|
color: isDarkMode ? Colors.grey[900] : Colors.grey[300],
|
|
),
|
|
),
|
|
Container(
|
|
padding: EdgeInsets.only(left: 20.w),
|
|
margin: EdgeInsets.symmetric(vertical: 10.w),
|
|
decoration: BoxDecoration(
|
|
border: Border(
|
|
left: BorderSide(
|
|
width: 2,
|
|
color: isDarkMode
|
|
? Colors.white.withOpacity(0.1)
|
|
: Colors.grey[300]!,
|
|
),
|
|
),
|
|
),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
'日期和时间:${DateUtil.formatDateMs(
|
|
controller.meetingData.value.creationtime,
|
|
format: DateFormats.y_mo_d_h_m,
|
|
)}',
|
|
style: TextStyle(
|
|
color:
|
|
isDarkMode ? Colors.grey[400] : Colors.grey[700],
|
|
fontSize: 16.sp,
|
|
),
|
|
),
|
|
Text(
|
|
'地点:${controller.meetingDetails.value.address.isNotEmpty ? controller.meetingDetails.value.address : '[输入地点]'}',
|
|
style: TextStyle(
|
|
color:
|
|
isDarkMode ? Colors.grey[400] : Colors.grey[700],
|
|
fontSize: 16.sp,
|
|
),
|
|
),
|
|
Text(
|
|
'与会人员:${controller.meetingDetails.value.address}',
|
|
style: TextStyle(
|
|
color:
|
|
isDarkMode ? Colors.grey[400] : Colors.grey[700],
|
|
fontSize: 16.sp,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
Padding(
|
|
padding: EdgeInsets.only(top: 10.w),
|
|
child: MarkdownBody(
|
|
data: controller.meetingDetails.value.summary,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
Obx(
|
|
() => Positioned(
|
|
bottom: 20.w,
|
|
left: 0,
|
|
right: 0,
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
if (controller.meetingDetails.value.summary.isNotEmpty)
|
|
_button(
|
|
Icons.supervisor_account,
|
|
'编辑发言者',
|
|
() {
|
|
showModalBottomSheet(
|
|
context: context,
|
|
isScrollControlled: true,
|
|
backgroundColor: Colors.grey[100],
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.vertical(
|
|
top: Radius.circular(12.r),
|
|
),
|
|
),
|
|
builder: (BuildContext context) {
|
|
return const SpeakerBottomSheet();
|
|
},
|
|
);
|
|
},
|
|
),
|
|
if (controller.meetingDetails.value.summary.isEmpty)
|
|
SizedBox(
|
|
width: 150.w,
|
|
child: _button(
|
|
Icons.auto_awesome,
|
|
'生成',
|
|
controller.summaryCreate,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
|
|
Widget _button(IconData icon, String title, Function() onTap) {
|
|
return GestureDetector(
|
|
onTap: onTap,
|
|
child: Container(
|
|
height: 42.w,
|
|
padding: EdgeInsets.symmetric(horizontal: 15.w),
|
|
margin: EdgeInsets.symmetric(horizontal: 4.w),
|
|
decoration: BoxDecoration(
|
|
color: Colors.black,
|
|
borderRadius: BorderRadius.circular(42.w),
|
|
),
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
Icon(
|
|
icon,
|
|
color: Colors.white,
|
|
size: 20.sp,
|
|
),
|
|
5.horizontalSpace,
|
|
Text(
|
|
title,
|
|
style: TextStyle(
|
|
color: Colors.white,
|
|
fontSize: 14.sp,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|