Browse Source

咻噶会议助手

newdev_shunjiawei
tanlongsheng 1 year ago
parent
commit
fb6d68b5a9
  1. 159
      lib/modules/meeting/views/bottomSheet/import_audio_bottom_sheet.dart
  2. 58
      lib/modules/meeting/views/bottomSheet/navigation_bar_bottom_sheet.dart
  3. 18
      lib/modules/meeting/views/meeting_home_view.dart
  4. 56
      lib/modules/meeting/views/meeting_view.dart

159
lib/modules/meeting/views/bottomSheet/import_audio_bottom_sheet.dart

@ -1,159 +0,0 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import '../../../../routes/app_routes.dart';
import '../../controllers/meeting_home_controller.dart';
class ImportAudioBottomSheet extends GetView<MeetingHomeController> {
const ImportAudioBottomSheet({super.key});
@override
Widget build(BuildContext context) {
final isDarkMode = Theme.of(context).brightness == Brightness.dark;
return Padding(
padding: EdgeInsets.symmetric(horizontal: 12.w),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
padding: EdgeInsets.symmetric(vertical: 10.w),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'添加音频',
style: TextStyle(
fontSize: 16.sp,
color: isDarkMode ? Colors.white : Colors.black87,
fontWeight: FontWeight.bold,
),
),
GestureDetector(
onTap: () => Get.back(),
child: Container(
width: 26.w,
height: 26.w,
decoration: BoxDecoration(
color: isDarkMode ? Colors.grey[800] : Colors.white,
borderRadius: BorderRadius.circular(26.r),
),
child: Icon(
Icons.close,
size: 18.w,
color: Colors.grey[400],
),
),
)
],
),
),
Divider(
height: 1,
color: isDarkMode ? Colors.grey[700] : Colors.grey[300],
),
SizedBox(height: 16.w),
_importAudioItem(Icons.mic, '现场录音', onTap: () async {
Get.back();
await Get.toNamed(Routes.meetingRecord, arguments: {
'audioTypes': 0,
});
controller.addMeetingAudio();
}),
_importAudioItem(
Icons.videocam,
'音、视频录音',
onTap: controller.bleManager.isConnected
? () async {
Get.back();
await Get.toNamed(Routes.meetingRecord, arguments: {
'audioTypes': 1,
});
controller.addMeetingAudio();
}
: null,
),
_importAudioItem(
Icons.phone,
'通话录音',
onTap: controller.bleManager.isConnected
? () async {
Get.back();
await Get.toNamed(Routes.meetingRecord, arguments: {
'audioTypes': 2,
});
controller.addMeetingAudio();
}
: null,
),
_importAudioItem(Icons.library_music, '导入本地音频', onTap: () {
Get.back();
controller.addAudio();
}),
Padding(
padding: EdgeInsets.symmetric(vertical: 16.w),
child: Text(
'支持导入单文件时长不超过5小时的音频',
style: TextStyle(
fontSize: 14.sp,
color: isDarkMode ? Colors.grey[400] : Colors.grey[600],
),
),
),
SizedBox(height: 4.w),
],
),
);
}
Widget _importAudioItem(
IconData icon,
String title, {
VoidCallback? onTap,
}) {
return Builder(
builder: (context) {
final isDarkMode = Theme.of(context).brightness == Brightness.dark;
return GestureDetector(
onTap: onTap,
child: Container(
height: 48.w,
padding: EdgeInsets.symmetric(horizontal: 12.w),
margin: EdgeInsets.symmetric(vertical: 4.w),
decoration: BoxDecoration(
color: isDarkMode
? Colors.grey[800]!.withValues(alpha: onTap != null ? 1 : 0.5)
: Colors.grey[50]!.withValues(alpha: onTap != null ? 1 : 0.5),
borderRadius: BorderRadius.circular(12.w),
),
child: Row(
children: [
Opacity(
opacity: onTap != null ? 1.0 : 0.5,
child: Icon(icon, size: 20.w),
),
10.horizontalSpace,
Expanded(
child: Text(
title,
style: TextStyle(
fontSize: 14.sp,
color: isDarkMode
? Colors.white.withValues(alpha: onTap != null ? 1 : 0.5)
: Colors.black87.withValues(alpha: onTap != null ? 1 : 0.5),
),
),
),
Icon(
Icons.arrow_forward_ios,
size: 16.w,
color: Colors.grey.withValues(alpha: onTap != null ? 1 : 0.5),
),
],
),
),
);
},
);
}
}

58
lib/modules/meeting/views/bottomSheet/navigation_bar_bottom_sheet.dart

@ -3,6 +3,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get_navigation/src/extension_navigation.dart'; import 'package:get/get_navigation/src/extension_navigation.dart';
import 'package:get/state_manager.dart'; import 'package:get/state_manager.dart';
import '../../../../routes/app_routes.dart';
import '../../controllers/meeting_home_controller.dart'; import '../../controllers/meeting_home_controller.dart';
class NavigationBarBottomSheet extends GetView<MeetingHomeController> { class NavigationBarBottomSheet extends GetView<MeetingHomeController> {
@ -14,13 +15,59 @@ class NavigationBarBottomSheet extends GetView<MeetingHomeController> {
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
if (controller.meetingController.type == 0)
_buildItem( _buildItem(
context, // 传递 context 参数 context, // 传递 context 参数
'开始录音', '开始录音',
Icons.mic_rounded, Icons.mic_rounded,
Colors.red, Colors.red,
), ),
SizedBox(height: 15.w), if (controller.meetingController.type == 1)
_buildItem(
context, // 传递 context 参数
'现场录音',
Icons.mic_rounded,
Colors.red,
onTap: () async {
Get.back();
await Get.toNamed(Routes.meetingRecord, arguments: {
'audioTypes': 0,
});
controller.addMeetingAudio();
},
),
if (controller.meetingController.type == 1)
_buildItem(
context, // 传递 context 参数
'音、视频录音',
Icons.videocam,
Colors.green,
onTap: controller.bleManager.isConnected
? () async {
Get.back();
await Get.toNamed(Routes.meetingRecord, arguments: {
'audioTypes': 1,
});
controller.addMeetingAudio();
}
: null,
),
if (controller.meetingController.type == 1)
_buildItem(
context, // 传递 context 参数
'通话录音',
Icons.phone,
Colors.orange,
onTap: controller.bleManager.isConnected
? () async {
Get.back();
await Get.toNamed(Routes.meetingRecord, arguments: {
'audioTypes': 2,
});
controller.addMeetingAudio();
}
: null,
),
_buildItem( _buildItem(
context, // 传递 context 参数 context, // 传递 context 参数
'导入音频', '导入音频',
@ -35,16 +82,16 @@ class NavigationBarBottomSheet extends GetView<MeetingHomeController> {
GestureDetector( GestureDetector(
onTap: () => Get.back(), onTap: () => Get.back(),
child: Container( child: Container(
width: 45.w, width: 42,
height: 45.w, height: 42,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.black.withValues(alpha: 0.8), color: Colors.black.withValues(alpha: 0.8),
borderRadius: BorderRadius.circular(50.w), borderRadius: BorderRadius.circular(50),
), ),
child: const Icon(Icons.close, color: Colors.white), child: const Icon(Icons.close, color: Colors.white),
), ),
), ),
SizedBox(height: 24.w), const SizedBox(height: 19),
], ],
), ),
); );
@ -65,6 +112,7 @@ class NavigationBarBottomSheet extends GetView<MeetingHomeController> {
width: 220.w, width: 220.w,
height: 60.w, height: 60.w,
padding: EdgeInsets.all(5.w), padding: EdgeInsets.all(5.w),
margin: EdgeInsets.only(top: 15.w),
decoration: BoxDecoration( decoration: BoxDecoration(
color: isDarkMode color: isDarkMode
? Colors.grey[800]!.withValues(alpha: onTap != null ? 1 : 0.5) ? Colors.grey[800]!.withValues(alpha: onTap != null ? 1 : 0.5)

18
lib/modules/meeting/views/meeting_home_view.dart

@ -10,7 +10,6 @@ import '../controllers/meeting_home_controller.dart';
import '../model/meeting_model.dart'; import '../model/meeting_model.dart';
import '../utils/meeting_ui_utils.dart'; import '../utils/meeting_ui_utils.dart';
import 'bottomSheet/edit_title_bottom_sheet.dart'; import 'bottomSheet/edit_title_bottom_sheet.dart';
import 'bottomSheet/import_audio_bottom_sheet.dart';
class MeetingHomeView extends StatefulWidget { class MeetingHomeView extends StatefulWidget {
const MeetingHomeView({super.key}); const MeetingHomeView({super.key});
@ -43,6 +42,7 @@ class _MeetingHomeViewState extends State<MeetingHomeView>
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
_buildFiltrate(isDarkMode), _buildFiltrate(isDarkMode),
if (_controller.meetingController.type == 0)
_buildConnect(isDarkMode), _buildConnect(isDarkMode),
], ],
), ),
@ -51,22 +51,6 @@ class _MeetingHomeViewState extends State<MeetingHomeView>
), ),
], ],
), ),
floatingActionButton: FloatingActionButton(
heroTag: "addAudio",
onPressed: () {
Get.bottomSheet(
const ImportAudioBottomSheet(),
isScrollControlled: true,
backgroundColor: isDarkMode ? Colors.grey[800] : Colors.grey[100],
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(
top: Radius.circular(12.r),
),
),
);
},
child: const Icon(Icons.add),
),
), ),
); );
} }

56
lib/modules/meeting/views/meeting_view.dart

@ -19,23 +19,21 @@ class MeetingView extends GetView<MeetingController> {
return Scaffold( return Scaffold(
key: controller.scaffoldKey, key: controller.scaffoldKey,
backgroundColor: MeetingUIUtils.getBackgroundColor(isDarkMode), backgroundColor: MeetingUIUtils.getBackgroundColor(isDarkMode),
body: PageView( body: Stack(
alignment: Alignment.center,
clipBehavior: Clip.none,
children: [
PageView(
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
controller: controller.pageController, controller: controller.pageController,
children: controller.pageList, children: controller.pageList,
), ),
drawer: Drawer( if (controller.type == 0)
width: 260.w, Positioned(
backgroundColor: isDarkMode ? const Color(0xFF1A1A1A) : Colors.grey[50], bottom: 0,
child: const FiltrateDrawer(), left: 0,
), right: 0,
drawerEnableOpenDragGesture: false, child: Obx(
bottomNavigationBar: controller.type == 0
? Stack(
alignment: Alignment.center,
clipBehavior: Clip.none,
children: [
Obx(
() => BottomNavigationBar( () => BottomNavigationBar(
items: const [ items: const [
BottomNavigationBarItem( BottomNavigationBarItem(
@ -61,8 +59,9 @@ class MeetingView extends GetView<MeetingController> {
unselectedFontSize: 10.sp, unselectedFontSize: 10.sp,
selectedFontSize: 10.sp, selectedFontSize: 10.sp,
onTap: (int index) { onTap: (int index) {
if (index == 1 || index == controller.pageIndex.value) if (index == 1 || index == controller.pageIndex.value) {
return; return;
}
if (index == 0) { if (index == 0) {
controller.pageIndex.value = 0; controller.pageIndex.value = 0;
controller.pageController.jumpToPage(0); controller.pageController.jumpToPage(0);
@ -73,8 +72,9 @@ class MeetingView extends GetView<MeetingController> {
}, },
), ),
), ),
),
Positioned( Positioned(
top: -18.w, bottom: 10,
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
Get.bottomSheet( Get.bottomSheet(
@ -86,14 +86,13 @@ class MeetingView extends GetView<MeetingController> {
); );
}, },
child: Container( child: Container(
width: 60.w, width: 60,
height: 60.w, height: 60,
padding: EdgeInsets.all(5.w), padding: const EdgeInsets.all(5),
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
color: color: isDarkMode ? const Color(0xFF1A1A1A) : Colors.white,
isDarkMode ? const Color(0xFF1A1A1A) : Colors.white, borderRadius: BorderRadius.circular(60),
borderRadius: BorderRadius.circular(60.w),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.black color: Colors.black
@ -107,20 +106,25 @@ class MeetingView extends GetView<MeetingController> {
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
color: MeetingUIUtils.getButtonColor(isDarkMode), color: MeetingUIUtils.getButtonColor(isDarkMode),
borderRadius: BorderRadius.circular(60.w), borderRadius: BorderRadius.circular(60),
), ),
child: Icon( child: const Icon(
Icons.add, Icons.add,
color: Colors.white, color: Colors.white,
size: 30.w, size: 30,
), ),
), ),
), ),
), ),
), ),
], ],
) ),
: null, drawer: Drawer(
width: 260.w,
backgroundColor: isDarkMode ? const Color(0xFF1A1A1A) : Colors.grey[50],
child: const FiltrateDrawer(),
),
drawerEnableOpenDragGesture: false,
); );
} }
} }

Loading…
Cancel
Save