|
|
@ -25,219 +25,224 @@ class MeetingDetailsView extends GetView<MeetingDetailsController> { |
|
|
|
|
|
|
|
|
return PopScope( |
|
|
return PopScope( |
|
|
onPopInvokedWithResult: controller.popInvokedWithResult, |
|
|
onPopInvokedWithResult: controller.popInvokedWithResult, |
|
|
child: Obx( |
|
|
child: Scaffold( |
|
|
() => Scaffold( |
|
|
backgroundColor: isDarkMode ? Colors.black : Colors.grey[50], |
|
|
backgroundColor: isDarkMode ? Colors.black : Colors.grey[50], |
|
|
appBar: _buildAppBar(context, isDarkMode), |
|
|
appBar: _buildAppBar(context, isDarkMode), |
|
|
body: _buildBody(isDarkMode), |
|
|
body: _buildBody(isDarkMode), |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
), |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 构建应用栏 |
|
|
// 构建应用栏 |
|
|
PreferredSizeWidget _buildAppBar(BuildContext context, bool isDarkMode) { |
|
|
PreferredSizeWidget _buildAppBar(BuildContext context, bool isDarkMode) { |
|
|
return AppBar( |
|
|
return PreferredSize( |
|
|
backgroundColor: |
|
|
preferredSize: const Size.fromHeight(kToolbarHeight), |
|
|
controller.isTop.value ? Colors.grey[50] : Colors.grey[200], |
|
|
child: Obx( |
|
|
surfaceTintColor: Colors.transparent, |
|
|
() => AppBar( |
|
|
elevation: 0.5, |
|
|
backgroundColor: |
|
|
leading: controller.isSpeakerText.value |
|
|
controller.isTop.value ? Colors.grey[50] : Colors.grey[200], |
|
|
? GestureDetector( |
|
|
surfaceTintColor: Colors.transparent, |
|
|
onTap: () { |
|
|
elevation: 0.5, |
|
|
controller.isSpeakerText.value = false; |
|
|
leading: controller.isSpeakerText.value |
|
|
controller.editSpeakerTextId.value = 0; |
|
|
? GestureDetector( |
|
|
controller.editSpeakerTextList = []; |
|
|
|
|
|
}, |
|
|
|
|
|
child: Center( |
|
|
|
|
|
child: Text( |
|
|
|
|
|
'cancel'.tr, |
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
color: isDarkMode ? Colors.white : Colors.black87, |
|
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
) |
|
|
|
|
|
: IconButton( |
|
|
|
|
|
icon: Icon( |
|
|
|
|
|
Icons.arrow_back_ios, |
|
|
|
|
|
color: isDarkMode ? Colors.white : Colors.black, |
|
|
|
|
|
size: 20.sp, |
|
|
|
|
|
), |
|
|
|
|
|
onPressed: () => Get.back(), |
|
|
|
|
|
), |
|
|
|
|
|
title: Obx( |
|
|
|
|
|
() => Opacity( |
|
|
|
|
|
opacity: (1 - (controller.dragOffset.value / 100.w)).clamp(0.0, 1.0), |
|
|
|
|
|
child: Container( |
|
|
|
|
|
width: 170.w, |
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 2.w, vertical: 3.w), |
|
|
|
|
|
clipBehavior: Clip.hardEdge, |
|
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
|
color: Colors.grey[200], |
|
|
|
|
|
borderRadius: BorderRadius.circular(30.r), |
|
|
|
|
|
), |
|
|
|
|
|
child: Row( |
|
|
|
|
|
children: [ |
|
|
|
|
|
GestureDetector( |
|
|
|
|
|
onTap: () { |
|
|
onTap: () { |
|
|
if (controller.meetingData.value.filepath.isEmpty) { |
|
|
controller.isSpeakerText.value = false; |
|
|
controller.downloadAudio(); |
|
|
controller.editSpeakerTextId.value = 0; |
|
|
} else { |
|
|
controller.editSpeakerTextList = []; |
|
|
if (controller.isPlay.value) { |
|
|
|
|
|
controller.playerController.pausePlayer(); |
|
|
|
|
|
} else { |
|
|
|
|
|
controller.playerController.startPlayer(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
}, |
|
|
child: Obx( |
|
|
child: Center( |
|
|
() => !controller.isLoading.value && |
|
|
child: Text( |
|
|
controller.meetingData.value.filepath.isEmpty |
|
|
'cancel'.tr, |
|
|
? Obx( |
|
|
style: TextStyle( |
|
|
() => Stack( |
|
|
color: isDarkMode ? Colors.white : Colors.black87, |
|
|
alignment: Alignment.center, |
|
|
fontSize: 16.sp, |
|
|
children: [ |
|
|
), |
|
|
if (controller.isDownload.value) |
|
|
), |
|
|
SizedBox( |
|
|
), |
|
|
width: 26.w, |
|
|
) |
|
|
height: 26.w, |
|
|
: IconButton( |
|
|
child: CircularProgressIndicator( |
|
|
icon: Icon( |
|
|
value: controller.downloadProgress.value, |
|
|
Icons.arrow_back_ios, |
|
|
valueColor: |
|
|
color: isDarkMode ? Colors.white : Colors.black, |
|
|
const AlwaysStoppedAnimation<Color>( |
|
|
size: 20.sp, |
|
|
Colors.red), |
|
|
), |
|
|
strokeWidth: 2.w, |
|
|
onPressed: () => Get.back(), |
|
|
|
|
|
), |
|
|
|
|
|
title: Obx( |
|
|
|
|
|
() => Opacity( |
|
|
|
|
|
opacity: |
|
|
|
|
|
(1 - (controller.dragOffset.value / 100.w)).clamp(0.0, 1.0), |
|
|
|
|
|
child: Container( |
|
|
|
|
|
width: 170.w, |
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 2.w, vertical: 3.w), |
|
|
|
|
|
clipBehavior: Clip.hardEdge, |
|
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
|
color: Colors.grey[200], |
|
|
|
|
|
borderRadius: BorderRadius.circular(30.r), |
|
|
|
|
|
), |
|
|
|
|
|
child: Row( |
|
|
|
|
|
children: [ |
|
|
|
|
|
GestureDetector( |
|
|
|
|
|
onTap: () { |
|
|
|
|
|
if (controller.meetingData.value.filepath.isEmpty) { |
|
|
|
|
|
controller.downloadAudio(); |
|
|
|
|
|
} else { |
|
|
|
|
|
if (controller.isPlay.value) { |
|
|
|
|
|
controller.playerController.pausePlayer(); |
|
|
|
|
|
} else { |
|
|
|
|
|
controller.playerController.startPlayer(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
child: Obx( |
|
|
|
|
|
() => !controller.isLoading.value && |
|
|
|
|
|
controller.meetingData.value.filepath.isEmpty |
|
|
|
|
|
? Obx( |
|
|
|
|
|
() => Stack( |
|
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
|
children: [ |
|
|
|
|
|
if (controller.isDownload.value) |
|
|
|
|
|
SizedBox( |
|
|
|
|
|
width: 26.w, |
|
|
|
|
|
height: 26.w, |
|
|
|
|
|
child: CircularProgressIndicator( |
|
|
|
|
|
value: |
|
|
|
|
|
controller.downloadProgress.value, |
|
|
|
|
|
valueColor: |
|
|
|
|
|
const AlwaysStoppedAnimation< |
|
|
|
|
|
Color>(Colors.red), |
|
|
|
|
|
strokeWidth: 2.w, |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
Icon( |
|
|
|
|
|
Icons.download_for_offline, |
|
|
|
|
|
color: Colors.black, |
|
|
|
|
|
size: 30.w, |
|
|
), |
|
|
), |
|
|
), |
|
|
], |
|
|
Icon( |
|
|
|
|
|
Icons.download_for_offline, |
|
|
|
|
|
color: Colors.black, |
|
|
|
|
|
size: 30.w, |
|
|
|
|
|
), |
|
|
), |
|
|
], |
|
|
) |
|
|
|
|
|
: Icon( |
|
|
|
|
|
controller.isPlay.value |
|
|
|
|
|
? Icons.pause_circle |
|
|
|
|
|
: Icons.play_circle, |
|
|
|
|
|
color: Colors.black, |
|
|
|
|
|
size: 30.w, |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
4.horizontalSpace, |
|
|
|
|
|
GestureDetector( |
|
|
|
|
|
onTap: () { |
|
|
|
|
|
if (controller.isSpeakerText.value) return; |
|
|
|
|
|
controller.dragOffset.value = 210.w; |
|
|
|
|
|
controller.isTop.value = false; |
|
|
|
|
|
}, |
|
|
|
|
|
behavior: HitTestBehavior.translucent, |
|
|
|
|
|
child: SizedBox( |
|
|
|
|
|
width: 130.w, |
|
|
|
|
|
height: 30.w, |
|
|
|
|
|
child: FittedBox( |
|
|
|
|
|
fit: BoxFit.scaleDown, |
|
|
|
|
|
child: AudioFileWaveforms( |
|
|
|
|
|
size: Size(350.w, 30.w), |
|
|
|
|
|
playerController: controller.playerController, |
|
|
|
|
|
waveformData: List.generate(88, (int index) { |
|
|
|
|
|
return 0.01 + Random().nextDouble() * 0.09; |
|
|
|
|
|
}), |
|
|
|
|
|
waveformType: WaveformType.fitWidth, |
|
|
|
|
|
enableSeekGesture: false, |
|
|
|
|
|
playerWaveStyle: PlayerWaveStyle( |
|
|
|
|
|
spacing: 4.w, |
|
|
|
|
|
waveThickness: 2.w, |
|
|
|
|
|
fixedWaveColor: Colors.grey[400]!, |
|
|
|
|
|
liveWaveColor: Colors.red, |
|
|
|
|
|
seekLineColor: Colors.red, |
|
|
|
|
|
scaleFactor: 200, |
|
|
), |
|
|
), |
|
|
) |
|
|
|
|
|
: Icon( |
|
|
|
|
|
controller.isPlay.value |
|
|
|
|
|
? Icons.pause_circle |
|
|
|
|
|
: Icons.play_circle, |
|
|
|
|
|
color: Colors.black, |
|
|
|
|
|
size: 30.w, |
|
|
|
|
|
), |
|
|
), |
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
4.horizontalSpace, |
|
|
|
|
|
GestureDetector( |
|
|
|
|
|
onTap: () { |
|
|
|
|
|
if (controller.isSpeakerText.value) return; |
|
|
|
|
|
controller.dragOffset.value = 210.w; |
|
|
|
|
|
controller.isTop.value = false; |
|
|
|
|
|
}, |
|
|
|
|
|
behavior: HitTestBehavior.translucent, |
|
|
|
|
|
child: SizedBox( |
|
|
|
|
|
width: 130.w, |
|
|
|
|
|
height: 30.w, |
|
|
|
|
|
child: FittedBox( |
|
|
|
|
|
fit: BoxFit.scaleDown, |
|
|
|
|
|
child: AudioFileWaveforms( |
|
|
|
|
|
size: Size(350.w, 30.w), |
|
|
|
|
|
playerController: controller.playerController, |
|
|
|
|
|
waveformData: List.generate(88, (int index) { |
|
|
|
|
|
return 0.01 + Random().nextDouble() * 0.09; |
|
|
|
|
|
}), |
|
|
|
|
|
waveformType: WaveformType.fitWidth, |
|
|
|
|
|
enableSeekGesture: false, |
|
|
|
|
|
playerWaveStyle: PlayerWaveStyle( |
|
|
|
|
|
spacing: 4.w, |
|
|
|
|
|
waveThickness: 2.w, |
|
|
|
|
|
fixedWaveColor: Colors.grey[400]!, |
|
|
|
|
|
liveWaveColor: Colors.red, |
|
|
|
|
|
seekLineColor: Colors.red, |
|
|
|
|
|
scaleFactor: 200, |
|
|
|
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
], |
|
|
), |
|
|
|
|
|
], |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
centerTitle: true, |
|
|
|
|
|
actions: [ |
|
|
|
|
|
if (controller.isSpeakerText.value) |
|
|
|
|
|
GestureDetector( |
|
|
|
|
|
onTap: controller.editSpeakerText, |
|
|
|
|
|
child: Padding( |
|
|
|
|
|
padding: EdgeInsets.symmetric( |
|
|
|
|
|
horizontal: 12.w, |
|
|
|
|
|
vertical: 6.w, |
|
|
|
|
|
), |
|
|
|
|
|
child: Text( |
|
|
|
|
|
'save'.tr, |
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
color: isDarkMode ? AppColors.primary : Colors.blue, |
|
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
if (!controller.isSpeakerText.value) |
|
|
centerTitle: true, |
|
|
IconButton( |
|
|
actions: [ |
|
|
icon: Icon( |
|
|
if (controller.isSpeakerText.value) |
|
|
Icons.ios_share, |
|
|
GestureDetector( |
|
|
color: isDarkMode ? Colors.white : Colors.black, |
|
|
onTap: controller.editSpeakerText, |
|
|
size: 22.sp, |
|
|
child: Padding( |
|
|
), |
|
|
padding: EdgeInsets.symmetric( |
|
|
onPressed: () { |
|
|
horizontal: 12.w, |
|
|
Get.bottomSheet( |
|
|
vertical: 6.w, |
|
|
const ShareBottomSheet(), |
|
|
), |
|
|
isScrollControlled: true, |
|
|
child: Text( |
|
|
backgroundColor: Colors.grey[100], |
|
|
'save'.tr, |
|
|
shape: RoundedRectangleBorder( |
|
|
style: TextStyle( |
|
|
borderRadius: BorderRadius.vertical( |
|
|
color: isDarkMode ? AppColors.primary : Colors.blue, |
|
|
top: Radius.circular(12.r), |
|
|
fontSize: 16.sp, |
|
|
|
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
); |
|
|
), |
|
|
}, |
|
|
if (!controller.isSpeakerText.value) |
|
|
), |
|
|
IconButton( |
|
|
if (!controller.isSpeakerText.value) |
|
|
icon: Icon( |
|
|
IconButton( |
|
|
Icons.ios_share, |
|
|
icon: Container( |
|
|
|
|
|
width: 22.w, |
|
|
|
|
|
height: 22.w, |
|
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
|
borderRadius: BorderRadius.circular(20.r), |
|
|
|
|
|
border: Border.all( |
|
|
|
|
|
color: isDarkMode ? Colors.white : Colors.black, |
|
|
color: isDarkMode ? Colors.white : Colors.black, |
|
|
width: 2, |
|
|
size: 22.sp, |
|
|
), |
|
|
), |
|
|
|
|
|
onPressed: () { |
|
|
|
|
|
Get.bottomSheet( |
|
|
|
|
|
const ShareBottomSheet(), |
|
|
|
|
|
isScrollControlled: true, |
|
|
|
|
|
backgroundColor: Colors.grey[100], |
|
|
|
|
|
shape: RoundedRectangleBorder( |
|
|
|
|
|
borderRadius: BorderRadius.vertical( |
|
|
|
|
|
top: Radius.circular(12.r), |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
); |
|
|
|
|
|
}, |
|
|
), |
|
|
), |
|
|
child: Icon( |
|
|
if (!controller.isSpeakerText.value) |
|
|
Icons.more_horiz, |
|
|
IconButton( |
|
|
color: isDarkMode ? Colors.white : Colors.black, |
|
|
icon: Container( |
|
|
size: 16.sp, |
|
|
width: 22.w, |
|
|
), |
|
|
height: 22.w, |
|
|
), |
|
|
alignment: Alignment.center, |
|
|
onPressed: () { |
|
|
decoration: BoxDecoration( |
|
|
Get.bottomSheet( |
|
|
borderRadius: BorderRadius.circular(20.r), |
|
|
const MoreBottomSheet(), |
|
|
border: Border.all( |
|
|
isScrollControlled: true, |
|
|
color: isDarkMode ? Colors.white : Colors.black, |
|
|
backgroundColor: Colors.grey[100], |
|
|
width: 2, |
|
|
shape: RoundedRectangleBorder( |
|
|
), |
|
|
borderRadius: BorderRadius.vertical( |
|
|
), |
|
|
top: Radius.circular(12.r), |
|
|
child: Icon( |
|
|
|
|
|
Icons.more_horiz, |
|
|
|
|
|
color: isDarkMode ? Colors.white : Colors.black, |
|
|
|
|
|
size: 16.sp, |
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
); |
|
|
onPressed: () { |
|
|
}, |
|
|
Get.bottomSheet( |
|
|
), |
|
|
const MoreBottomSheet(), |
|
|
], |
|
|
isScrollControlled: true, |
|
|
|
|
|
backgroundColor: Colors.grey[100], |
|
|
|
|
|
shape: RoundedRectangleBorder( |
|
|
|
|
|
borderRadius: BorderRadius.vertical( |
|
|
|
|
|
top: Radius.circular(12.r), |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
); |
|
|
|
|
|
}, |
|
|
|
|
|
), |
|
|
|
|
|
], |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|