fix: 仪表盘概览卡片等高对齐
- Row 外层包 IntrinsicHeight + CrossAxisAlignment.stretch,三卡自动等高 - Loading/Error 卡片去掉固定 height:140,改为 padding + stretch 拉伸 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
4e55e9a616
commit
68004409a3
|
|
@ -165,18 +165,18 @@ class DashboardPage extends ConsumerWidget {
|
|||
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Row(
|
||||
IntrinsicHeight(
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
// Server card
|
||||
Expanded(child: _buildServerCard(serverAsync)),
|
||||
const SizedBox(width: 12),
|
||||
// Alert card
|
||||
Expanded(child: _buildAlertCard(alertAsync)),
|
||||
const SizedBox(width: 12),
|
||||
// Tasks card
|
||||
Expanded(child: _buildTasksCard(recentOpsAsync)),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
// ------------- Recent operations --------------------------------
|
||||
const Text(
|
||||
|
|
@ -399,8 +399,8 @@ class _SummaryCardLoading extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
return const Card(
|
||||
color: AppColors.surface,
|
||||
child: SizedBox(
|
||||
height: 140,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(14),
|
||||
child: Center(child: CircularProgressIndicator(strokeWidth: 2)),
|
||||
),
|
||||
);
|
||||
|
|
@ -415,11 +415,8 @@ class _SummaryCardError extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
return Card(
|
||||
color: AppColors.surface,
|
||||
child: SizedBox(
|
||||
height: 140,
|
||||
child: Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12),
|
||||
padding: const EdgeInsets.all(14),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
|
|
@ -435,8 +432,6 @@ class _SummaryCardError extends StatelessWidget {
|
|||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue