Files
feature-tenant/lib/features/v2/home/presentation/widgets/plant_overview_card.dart
2026-05-19 08:46:35 +08:00

113 lines
3.8 KiB
Dart

import 'package:flutter/material.dart';
import 'package:maibu_satabot_v2/features/v2/home/domain/entities/home_entity.dart';
class PlantOverviewCard extends StatelessWidget {
final PlantOverview overview;
const PlantOverviewCard({super.key, required this.overview});
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
'电站概况',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: Color(0xFF1D2129),
),
),
const SizedBox(height: 12),
Container(
height: 120,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
image: DecorationImage(
image: AssetImage(overview.backgroundImage),
fit: BoxFit.cover,
),
boxShadow: const [
BoxShadow(
color: Color(0x0D000000),
blurRadius: 4,
offset: Offset(0, 2),
),
],
),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Colors.transparent,
Colors.black.withOpacity(0.6),
],
),
),
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
'装机容量',
style: TextStyle(
color: Colors.white70,
fontSize: 12,
),
),
const SizedBox(height: 4),
Text(
'${overview.installedCapacity} MWp',
style: const TextStyle(
color: Colors.white,
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
const Text(
'投运日期',
style: TextStyle(
color: Colors.white70,
fontSize: 12,
),
),
const SizedBox(height: 4),
Text(
overview.commissionDate,
style: const TextStyle(
color: Colors.white,
fontSize: 14,
fontWeight: FontWeight.w500,
),
),
],
),
],
),
],
),
),
),
),
],
);
}
}