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),
|
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
Row(
|
IntrinsicHeight(
|
||||||
|
child: Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
// Server card
|
|
||||||
Expanded(child: _buildServerCard(serverAsync)),
|
Expanded(child: _buildServerCard(serverAsync)),
|
||||||
const SizedBox(width: 12),
|
const SizedBox(width: 12),
|
||||||
// Alert card
|
|
||||||
Expanded(child: _buildAlertCard(alertAsync)),
|
Expanded(child: _buildAlertCard(alertAsync)),
|
||||||
const SizedBox(width: 12),
|
const SizedBox(width: 12),
|
||||||
// Tasks card
|
|
||||||
Expanded(child: _buildTasksCard(recentOpsAsync)),
|
Expanded(child: _buildTasksCard(recentOpsAsync)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
const SizedBox(height: 24),
|
const SizedBox(height: 24),
|
||||||
// ------------- Recent operations --------------------------------
|
// ------------- Recent operations --------------------------------
|
||||||
const Text(
|
const Text(
|
||||||
|
|
@ -399,8 +399,8 @@ class _SummaryCardLoading extends StatelessWidget {
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return const Card(
|
return const Card(
|
||||||
color: AppColors.surface,
|
color: AppColors.surface,
|
||||||
child: SizedBox(
|
child: Padding(
|
||||||
height: 140,
|
padding: EdgeInsets.all(14),
|
||||||
child: Center(child: CircularProgressIndicator(strokeWidth: 2)),
|
child: Center(child: CircularProgressIndicator(strokeWidth: 2)),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
@ -415,11 +415,8 @@ class _SummaryCardError extends StatelessWidget {
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Card(
|
return Card(
|
||||||
color: AppColors.surface,
|
color: AppColors.surface,
|
||||||
child: SizedBox(
|
|
||||||
height: 140,
|
|
||||||
child: Center(
|
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(12),
|
padding: const EdgeInsets.all(14),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
|
|
@ -435,8 +432,6 @@ class _SummaryCardError extends StatelessWidget {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue