diff --git a/lib/modules/meeting/views/bottomSheet/statistics_bottom_sheet.dart b/lib/modules/meeting/views/bottomSheet/statistics_bottom_sheet.dart new file mode 100644 index 000000000..772acae49 --- /dev/null +++ b/lib/modules/meeting/views/bottomSheet/statistics_bottom_sheet.dart @@ -0,0 +1,265 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +class StatisticsBottomSheet extends StatefulWidget { + const StatisticsBottomSheet({super.key}); + + @override + State createState() => _StatisticsBottomSheetState(); +} + +class _StatisticsBottomSheetState extends State { + @override + Widget build(BuildContext context) { + return Stack( + children: [ + GestureDetector( + onTap: () => Get.back(), + behavior: HitTestBehavior.translucent, + child: SizedBox( + width: 1.sw, + height: 1.sh, + ), + ), + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + padding: EdgeInsets.symmetric(horizontal: 15.w, vertical: 20.w), + margin: EdgeInsets.symmetric(horizontal: 10.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(16.w), + image: const DecorationImage( + alignment: Alignment.topCenter, + image: AssetImage('assets/images/mine-background.png'), + fit: BoxFit.fitWidth, + ), + ), + child: Column( + children: [ + Container( + width: 50.w, + height: 50.w, + margin: EdgeInsets.only(bottom: 10.w), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(50.w), + image: const DecorationImage( + image: NetworkImage( + 'https://pic8.iqiyipic.com/image/20250403/ed/a7/a_100013977_m_601_m75_318_424.avif'), + fit: BoxFit.cover, + ), + ), + ), + Text( + 'tianming liu', + style: TextStyle( + color: Colors.black87, + fontSize: 20.sp, + fontWeight: FontWeight.bold, + ), + ), + Padding( + padding: EdgeInsets.symmetric(vertical: 20.w), + child: Wrap( + spacing: 5.w, + runSpacing: 5.w, + children: [ + _item('天', '1', Colors.amber), + _item('文件', '3', Colors.blueGrey), + _item('小时', '0.2', Colors.cyan), + _item('连续录音天数', '1', Colors.deepOrangeAccent), + _item('单日最多录音', '3', Colors.teal), + _item('单日最长录音', '0.2', Colors.pink), + ], + ), + ), + Row( + children: [ + Text( + '过去12个月的热力图', + style: TextStyle( + color: Colors.grey, + fontSize: 12.sp, + ), + ), + const Spacer(), + Text( + '较冷', + style: TextStyle( + color: Colors.grey, + fontSize: 12.sp, + ), + ), + 5.horizontalSpace, + Container( + width: 10.w, + height: 10.w, + margin: EdgeInsets.symmetric(horizontal: 1.w), + decoration: BoxDecoration( + color: Colors.grey[200], + borderRadius: BorderRadius.circular(2.w), + ), + ), + Container( + width: 10.w, + height: 10.w, + margin: EdgeInsets.symmetric(horizontal: 1.w), + decoration: BoxDecoration( + color: Colors.red[100], + borderRadius: BorderRadius.circular(2.w), + ), + ), + Container( + width: 10.w, + height: 10.w, + margin: EdgeInsets.symmetric(horizontal: 1.w), + decoration: BoxDecoration( + color: Colors.red, + borderRadius: BorderRadius.circular(2.w), + ), + ), + 5.horizontalSpace, + Text( + '较热', + style: TextStyle( + color: Colors.grey, + fontSize: 12.sp, + ), + ), + ], + ), + Container( + height: 50.w, + alignment: Alignment.center, + child: GridView.builder( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 52, + mainAxisSpacing: 1.w, + crossAxisSpacing: 1.w, + ), + itemCount: 364, + itemBuilder: (BuildContext context, int index) { + return Container( + color: Colors.grey[200], + ); + }, + ), + ), + DefaultTextStyle( + style: TextStyle( + color: Colors.grey, + fontSize: 10.sp, + ), + child: const Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Text('Jan'), + Text('Feb'), + Text('Mar'), + Text('Apr'), + Text('May'), + Text('Jun'), + Text('Jul'), + Text('Aug'), + Text('Sep'), + Text('Oct'), + Text('Nov'), + Text('Dec'), + ], + ), + ), + ], + ), + ), + SizedBox(height: 10.w), + Padding( + padding: EdgeInsets.symmetric(horizontal: 10.w), + child: Row( + children: [ + _button(Icons.share, '分享图片', Colors.deepOrange, () {}), + 10.horizontalSpace, + _button(Icons.download, '保存图片', Colors.cyan, () {}), + ], + ), + ), + ], + ), + ], + ); + } + + Widget _item(String unit, String amount, Color color) { + return Container( + width: 105.w, + height: 70.w, + padding: EdgeInsets.all(10.w), + decoration: BoxDecoration( + color: color.withOpacity(0.2), + borderRadius: BorderRadius.circular(8.w), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + unit, + style: TextStyle( + color: Colors.grey, + fontSize: 12.sp, + ), + ), + Text( + amount, + style: TextStyle( + color: Colors.black87, + fontSize: 18.sp, + fontWeight: FontWeight.bold, + ), + ), + ], + ), + ); + } + + Widget _button(IconData icon, String title, Color color, Function() onTap) { + return Expanded( + child: GestureDetector( + onTap: onTap, + child: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(16.w), + ), + child: Container( + height: 60.w, + decoration: BoxDecoration( + color: color.withOpacity(0.1), + borderRadius: BorderRadius.circular(16.w), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon( + icon, + size: 25.w, + ), + 5.horizontalSpace, + Text( + title, + style: TextStyle( + color: Colors.black87, + fontSize: 16.sp, + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/modules/meeting/views/meeting_mine_view.dart b/lib/modules/meeting/views/meeting_mine_view.dart index 40fcf6c6e..7d97abf27 100644 --- a/lib/modules/meeting/views/meeting_mine_view.dart +++ b/lib/modules/meeting/views/meeting_mine_view.dart @@ -1,5 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import 'bottomSheet/statistics_bottom_sheet.dart'; class MeetingMineView extends StatefulWidget { const MeetingMineView({super.key}); @@ -135,45 +138,53 @@ class _MeetingMineViewState extends State { } Widget _statistics() { - return Container( - padding: EdgeInsets.all(8.w), - margin: EdgeInsets.only(bottom: 15.w), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(16.w), - ), - child: Column( - children: [ - Row( - children: [ - _statisticsItem('2', '天', Colors.lime), - _statisticsItem('4', '文件', Colors.lightGreen), - _statisticsItem('1.5', '小时', Colors.blueGrey), - ], - ), - Container( - height: 80.w, - padding: EdgeInsets.symmetric(horizontal: 2.w), - margin: EdgeInsets.only(top: 8.w, bottom: 2.w), - child: GridView.builder( - scrollDirection: Axis.horizontal, - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 7, - mainAxisSpacing: 2.w, - crossAxisSpacing: 2.w, + return GestureDetector( + onTap: () { + Get.bottomSheet( + const StatisticsBottomSheet(), + isScrollControlled: true, + ); + }, + child: Container( + padding: EdgeInsets.all(8.w), + margin: EdgeInsets.only(bottom: 15.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(16.w), + ), + child: Column( + children: [ + Row( + children: [ + _statisticsItem('2', '天', Colors.lime), + _statisticsItem('4', '文件', Colors.lightGreen), + _statisticsItem('1.5', '小时', Colors.blueGrey), + ], + ), + Container( + height: 80.w, + padding: EdgeInsets.symmetric(horizontal: 2.w), + margin: EdgeInsets.only(top: 8.w, bottom: 2.w), + child: GridView.builder( + scrollDirection: Axis.horizontal, + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 7, + mainAxisSpacing: 2.w, + crossAxisSpacing: 2.w, + ), + itemCount: 364, + itemBuilder: (BuildContext context, int index) { + return Container( + decoration: BoxDecoration( + color: Colors.grey[200], + borderRadius: BorderRadius.circular(2.w), + ), + ); + }, ), - itemCount: 364, - itemBuilder: (BuildContext context, int index) { - return Container( - decoration: BoxDecoration( - color: Colors.grey[200], - borderRadius: BorderRadius.circular(2.w), - ), - ); - }, ), - ), - ], + ], + ), ), ); }