4 changed files with 160 additions and 283 deletions
@ -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), |
|
||||
), |
|
||||
], |
|
||||
), |
|
||||
), |
|
||||
); |
|
||||
}, |
|
||||
); |
|
||||
} |
|
||||
} |
|
||||
Loading…
Reference in new issue