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.
439 lines
13 KiB
439 lines
13 KiB
import 'package:flutter/material.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:get/get.dart';
|
|
import '../../../routes/app_routes.dart';
|
|
import '../../profile/views/unified_avatar.dart';
|
|
|
|
import '../controllers/meeting_mine_controller.dart';
|
|
import '../utils/meeting_ui_utils.dart';
|
|
import 'bottomSheet/statistics_bottom_sheet.dart';
|
|
|
|
class MeetingMineView extends StatefulWidget {
|
|
const MeetingMineView({super.key});
|
|
|
|
@override
|
|
State<MeetingMineView> createState() => _MeetingMineViewState();
|
|
}
|
|
|
|
class _MeetingMineViewState extends State<MeetingMineView>
|
|
with AutomaticKeepAliveClientMixin {
|
|
final _controller = Get.put(MeetingMineController());
|
|
|
|
@override
|
|
bool get wantKeepAlive => true;
|
|
|
|
// 添加 isDarkMode 作为类的 getter
|
|
bool get isDarkMode => Theme.of(context).brightness == Brightness.dark;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
super.build(context);
|
|
return Scaffold(
|
|
backgroundColor: MeetingUIUtils.getBackgroundColor(isDarkMode),
|
|
body: Container(
|
|
decoration: const BoxDecoration(
|
|
image: DecorationImage(
|
|
alignment: Alignment.topCenter,
|
|
image: AssetImage('assets/images/mine-background.png'),
|
|
fit: BoxFit.fitWidth,
|
|
),
|
|
),
|
|
child: SafeArea(
|
|
child: ListView(
|
|
padding: EdgeInsets.symmetric(horizontal: 12.w),
|
|
children: [
|
|
_head(),
|
|
_statistics(),
|
|
_member(),
|
|
_box([
|
|
_item(
|
|
Icons.article_outlined,
|
|
'转写记录',
|
|
onTap: () {},
|
|
),
|
|
]),
|
|
_box([
|
|
_item(
|
|
Icons.settings_outlined,
|
|
'设置',
|
|
onTap: () {},
|
|
),
|
|
_item(
|
|
Icons.layers_outlined,
|
|
'模版社区',
|
|
onTap: () {},
|
|
),
|
|
_item(
|
|
Icons.sync_alt_outlined,
|
|
'集成',
|
|
onTap: () {},
|
|
),
|
|
]),
|
|
_box([
|
|
_item(
|
|
Icons.cloud_upload_outlined,
|
|
'DEAPSOUND PRIVATE CLOUD',
|
|
description: '开启',
|
|
onTap: () {},
|
|
),
|
|
]),
|
|
_box([
|
|
_item(
|
|
Icons.language_outlined,
|
|
'WEB',
|
|
description: 'web.deapsound.com',
|
|
onTap: () {},
|
|
),
|
|
_item(
|
|
Icons.settings_remote_outlined,
|
|
'我的DEAPSOUND设备',
|
|
onTap: () {},
|
|
),
|
|
]),
|
|
_box([
|
|
_item(
|
|
Icons.help_outline_rounded,
|
|
'帮助与反馈',
|
|
onTap: () {},
|
|
),
|
|
_item(
|
|
Icons.info_outline_rounded,
|
|
'关于DEAPSOUND',
|
|
description: 'v1.0.0',
|
|
onTap: () {},
|
|
),
|
|
]),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget _head() {
|
|
return Padding(
|
|
padding: EdgeInsets.symmetric(vertical: 20.w),
|
|
child: GestureDetector(
|
|
onTap: () => Get.toNamed(Routes.profileMeeting), // 跳转到个人信息页面
|
|
child: Row(
|
|
children: [
|
|
// 使用统一头像组件,避免闪烁问题
|
|
Container(
|
|
margin: EdgeInsets.only(right: 10.w),
|
|
child: UnifiedAvatar(
|
|
radius: 25.w,
|
|
backgroundColor: Colors.grey[200],
|
|
iconColor: Colors.grey[600],
|
|
iconSize: 25.r,
|
|
isDarkMode: isDarkMode,
|
|
),
|
|
),
|
|
Expanded(
|
|
child: Obx(
|
|
() => Text(
|
|
_controller.profileCtrl.userInfo.value.name,
|
|
style: TextStyle(
|
|
color: isDarkMode ? Colors.white : Colors.black87,
|
|
fontSize: 20.sp,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
Icon(
|
|
Icons.arrow_forward_ios,
|
|
size: 16.w,
|
|
color: Colors.grey[700],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget _statistics() {
|
|
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: MeetingUIUtils.getCardColor(isDarkMode),
|
|
borderRadius: BorderRadius.circular(16.w),
|
|
boxShadow: MeetingUIUtils.getCardShadow(isDarkMode),
|
|
),
|
|
child: Obx(
|
|
() => Column(
|
|
children: [
|
|
Row(
|
|
children: [
|
|
_statisticsItem(
|
|
'${_controller.days.value}',
|
|
'天',
|
|
Colors.lime,
|
|
),
|
|
_statisticsItem(
|
|
'${_controller.numberFiles.value}',
|
|
'文件',
|
|
Colors.lightGreen,
|
|
),
|
|
_statisticsItem(
|
|
'${_controller.hourage.value}',
|
|
'小时',
|
|
Colors.blueGrey,
|
|
),
|
|
],
|
|
),
|
|
Container(
|
|
height: 80.w,
|
|
padding: EdgeInsets.symmetric(horizontal: 2.w),
|
|
margin: EdgeInsets.only(top: 8.w, bottom: 2.w),
|
|
child: GridView.builder(
|
|
controller: _controller.scrollController,
|
|
scrollDirection: Axis.horizontal,
|
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
|
crossAxisCount: 7,
|
|
mainAxisSpacing: 2.w,
|
|
crossAxisSpacing: 2.w,
|
|
),
|
|
itemCount: 364,
|
|
itemBuilder: (BuildContext context, int index) {
|
|
int type = 0;
|
|
if (_controller.statistics.containsKey(index + 1)) {
|
|
if (_controller.statistics[index + 1]['count'] <=
|
|
_controller.averageNumberFiles) {
|
|
type = 1;
|
|
} else {
|
|
type = 2;
|
|
}
|
|
}
|
|
return Container(
|
|
decoration: BoxDecoration(
|
|
color: type == 0
|
|
? Colors.grey[200]
|
|
: type == 1
|
|
? Colors.red[100]
|
|
: Colors.red,
|
|
borderRadius: BorderRadius.circular(2.w),
|
|
),
|
|
);
|
|
},
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget _statisticsItem(String amount, String unit, Color color) {
|
|
return Expanded(
|
|
child: Container(
|
|
height: 30.w,
|
|
margin: EdgeInsets.symmetric(horizontal: 2.w),
|
|
alignment: Alignment.center,
|
|
decoration: BoxDecoration(
|
|
color: color.withValues(alpha: 0.2),
|
|
borderRadius: BorderRadius.circular(8.w),
|
|
),
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
children: [
|
|
Text(
|
|
amount,
|
|
style: TextStyle(
|
|
height: 0.1,
|
|
color: isDarkMode ? Colors.white : Colors.black87,
|
|
fontSize: 16.sp,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
2.horizontalSpace,
|
|
Text(
|
|
unit,
|
|
style: TextStyle(
|
|
height: 0.1,
|
|
color: Colors.grey,
|
|
fontSize: 10.sp,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget _member() {
|
|
return Container(
|
|
margin: EdgeInsets.only(bottom: 15.w),
|
|
decoration: BoxDecoration(
|
|
color: MeetingUIUtils.getCardColor(isDarkMode),
|
|
borderRadius: BorderRadius.circular(16.w),
|
|
),
|
|
child: Column(
|
|
children: [
|
|
Padding(
|
|
padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 10.w),
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
Text(
|
|
'DEAPSOUND AI会员',
|
|
style: TextStyle(
|
|
color: MeetingUIUtils.getTextColor(isDarkMode),
|
|
fontSize: 16.sp,
|
|
),
|
|
),
|
|
Icon(
|
|
Icons.arrow_forward_ios,
|
|
size: 16.w,
|
|
color: Colors.grey,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
Container(
|
|
padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 15.w),
|
|
decoration: BoxDecoration(
|
|
color: Colors.black87,
|
|
borderRadius: BorderRadius.circular(16.w),
|
|
),
|
|
child: Column(
|
|
children: [
|
|
Row(
|
|
children: [
|
|
Icon(
|
|
Icons.auto_awesome,
|
|
color: Colors.amberAccent,
|
|
size: 25.sp,
|
|
),
|
|
5.horizontalSpace,
|
|
Text(
|
|
'解锁 Starter 会员',
|
|
style: TextStyle(
|
|
color: Colors.white,
|
|
fontSize: 18.sp,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
Padding(
|
|
padding: EdgeInsets.only(top: 15.w),
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
Text(
|
|
'绑定 DEAPSOUND 设备可激活 Starter 会员',
|
|
style: TextStyle(
|
|
color: Colors.white,
|
|
fontSize: 12.sp,
|
|
),
|
|
),
|
|
GestureDetector(
|
|
onTap: () {},
|
|
child: Container(
|
|
padding: EdgeInsets.symmetric(
|
|
horizontal: 10.w,
|
|
vertical: 6.w,
|
|
),
|
|
decoration: BoxDecoration(
|
|
borderRadius: BorderRadius.circular(50.w),
|
|
gradient: const LinearGradient(
|
|
colors: [Colors.blue, Colors.pink],
|
|
begin: Alignment.centerLeft,
|
|
end: Alignment.centerRight,
|
|
),
|
|
),
|
|
child: Text(
|
|
'立即解锁',
|
|
style: TextStyle(
|
|
color: Colors.white,
|
|
fontSize: 14.sp,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget _box(List<Widget> children) {
|
|
return Container(
|
|
padding: EdgeInsets.symmetric(vertical: 5.w),
|
|
margin: EdgeInsets.only(bottom: 15.w),
|
|
decoration: BoxDecoration(
|
|
color: MeetingUIUtils.getCardColor(isDarkMode),
|
|
borderRadius: BorderRadius.circular(16.w),
|
|
boxShadow: MeetingUIUtils.getCardShadow(isDarkMode),
|
|
),
|
|
child: Column(
|
|
children: children,
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget _item(
|
|
IconData icon,
|
|
String title, {
|
|
String? description,
|
|
Function()? onTap,
|
|
}) {
|
|
return GestureDetector(
|
|
onTap: onTap,
|
|
child: Padding(
|
|
padding: EdgeInsets.symmetric(horizontal: 8.w, vertical: 12.w),
|
|
child: Row(
|
|
children: [
|
|
Icon(
|
|
icon,
|
|
size: 24.w,
|
|
color: isDarkMode ? Colors.grey[400] : Colors.grey,
|
|
),
|
|
8.horizontalSpace,
|
|
Expanded(
|
|
child: Text(
|
|
title,
|
|
style: TextStyle(
|
|
color: isDarkMode ? Colors.white : Colors.black87,
|
|
fontSize: 16.sp,
|
|
),
|
|
),
|
|
),
|
|
if (description != null)
|
|
Padding(
|
|
padding: EdgeInsets.only(right: 5.w),
|
|
child: Text(
|
|
description,
|
|
style: TextStyle(
|
|
color: Colors.grey,
|
|
fontSize: 16.sp,
|
|
),
|
|
),
|
|
),
|
|
Icon(
|
|
Icons.arrow_forward_ios,
|
|
size: 16.w,
|
|
color: isDarkMode ? Colors.grey[400] : Colors.grey,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|