111
This commit is contained in:
@@ -6,7 +6,7 @@ import '../../../core/theme/app_spacing.dart';
|
||||
import '../../../core/theme/app_theme_extension.dart';
|
||||
import '../../../data/services/asset_service.dart';
|
||||
|
||||
/// 盈亏分析页面 - 月度盈亏日历
|
||||
/// 盈虧分析頁面 - 月度盈虧日曆
|
||||
class ProfitAnalysisPage extends StatefulWidget {
|
||||
const ProfitAnalysisPage({super.key});
|
||||
|
||||
@@ -27,7 +27,7 @@ class _ProfitAnalysisPageState extends State<ProfitAnalysisPage> {
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// 数据加载
|
||||
// 數據加載
|
||||
// ============================================
|
||||
|
||||
Future<void> _loadProfit() async {
|
||||
@@ -64,7 +64,7 @@ class _ProfitAnalysisPageState extends State<ProfitAnalysisPage> {
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// 盈亏数据解析
|
||||
// 盈虧數據解析
|
||||
// ============================================
|
||||
|
||||
double? _getDayProfit(int day) {
|
||||
@@ -86,7 +86,7 @@ class _ProfitAnalysisPageState extends State<ProfitAnalysisPage> {
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// 构建 UI
|
||||
// 構建 UI
|
||||
// ============================================
|
||||
|
||||
@override
|
||||
@@ -98,7 +98,7 @@ class _ProfitAnalysisPageState extends State<ProfitAnalysisPage> {
|
||||
return Scaffold(
|
||||
backgroundColor: context.colors.surface,
|
||||
appBar: AppBar(
|
||||
title: const Text('盈亏分析'),
|
||||
title: const Text('盈虧分析'),
|
||||
backgroundColor: context.colors.surface,
|
||||
elevation: 0,
|
||||
scrolledUnderElevation: 0,
|
||||
@@ -116,19 +116,19 @@ class _ProfitAnalysisPageState extends State<ProfitAnalysisPage> {
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
// 月度盈亏摘要
|
||||
// 月度盈虧摘要
|
||||
_buildSummarySection(),
|
||||
SizedBox(height: AppSpacing.md),
|
||||
|
||||
// 月份导航
|
||||
// 月份導航
|
||||
_buildMonthNavigation(isCurrentMonth),
|
||||
SizedBox(height: AppSpacing.sm),
|
||||
|
||||
// 星期标题
|
||||
// 星期標題
|
||||
_buildWeekdayHeaders(),
|
||||
SizedBox(height: AppSpacing.xs),
|
||||
|
||||
// 日历网格
|
||||
// 日曆網格
|
||||
if (_isLoading)
|
||||
_buildLoadingIndicator()
|
||||
else
|
||||
@@ -143,7 +143,7 @@ class _ProfitAnalysisPageState extends State<ProfitAnalysisPage> {
|
||||
);
|
||||
}
|
||||
|
||||
/// 月度盈亏摘要
|
||||
/// 月度盈虧摘要
|
||||
Widget _buildSummarySection() {
|
||||
final upColor = context.appColors.up;
|
||||
final downColor = context.appColors.down;
|
||||
@@ -153,7 +153,7 @@ class _ProfitAnalysisPageState extends State<ProfitAnalysisPage> {
|
||||
return Column(
|
||||
children: [
|
||||
Text(
|
||||
'月度盈亏',
|
||||
'月度盈虧',
|
||||
style: AppTextStyles.bodyMedium(context).copyWith(
|
||||
color: context.colors.onSurfaceVariant,
|
||||
),
|
||||
@@ -172,7 +172,7 @@ class _ProfitAnalysisPageState extends State<ProfitAnalysisPage> {
|
||||
);
|
||||
}
|
||||
|
||||
/// 月份导航行
|
||||
/// 月份導航行
|
||||
Widget _buildMonthNavigation(bool isCurrentMonth) {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
@@ -193,14 +193,14 @@ class _ProfitAnalysisPageState extends State<ProfitAnalysisPage> {
|
||||
),
|
||||
),
|
||||
),
|
||||
// 当前年月
|
||||
// 當前年月
|
||||
Text(
|
||||
'${_currentMonth.year}年${_currentMonth.month}月',
|
||||
style: AppTextStyles.headlineMedium(context).copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
// 下一月(当前月禁用)
|
||||
// 下一月(當前月禁用)
|
||||
GestureDetector(
|
||||
onTap: isCurrentMonth ? null : _nextMonth,
|
||||
child: Container(
|
||||
@@ -224,7 +224,7 @@ class _ProfitAnalysisPageState extends State<ProfitAnalysisPage> {
|
||||
);
|
||||
}
|
||||
|
||||
/// 星期标题行
|
||||
/// 星期標題行
|
||||
Widget _buildWeekdayHeaders() {
|
||||
return Row(
|
||||
children: ['一', '二', '三', '四', '五', '六', '日'].map((d) {
|
||||
@@ -243,7 +243,7 @@ class _ProfitAnalysisPageState extends State<ProfitAnalysisPage> {
|
||||
);
|
||||
}
|
||||
|
||||
/// 加载指示器
|
||||
/// 加載指示器
|
||||
Widget _buildLoadingIndicator() {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: AppSpacing.xxl),
|
||||
@@ -260,7 +260,7 @@ class _ProfitAnalysisPageState extends State<ProfitAnalysisPage> {
|
||||
);
|
||||
}
|
||||
|
||||
/// 日历网格
|
||||
/// 日曆網格
|
||||
List<Widget> _buildCalendarGrid(
|
||||
DateTime now,
|
||||
bool isCurrentMonth,
|
||||
|
||||
Reference in New Issue
Block a user