|
|
@ -24,6 +24,14 @@ class TranslationStatsView extends GetView<TranslationStatsController> { |
|
|
/// 构建应用栏 |
|
|
/// 构建应用栏 |
|
|
PreferredSizeWidget _buildAppBar(bool isDarkMode) { |
|
|
PreferredSizeWidget _buildAppBar(bool isDarkMode) { |
|
|
return AppBar( |
|
|
return AppBar( |
|
|
|
|
|
leading: IconButton( |
|
|
|
|
|
icon: Icon( |
|
|
|
|
|
Icons.arrow_back_ios, |
|
|
|
|
|
color: isDarkMode ? Colors.white : Colors.black, |
|
|
|
|
|
size: 20.sp, |
|
|
|
|
|
), |
|
|
|
|
|
onPressed: () => Get.back(), |
|
|
|
|
|
), |
|
|
backgroundColor: isDarkMode ? AppColors.darkBackground : Colors.white, |
|
|
backgroundColor: isDarkMode ? AppColors.darkBackground : Colors.white, |
|
|
elevation: 0.5, |
|
|
elevation: 0.5, |
|
|
title: Text( |
|
|
title: Text( |
|
|
@ -251,7 +259,8 @@ class TranslationStatsView extends GetView<TranslationStatsController> { |
|
|
Expanded( |
|
|
Expanded( |
|
|
child: _buildStatItem( |
|
|
child: _buildStatItem( |
|
|
'录音时长', |
|
|
'录音时长', |
|
|
controller.formatDuration(controller.realtimeStats.recordingDuration), |
|
|
controller.formatDuration( |
|
|
|
|
|
controller.realtimeStats.recordingDuration), |
|
|
Icons.mic, |
|
|
Icons.mic, |
|
|
isDarkMode, |
|
|
isDarkMode, |
|
|
), |
|
|
), |
|
|
@ -305,7 +314,8 @@ class TranslationStatsView extends GetView<TranslationStatsController> { |
|
|
Expanded( |
|
|
Expanded( |
|
|
child: _buildStatItem( |
|
|
child: _buildStatItem( |
|
|
'总调用次数', |
|
|
'总调用次数', |
|
|
controller.formatNumber(controller.currentStats.totalApiCalls), |
|
|
controller |
|
|
|
|
|
.formatNumber(controller.currentStats.totalApiCalls), |
|
|
Icons.api, |
|
|
Icons.api, |
|
|
isDarkMode, |
|
|
isDarkMode, |
|
|
), |
|
|
), |
|
|
@ -313,7 +323,8 @@ class TranslationStatsView extends GetView<TranslationStatsController> { |
|
|
Expanded( |
|
|
Expanded( |
|
|
child: _buildStatItem( |
|
|
child: _buildStatItem( |
|
|
'预估成本', |
|
|
'预估成本', |
|
|
controller.formatCost(controller.currentStats.estimatedCost), |
|
|
controller |
|
|
|
|
|
.formatCost(controller.currentStats.estimatedCost), |
|
|
Icons.attach_money, |
|
|
Icons.attach_money, |
|
|
isDarkMode, |
|
|
isDarkMode, |
|
|
), |
|
|
), |
|
|
@ -334,7 +345,8 @@ class TranslationStatsView extends GetView<TranslationStatsController> { |
|
|
Expanded( |
|
|
Expanded( |
|
|
child: _buildStatItem( |
|
|
child: _buildStatItem( |
|
|
'总字符数', |
|
|
'总字符数', |
|
|
controller.formatNumber(controller.currentStats.totalCharacterCount), |
|
|
controller.formatNumber( |
|
|
|
|
|
controller.currentStats.totalCharacterCount), |
|
|
Icons.text_snippet, |
|
|
Icons.text_snippet, |
|
|
isDarkMode, |
|
|
isDarkMode, |
|
|
), |
|
|
), |
|
|
@ -347,7 +359,8 @@ class TranslationStatsView extends GetView<TranslationStatsController> { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/// 构建统计项 |
|
|
/// 构建统计项 |
|
|
Widget _buildStatItem(String label, String value, IconData icon, bool isDarkMode) { |
|
|
Widget _buildStatItem( |
|
|
|
|
|
String label, String value, IconData icon, bool isDarkMode) { |
|
|
return Column( |
|
|
return Column( |
|
|
children: [ |
|
|
children: [ |
|
|
Icon( |
|
|
Icon( |
|
|
@ -415,13 +428,23 @@ class TranslationStatsView extends GetView<TranslationStatsController> { |
|
|
SizedBox(height: 16.h), |
|
|
SizedBox(height: 16.h), |
|
|
Obx(() => Column( |
|
|
Obx(() => Column( |
|
|
children: [ |
|
|
children: [ |
|
|
_buildApiCallRow('翻译API', controller.currentStats.translationApiCalls, Icons.translate, isDarkMode), |
|
|
_buildApiCallRow( |
|
|
|
|
|
'翻译API', |
|
|
|
|
|
controller.currentStats.translationApiCalls, |
|
|
|
|
|
Icons.translate, |
|
|
|
|
|
isDarkMode), |
|
|
SizedBox(height: 12.h), |
|
|
SizedBox(height: 12.h), |
|
|
_buildApiCallRow('语音识别', controller.currentStats.asrApiCalls, Icons.mic, isDarkMode), |
|
|
_buildApiCallRow('语音识别', controller.currentStats.asrApiCalls, |
|
|
|
|
|
Icons.mic, isDarkMode), |
|
|
SizedBox(height: 12.h), |
|
|
SizedBox(height: 12.h), |
|
|
_buildApiCallRow('语音合成', controller.currentStats.ttsApiCalls, Icons.volume_up, isDarkMode), |
|
|
_buildApiCallRow('语音合成', controller.currentStats.ttsApiCalls, |
|
|
|
|
|
Icons.volume_up, isDarkMode), |
|
|
SizedBox(height: 12.h), |
|
|
SizedBox(height: 12.h), |
|
|
_buildApiCallRow('AI摘要', controller.currentStats.aiSummaryApiCalls, Icons.summarize, isDarkMode), |
|
|
_buildApiCallRow( |
|
|
|
|
|
'AI摘要', |
|
|
|
|
|
controller.currentStats.aiSummaryApiCalls, |
|
|
|
|
|
Icons.summarize, |
|
|
|
|
|
isDarkMode), |
|
|
], |
|
|
], |
|
|
)), |
|
|
)), |
|
|
], |
|
|
], |
|
|
@ -430,7 +453,8 @@ class TranslationStatsView extends GetView<TranslationStatsController> { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/// 构建API调用行 |
|
|
/// 构建API调用行 |
|
|
Widget _buildApiCallRow(String label, int count, IconData icon, bool isDarkMode) { |
|
|
Widget _buildApiCallRow( |
|
|
|
|
|
String label, int count, IconData icon, bool isDarkMode) { |
|
|
return Row( |
|
|
return Row( |
|
|
children: [ |
|
|
children: [ |
|
|
Icon( |
|
|
Icon( |
|
|
@ -504,7 +528,8 @@ class TranslationStatsView extends GetView<TranslationStatsController> { |
|
|
Expanded( |
|
|
Expanded( |
|
|
child: _buildStatItem( |
|
|
child: _buildStatItem( |
|
|
'源文本字符', |
|
|
'源文本字符', |
|
|
controller.formatNumber(controller.currentStats.sourceTextCharacters), |
|
|
controller.formatNumber( |
|
|
|
|
|
controller.currentStats.sourceTextCharacters), |
|
|
Icons.text_fields, |
|
|
Icons.text_fields, |
|
|
isDarkMode, |
|
|
isDarkMode, |
|
|
), |
|
|
), |
|
|
@ -512,7 +537,8 @@ class TranslationStatsView extends GetView<TranslationStatsController> { |
|
|
Expanded( |
|
|
Expanded( |
|
|
child: _buildStatItem( |
|
|
child: _buildStatItem( |
|
|
'TTS文本字符', |
|
|
'TTS文本字符', |
|
|
controller.formatNumber(controller.currentStats.ttsTextCharacters), |
|
|
controller.formatNumber( |
|
|
|
|
|
controller.currentStats.ttsTextCharacters), |
|
|
Icons.translate, |
|
|
Icons.translate, |
|
|
isDarkMode, |
|
|
isDarkMode, |
|
|
), |
|
|
), |
|
|
@ -525,7 +551,8 @@ class TranslationStatsView extends GetView<TranslationStatsController> { |
|
|
Expanded( |
|
|
Expanded( |
|
|
child: _buildStatItem( |
|
|
child: _buildStatItem( |
|
|
'有效音频时长', |
|
|
'有效音频时长', |
|
|
controller.formatDuration(controller.currentStats.effectiveAudioDuration), |
|
|
controller.formatDuration( |
|
|
|
|
|
controller.currentStats.effectiveAudioDuration), |
|
|
Icons.mic, |
|
|
Icons.mic, |
|
|
isDarkMode, |
|
|
isDarkMode, |
|
|
), |
|
|
), |
|
|
@ -533,7 +560,8 @@ class TranslationStatsView extends GetView<TranslationStatsController> { |
|
|
Expanded( |
|
|
Expanded( |
|
|
child: _buildStatItem( |
|
|
child: _buildStatItem( |
|
|
'总会话时长', |
|
|
'总会话时长', |
|
|
controller.formatDuration(controller.currentStats.totalSessionDuration), |
|
|
controller.formatDuration( |
|
|
|
|
|
controller.currentStats.totalSessionDuration), |
|
|
Icons.volume_up, |
|
|
Icons.volume_up, |
|
|
isDarkMode, |
|
|
isDarkMode, |
|
|
), |
|
|
), |
|
|
@ -605,7 +633,8 @@ class TranslationStatsView extends GetView<TranslationStatsController> { |
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
Text( |
|
|
Text( |
|
|
controller.formatCost(controller.currentStats.estimatedCost), |
|
|
controller.formatCost( |
|
|
|
|
|
controller.currentStats.estimatedCost), |
|
|
style: TextStyle( |
|
|
style: TextStyle( |
|
|
fontSize: 18.sp, |
|
|
fontSize: 18.sp, |
|
|
fontWeight: FontWeight.bold, |
|
|
fontWeight: FontWeight.bold, |
|
|
@ -628,7 +657,8 @@ class TranslationStatsView extends GetView<TranslationStatsController> { |
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
Text( |
|
|
Text( |
|
|
controller.formatCost(controller.dailyCostThreshold.value), |
|
|
controller |
|
|
|
|
|
.formatCost(controller.dailyCostThreshold.value), |
|
|
style: TextStyle( |
|
|
style: TextStyle( |
|
|
fontSize: 12.sp, |
|
|
fontSize: 12.sp, |
|
|
color: isDarkMode ? Colors.white70 : Colors.black54, |
|
|
color: isDarkMode ? Colors.white70 : Colors.black54, |
|
|
@ -648,7 +678,8 @@ class TranslationStatsView extends GetView<TranslationStatsController> { |
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
Text( |
|
|
Text( |
|
|
controller.formatCost(controller.monthlyCostThreshold.value), |
|
|
controller |
|
|
|
|
|
.formatCost(controller.monthlyCostThreshold.value), |
|
|
style: TextStyle( |
|
|
style: TextStyle( |
|
|
fontSize: 12.sp, |
|
|
fontSize: 12.sp, |
|
|
color: isDarkMode ? Colors.white70 : Colors.black54, |
|
|
color: isDarkMode ? Colors.white70 : Colors.black54, |
|
|
@ -725,7 +756,8 @@ class TranslationStatsView extends GetView<TranslationStatsController> { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/// 构建使用行为行 |
|
|
/// 构建使用行为行 |
|
|
Widget _buildUsageBehaviorRow(String label, String value, IconData icon, bool isDarkMode) { |
|
|
Widget _buildUsageBehaviorRow( |
|
|
|
|
|
String label, String value, IconData icon, bool isDarkMode) { |
|
|
return Row( |
|
|
return Row( |
|
|
children: [ |
|
|
children: [ |
|
|
Icon( |
|
|
Icon( |
|
|
|