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,17 +165,17 @@ class DashboardPage extends ConsumerWidget {
|
|||
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Row(
|
||||
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)),
|
||||
],
|
||||
IntrinsicHeight(
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Expanded(child: _buildServerCard(serverAsync)),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(child: _buildAlertCard(alertAsync)),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(child: _buildTasksCard(recentOpsAsync)),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
// ------------- Recent operations --------------------------------
|
||||
|
|
@ -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,26 +415,21 @@ 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),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(Icons.error_outline, color: AppColors.error, size: 28),
|
||||
const SizedBox(height: 6),
|
||||
Text(
|
||||
message,
|
||||
style: const TextStyle(color: AppColors.error, fontSize: 11),
|
||||
textAlign: TextAlign.center,
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
],
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(14),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(Icons.error_outline, color: AppColors.error, size: 28),
|
||||
const SizedBox(height: 6),
|
||||
Text(
|
||||
message,
|
||||
style: const TextStyle(color: AppColors.error, fontSize: 11),
|
||||
textAlign: TextAlign.center,
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue