Browse Source

Merge branch 'new_dev' of https://github.com/deepcloud2048/deep_voice into new_dev

weicu
lxm 1 year ago
parent
commit
67679ba783
  1. 159
      lib/modules/meeting/views/bottomSheet/import_audio_bottom_sheet.dart
  2. 70
      lib/modules/meeting/views/bottomSheet/navigation_bar_bottom_sheet.dart
  3. 20
      lib/modules/meeting/views/meeting_home_view.dart
  4. 194
      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),
),
],
),
),
);
},
);
}
}

70
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/state_manager.dart';
import '../../../../routes/app_routes.dart';
import '../../controllers/meeting_home_controller.dart';
class NavigationBarBottomSheet extends GetView<MeetingHomeController> {
@ -14,13 +15,59 @@ class NavigationBarBottomSheet extends GetView<MeetingHomeController> {
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
_buildItem(
context, // 传递 context 参数
'开始录音',
Icons.mic_rounded,
Colors.red,
),
SizedBox(height: 15.w),
if (controller.meetingController.type == 0)
_buildItem(
context, // 传递 context 参数
'开始录音',
Icons.mic_rounded,
Colors.red,
),
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(
context, // 传递 context 参数
'导入音频',
@ -35,16 +82,16 @@ class NavigationBarBottomSheet extends GetView<MeetingHomeController> {
GestureDetector(
onTap: () => Get.back(),
child: Container(
width: 45.w,
height: 45.w,
width: 42,
height: 42,
decoration: BoxDecoration(
color: Colors.black.withValues(alpha: 0.8),
borderRadius: BorderRadius.circular(50.w),
borderRadius: BorderRadius.circular(50),
),
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,
height: 60.w,
padding: EdgeInsets.all(5.w),
margin: EdgeInsets.only(top: 15.w),
decoration: BoxDecoration(
color: isDarkMode
? Colors.grey[800]!.withValues(alpha: onTap != null ? 1 : 0.5)

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

@ -10,7 +10,6 @@ import '../controllers/meeting_home_controller.dart';
import '../model/meeting_model.dart';
import '../utils/meeting_ui_utils.dart';
import 'bottomSheet/edit_title_bottom_sheet.dart';
import 'bottomSheet/import_audio_bottom_sheet.dart';
class MeetingHomeView extends StatefulWidget {
const MeetingHomeView({super.key});
@ -43,7 +42,8 @@ class _MeetingHomeViewState extends State<MeetingHomeView>
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
_buildFiltrate(isDarkMode),
_buildConnect(isDarkMode),
if (_controller.meetingController.type == 0)
_buildConnect(isDarkMode),
],
),
Expanded(
@ -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),
),
),
);
}

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

@ -19,10 +19,105 @@ class MeetingView extends GetView<MeetingController> {
return Scaffold(
key: controller.scaffoldKey,
backgroundColor: MeetingUIUtils.getBackgroundColor(isDarkMode),
body: PageView(
physics: const NeverScrollableScrollPhysics(),
controller: controller.pageController,
children: controller.pageList,
body: Stack(
alignment: Alignment.center,
clipBehavior: Clip.none,
children: [
PageView(
physics: const NeverScrollableScrollPhysics(),
controller: controller.pageController,
children: controller.pageList,
),
if (controller.type == 0)
Positioned(
bottom: 0,
left: 0,
right: 0,
child: Obx(
() => BottomNavigationBar(
items: const [
BottomNavigationBarItem(
icon: Icon(Icons.folder_outlined),
activeIcon: Icon(Icons.folder),
label: '文件',
),
BottomNavigationBarItem(
icon: SizedBox(),
label: '',
),
BottomNavigationBarItem(
icon: Icon(Icons.person_outline),
activeIcon: Icon(Icons.person),
label: '我的',
),
],
backgroundColor:
isDarkMode ? const Color(0xFF1A1A1A) : Colors.white,
currentIndex: controller.pageIndex.value,
unselectedItemColor: Colors.grey,
selectedItemColor: isDarkMode ? Colors.white : Colors.blue,
unselectedFontSize: 10.sp,
selectedFontSize: 10.sp,
onTap: (int index) {
if (index == 1 || index == controller.pageIndex.value) {
return;
}
if (index == 0) {
controller.pageIndex.value = 0;
controller.pageController.jumpToPage(0);
} else {
controller.pageIndex.value = 2;
controller.pageController.jumpToPage(1);
}
},
),
),
),
Positioned(
bottom: 10,
child: GestureDetector(
onTap: () {
Get.bottomSheet(
BackdropFilter(
filter: ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0),
child: const NavigationBarBottomSheet(),
),
isScrollControlled: true,
);
},
child: Container(
width: 60,
height: 60,
padding: const EdgeInsets.all(5),
alignment: Alignment.center,
decoration: BoxDecoration(
color: isDarkMode ? const Color(0xFF1A1A1A) : Colors.white,
borderRadius: BorderRadius.circular(60),
boxShadow: [
BoxShadow(
color: Colors.black
.withValues(alpha: isDarkMode ? 0.3 : 0.1),
blurRadius: 8,
offset: const Offset(0, 2),
),
],
),
child: Container(
alignment: Alignment.center,
decoration: BoxDecoration(
color: MeetingUIUtils.getButtonColor(isDarkMode),
borderRadius: BorderRadius.circular(60),
),
child: const Icon(
Icons.add,
color: Colors.white,
size: 30,
),
),
),
),
),
],
),
drawer: Drawer(
width: 260.w,
@ -30,97 +125,6 @@ class MeetingView extends GetView<MeetingController> {
child: const FiltrateDrawer(),
),
drawerEnableOpenDragGesture: false,
bottomNavigationBar: controller.type == 0
? Stack(
alignment: Alignment.center,
clipBehavior: Clip.none,
children: [
Obx(
() => BottomNavigationBar(
items: const [
BottomNavigationBarItem(
icon: Icon(Icons.folder_outlined),
activeIcon: Icon(Icons.folder),
label: '文件',
),
BottomNavigationBarItem(
icon: SizedBox(),
label: '',
),
BottomNavigationBarItem(
icon: Icon(Icons.person_outline),
activeIcon: Icon(Icons.person),
label: '我的',
),
],
backgroundColor:
isDarkMode ? const Color(0xFF1A1A1A) : Colors.white,
currentIndex: controller.pageIndex.value,
unselectedItemColor: Colors.grey,
selectedItemColor: isDarkMode ? Colors.white : Colors.blue,
unselectedFontSize: 10.sp,
selectedFontSize: 10.sp,
onTap: (int index) {
if (index == 1 || index == controller.pageIndex.value)
return;
if (index == 0) {
controller.pageIndex.value = 0;
controller.pageController.jumpToPage(0);
} else {
controller.pageIndex.value = 2;
controller.pageController.jumpToPage(1);
}
},
),
),
Positioned(
top: -18.w,
child: GestureDetector(
onTap: () {
Get.bottomSheet(
BackdropFilter(
filter: ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0),
child: const NavigationBarBottomSheet(),
),
isScrollControlled: true,
);
},
child: Container(
width: 60.w,
height: 60.w,
padding: EdgeInsets.all(5.w),
alignment: Alignment.center,
decoration: BoxDecoration(
color:
isDarkMode ? const Color(0xFF1A1A1A) : Colors.white,
borderRadius: BorderRadius.circular(60.w),
boxShadow: [
BoxShadow(
color: Colors.black
.withValues(alpha: isDarkMode ? 0.3 : 0.1),
blurRadius: 8,
offset: const Offset(0, 2),
),
],
),
child: Container(
alignment: Alignment.center,
decoration: BoxDecoration(
color: MeetingUIUtils.getButtonColor(isDarkMode),
borderRadius: BorderRadius.circular(60.w),
),
child: Icon(
Icons.add,
color: Colors.white,
size: 30.w,
),
),
),
),
),
],
)
: null,
);
}
}

Loading…
Cancel
Save