diff --git a/lib/modules/meeting/views/overview_tab.dart b/lib/modules/meeting/views/overview_tab.dart index 8210352c7..3f65ed1a9 100644 --- a/lib/modules/meeting/views/overview_tab.dart +++ b/lib/modules/meeting/views/overview_tab.dart @@ -1,7 +1,10 @@ +import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import '../controllers/meeting_details_controller.dart'; +import 'generate_bottom_sheet.dart'; class OverviewTab extends StatefulWidget { const OverviewTab({super.key}); @@ -13,14 +16,194 @@ class OverviewTab extends StatefulWidget { class _OverviewTabState extends State { final _controller = Get.find(); + List _dataList = []; + + @override + void initState() { + super.initState(); + if (_controller.meetingDetails.value.overview.isNotEmpty) { + _dataList = _controller.meetingDetails.value.overview.split('\n'); + } + } + @override Widget build(BuildContext context) { - return SingleChildScrollView( + return Stack( + children: [ + _dataList.isNotEmpty + ? Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(top: 5.w), + child: Text( + DateUtil.formatDateMs( + _controller.meetingData.value.creationtime, + format: DateFormats.y_mo_d_h_m, + ), + style: TextStyle( + color: Colors.black54, + fontSize: 12.sp, + ), + ), + ), + Padding( + padding: EdgeInsets.symmetric(vertical: 10.w), + child: Text( + _controller.meetingData.value.title, + style: TextStyle( + fontSize: 20.sp, + fontWeight: FontWeight.bold, + ), + ), + ), + Padding( + padding: EdgeInsets.symmetric(vertical: 10.w), + child: Divider( + height: 1, + color: Colors.grey[300], + ), + ), + Padding( + padding: EdgeInsets.symmetric(vertical: 10.w), + child: Text( + '分析出${_dataList.length}个关键事件。', + style: TextStyle( + color: Colors.grey, + fontSize: 12.sp, + ), + ), + ), + Expanded( + child: ListView.builder( + itemCount: _dataList.length, + padding: EdgeInsets.fromLTRB(10.w, 10.w, 10.w, 80.w), + itemBuilder: (BuildContext context, int index) { + return _item(_dataList[index]); + }, + ), + ), + ], + ) + : _empty(), + Obx( + () => Positioned( + bottom: 20.w, + left: 0, + right: 0, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + if (_controller.meetingDetails.value.tasktype == 0) + SizedBox( + width: 150.w, + child: _button( + Icons.auto_awesome, + '生成', + () { + Get.bottomSheet( + const GenerateBottomSheet(), + isScrollControlled: true, + backgroundColor: Colors.grey[100], + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.vertical( + top: Radius.circular(12.r), + ), + ), + ); + }, + ), + ), + ], + ), + ), + ), + ], + ); + } + + Widget _item(String data) { + return Container( + padding: EdgeInsets.all(10.w), + margin: EdgeInsets.symmetric(vertical: 5.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12.w), + boxShadow: const [ + BoxShadow( + color: Color(0x1A3045C8), + offset: Offset(0.0, 0.0), + blurRadius: 10, + spreadRadius: 0.0, + ), + ], + ), + child: Text(data), + ); + } + + 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, + ), + ), + ], + ), + ), + ); + } + + Widget _empty() { + return Padding( + padding: EdgeInsets.symmetric(horizontal: 20.w, vertical: 30.w), child: Column( children: [ - Text('概览'), - Text('AI分析识别录音中的关键事件,让你选择重要事件进行AI生成。'), - Text(_controller.meetingDetails.value.overview), + Padding( + padding: EdgeInsets.only(bottom: 10.w), + child: Icon( + Icons.summarize, + color: Colors.grey, + size: 40.sp, + ), + ), + Text( + '概览', + style: TextStyle( + color: Colors.black87, + fontSize: 18.sp, + fontWeight: FontWeight.bold, + ), + ), + Text( + 'AI分析识别录音中的关键事件,让你选择重要事件进行AI生成。', + style: TextStyle( + color: Colors.grey, + fontSize: 14.sp, + ), + textAlign: TextAlign.center, + ), ], ), );