fix: 修复DetailedAnalysisReport中嵌套LazyColumn导致的崩溃

- 将DetailedAnalysisReport中的LazyColumn改为Column
- 移除所有item{}包装,直接使用普通组件布局
- 解决'Vertically scrollable component was measured with an infinity maximum height constraints'错误

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
yovinchen 2025-07-20 00:20:59 +08:00
parent 74cc6f36a9
commit 562617ca11

View File

@ -54,12 +54,11 @@ fun DetailedAnalysisReport(
val totalIncome = incomeRecords.sumOf { it.amount } val totalIncome = incomeRecords.sumOf { it.amount }
val totalExpense = expenseRecords.sumOf { it.amount } val totalExpense = expenseRecords.sumOf { it.amount }
LazyColumn( Column(
modifier = modifier, modifier = modifier,
verticalArrangement = Arrangement.spacedBy(16.dp) verticalArrangement = Arrangement.spacedBy(16.dp)
) { ) {
// 时间范围标题 // 时间范围标题
item {
Card( Card(
modifier = Modifier.fillMaxWidth(), modifier = Modifier.fillMaxWidth(),
elevation = CardDefaults.cardElevation(defaultElevation = 2.dp) elevation = CardDefaults.cardElevation(defaultElevation = 2.dp)
@ -76,11 +75,9 @@ fun DetailedAnalysisReport(
textAlign = TextAlign.Center textAlign = TextAlign.Center
) )
} }
}
// 支出分类详情 // 支出分类详情
if (expenseByCategory.isNotEmpty()) { if (expenseByCategory.isNotEmpty()) {
item {
CategoryDetailCard( CategoryDetailCard(
title = "支出分类明细", title = "支出分类明细",
categoryData = expenseByCategory, categoryData = expenseByCategory,
@ -89,11 +86,9 @@ fun DetailedAnalysisReport(
currencyFormatter = currencyFormatter currencyFormatter = currencyFormatter
) )
} }
}
// 收入分类详情 // 收入分类详情
if (incomeByCategory.isNotEmpty()) { if (incomeByCategory.isNotEmpty()) {
item {
CategoryDetailCard( CategoryDetailCard(
title = "收入分类明细", title = "收入分类明细",
categoryData = incomeByCategory, categoryData = incomeByCategory,
@ -102,11 +97,9 @@ fun DetailedAnalysisReport(
currencyFormatter = currencyFormatter currencyFormatter = currencyFormatter
) )
} }
}
// 分类占比前5名 // 分类占比前5名
if (expenseByCategory.isNotEmpty()) { if (expenseByCategory.isNotEmpty()) {
item {
TopCategoriesCard( TopCategoriesCard(
title = "支出TOP5", title = "支出TOP5",
categoryData = expenseByCategory.take(5), categoryData = expenseByCategory.take(5),
@ -117,7 +110,6 @@ fun DetailedAnalysisReport(
} }
} }
} }
}
/** /**
* 分类详情卡片 * 分类详情卡片