迁移提交
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:maibu_satabot_v2/core/localization/app_localizations.dart';
|
||||
import 'package:maibu_satabot_v2/core/theme/AppTheme.dart';
|
||||
import 'package:maibu_satabot_v2/features/v2/home/domain/entities/home_entity.dart';
|
||||
|
||||
class StatsGrid extends StatelessWidget {
|
||||
@@ -19,21 +20,23 @@ class StatsGrid extends StatelessWidget {
|
||||
padding: EdgeInsets.zero,
|
||||
children: [
|
||||
_buildStatCard(
|
||||
context,
|
||||
title: AppLocalizations.of(
|
||||
context,
|
||||
).translate('home_v2.today_generation'),
|
||||
value: _formatNumber(data.todayGeneration),
|
||||
unit: 'kWh',
|
||||
valueColor: const Color(0xFF00B42A),
|
||||
valueColor: context.appColors.success,
|
||||
showArrow: false,
|
||||
),
|
||||
_buildStatCard(
|
||||
context,
|
||||
title: AppLocalizations.of(
|
||||
context,
|
||||
).translate('home_v2.equivalent_hours'),
|
||||
value: data.equivalentHours.toStringAsFixed(1),
|
||||
unit: 'h',
|
||||
valueColor: const Color(0xFF165DFF),
|
||||
valueColor: context.appColors.primary,
|
||||
showArrow: false,
|
||||
),
|
||||
_buildAlarmCard(context, data.alarmCount),
|
||||
@@ -42,7 +45,8 @@ class StatsGrid extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildStatCard({
|
||||
Widget _buildStatCard(
|
||||
BuildContext context, {
|
||||
required String title,
|
||||
required String value,
|
||||
required String unit,
|
||||
@@ -52,13 +56,13 @@ class StatsGrid extends StatelessWidget {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: context.appColors.cardBackground,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
boxShadow: const [
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Color(0x0D000000),
|
||||
color: context.appColors.cardShadow,
|
||||
blurRadius: 4,
|
||||
offset: Offset(0, 2),
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -71,22 +75,25 @@ class StatsGrid extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: const TextStyle(
|
||||
color: Color(0xFF4E5969),
|
||||
style: TextStyle(
|
||||
color: context.appColors.textSecondary,
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
const Icon(
|
||||
Icon(
|
||||
Icons.arrow_forward_ios,
|
||||
size: 14,
|
||||
color: Color(0xFF86909C),
|
||||
color: context.appColors.textTertiary,
|
||||
),
|
||||
],
|
||||
)
|
||||
else
|
||||
Text(
|
||||
title,
|
||||
style: const TextStyle(color: Color(0xFF4E5969), fontSize: 14),
|
||||
style: TextStyle(
|
||||
color: context.appColors.textSecondary,
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
Row(
|
||||
@@ -103,7 +110,10 @@ class StatsGrid extends StatelessWidget {
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
unit,
|
||||
style: const TextStyle(color: Color(0xFF4E5969), fontSize: 14),
|
||||
style: TextStyle(
|
||||
color: context.appColors.textSecondary,
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -116,13 +126,13 @@ class StatsGrid extends StatelessWidget {
|
||||
return Container(
|
||||
padding: const EdgeInsets.fromLTRB(12, 0, 12, 12),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFFFF0F0),
|
||||
color: context.appColors.danger.withOpacity(0.1),
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
boxShadow: const [
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Color(0x0D000000),
|
||||
color: context.appColors.cardShadow,
|
||||
blurRadius: 4,
|
||||
offset: Offset(0, 2),
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -135,8 +145,8 @@ class StatsGrid extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
AppLocalizations.of(context).translate('home_v2.alarm_count'),
|
||||
style: const TextStyle(
|
||||
color: Color(0xFFF53F3F),
|
||||
style: TextStyle(
|
||||
color: context.appColors.danger,
|
||||
fontSize: 13,
|
||||
),
|
||||
maxLines: 1,
|
||||
@@ -145,8 +155,8 @@ class StatsGrid extends StatelessWidget {
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
count.toString(),
|
||||
style: const TextStyle(
|
||||
color: Color(0xFFF53F3F),
|
||||
style: TextStyle(
|
||||
color: context.appColors.danger,
|
||||
fontSize: 28,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -157,14 +167,14 @@ class StatsGrid extends StatelessWidget {
|
||||
Container(
|
||||
width: 44,
|
||||
height: 44,
|
||||
decoration: const BoxDecoration(
|
||||
color: Color(0xFFFFE8E8),
|
||||
decoration: BoxDecoration(
|
||||
color: context.appColors.danger.withOpacity(0.15),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: const Icon(
|
||||
child: Icon(
|
||||
Icons.notifications_none,
|
||||
size: 24,
|
||||
color: Color(0xFFF53F3F),
|
||||
color: context.appColors.danger,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -176,13 +186,13 @@ class StatsGrid extends StatelessWidget {
|
||||
return Container(
|
||||
padding: const EdgeInsets.fromLTRB(12, 0, 12, 12),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: context.appColors.cardBackground,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
boxShadow: const [
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Color(0x0D000000),
|
||||
color: context.appColors.cardShadow,
|
||||
blurRadius: 4,
|
||||
offset: Offset(0, 2),
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -197,8 +207,8 @@ class StatsGrid extends StatelessWidget {
|
||||
AppLocalizations.of(
|
||||
context,
|
||||
).translate('home_v2.pending_work_order'),
|
||||
style: const TextStyle(
|
||||
color: Color(0xFF4E5969),
|
||||
style: TextStyle(
|
||||
color: context.appColors.textSecondary,
|
||||
fontSize: 13,
|
||||
),
|
||||
maxLines: 1,
|
||||
@@ -207,8 +217,8 @@ class StatsGrid extends StatelessWidget {
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
count.toString(),
|
||||
style: const TextStyle(
|
||||
color: Color(0xFF1D2129),
|
||||
style: TextStyle(
|
||||
color: context.appColors.textPrimary,
|
||||
fontSize: 28,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -219,14 +229,14 @@ class StatsGrid extends StatelessWidget {
|
||||
Container(
|
||||
width: 44,
|
||||
height: 44,
|
||||
decoration: const BoxDecoration(
|
||||
color: Color(0xFFE8F3FF),
|
||||
decoration: BoxDecoration(
|
||||
color: context.appColors.primary.withOpacity(0.1),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: const Icon(
|
||||
child: Icon(
|
||||
Icons.content_paste,
|
||||
size: 24,
|
||||
color: Color(0xFF165DFF),
|
||||
color: context.appColors.primary,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user