迁移提交
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 PlantOverviewCard extends StatelessWidget {
|
||||
@@ -14,10 +15,10 @@ class PlantOverviewCard extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
AppLocalizations.of(context).translate('home_v2.plant_overview'),
|
||||
style: const TextStyle(
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xFF1D2129),
|
||||
color: context.appColors.textPrimary,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
@@ -29,11 +30,11 @@ class PlantOverviewCard extends StatelessWidget {
|
||||
image: AssetImage(overview.backgroundImage),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
boxShadow: const [
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Color(0x0D000000),
|
||||
color: context.appColors.cardShadow,
|
||||
blurRadius: 4,
|
||||
offset: Offset(0, 2),
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fl_chart/fl_chart.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 PowerCard extends StatelessWidget {
|
||||
@@ -24,11 +25,11 @@ class PowerCard extends StatelessWidget {
|
||||
end: Alignment.bottomRight,
|
||||
),
|
||||
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),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fl_chart/fl_chart.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 PowerTrendChart extends StatelessWidget {
|
||||
@@ -25,25 +26,27 @@ class PowerTrendChart extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
AppLocalizations.of(context).translate('home_v2.power_trend'),
|
||||
style: const TextStyle(
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xFF1D2129),
|
||||
color: context.appColors.textPrimary,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 32,
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFF5F7FA),
|
||||
color: context.appColors.fillBackground,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
_buildTypeButton(
|
||||
context,
|
||||
'day',
|
||||
AppLocalizations.of(context).translate('home_v2.day'),
|
||||
),
|
||||
_buildTypeButton(
|
||||
context,
|
||||
'month',
|
||||
AppLocalizations.of(context).translate('home_v2.month'),
|
||||
),
|
||||
@@ -57,13 +60,13 @@ class PowerTrendChart extends StatelessWidget {
|
||||
height: 220,
|
||||
padding: const EdgeInsets.all(16),
|
||||
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),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -76,13 +79,13 @@ class PowerTrendChart extends StatelessWidget {
|
||||
verticalInterval: 6,
|
||||
getDrawingHorizontalLine: (value) {
|
||||
return FlLine(
|
||||
color: const Color(0xFFE5E6EB).withOpacity(0.3),
|
||||
color: context.appColors.divider.withOpacity(0.3),
|
||||
strokeWidth: 1,
|
||||
);
|
||||
},
|
||||
getDrawingVerticalLine: (value) {
|
||||
return FlLine(
|
||||
color: const Color(0xFFE5E6EB).withOpacity(0.3),
|
||||
color: context.appColors.divider.withOpacity(0.3),
|
||||
strokeWidth: 1,
|
||||
);
|
||||
},
|
||||
@@ -108,8 +111,8 @@ class PowerTrendChart extends StatelessWidget {
|
||||
}
|
||||
return Text(
|
||||
time,
|
||||
style: const TextStyle(
|
||||
color: Color(0xFF86909C),
|
||||
style: TextStyle(
|
||||
color: context.appColors.textTertiary,
|
||||
fontSize: 12,
|
||||
),
|
||||
);
|
||||
@@ -126,8 +129,8 @@ class PowerTrendChart extends StatelessWidget {
|
||||
getTitlesWidget: (value, meta) {
|
||||
return Text(
|
||||
value.toInt().toString(),
|
||||
style: const TextStyle(
|
||||
color: Color(0xFF86909C),
|
||||
style: TextStyle(
|
||||
color: context.appColors.textTertiary,
|
||||
fontSize: 12,
|
||||
),
|
||||
);
|
||||
@@ -154,14 +157,14 @@ class PowerTrendChart extends StatelessWidget {
|
||||
.map((e) => FlSpot(e.key.toDouble(), e.value.power))
|
||||
.toList(),
|
||||
isCurved: true,
|
||||
color: const Color(0xFF165DFF),
|
||||
color: context.appColors.primary,
|
||||
barWidth: 2,
|
||||
dotData: FlDotData(
|
||||
show: true,
|
||||
getDotPainter: (spot, percent, barData, index) {
|
||||
return FlDotCirclePainter(
|
||||
radius: 2,
|
||||
color: const Color(0xFF165DFF),
|
||||
color: context.appColors.primary,
|
||||
);
|
||||
},
|
||||
),
|
||||
@@ -169,8 +172,8 @@ class PowerTrendChart extends StatelessWidget {
|
||||
show: true,
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
const Color(0xFF165DFF).withOpacity(0.2),
|
||||
const Color(0xFF165DFF).withOpacity(0.0),
|
||||
context.appColors.primary.withOpacity(0.2),
|
||||
context.appColors.primary.withOpacity(0.0),
|
||||
],
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
@@ -185,7 +188,7 @@ class PowerTrendChart extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildTypeButton(String type, String label) {
|
||||
Widget _buildTypeButton(BuildContext context, String type, String label) {
|
||||
final isSelected = trendType == type;
|
||||
return GestureDetector(
|
||||
onTap: () => onToggleType(type),
|
||||
@@ -193,14 +196,16 @@ class PowerTrendChart extends StatelessWidget {
|
||||
width: 50,
|
||||
height: 32,
|
||||
decoration: BoxDecoration(
|
||||
color: isSelected ? const Color(0xFF165DFF) : Colors.transparent,
|
||||
color: isSelected ? context.appColors.primary : Colors.transparent,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
label,
|
||||
style: TextStyle(
|
||||
color: isSelected ? Colors.white : const Color(0xFF86909C),
|
||||
color: isSelected
|
||||
? Colors.white
|
||||
: context.appColors.textTertiary,
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -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';
|
||||
|
||||
class QuickEntryCard extends StatelessWidget {
|
||||
const QuickEntryCard({super.key});
|
||||
@@ -14,16 +15,16 @@ class QuickEntryCard extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
AppLocalizations.of(context).translate('home_v2.quick_entry'),
|
||||
style: const TextStyle(
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xFF1D2129),
|
||||
color: context.appColors.textPrimary,
|
||||
),
|
||||
),
|
||||
const Icon(
|
||||
Icon(
|
||||
Icons.arrow_forward_ios,
|
||||
size: 16,
|
||||
color: Color(0xFF86909C),
|
||||
color: context.appColors.textTertiary,
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -36,6 +37,7 @@ class QuickEntryCard extends StatelessWidget {
|
||||
padding: const EdgeInsets.only(right: 16),
|
||||
children: [
|
||||
_buildQuickEntryCard(
|
||||
context,
|
||||
icon: Icons.upload_file,
|
||||
label: AppLocalizations.of(
|
||||
context,
|
||||
@@ -43,6 +45,7 @@ class QuickEntryCard extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
_buildQuickEntryCard(
|
||||
context,
|
||||
icon: Icons.qr_code_scanner,
|
||||
label: AppLocalizations.of(
|
||||
context,
|
||||
@@ -50,6 +53,7 @@ class QuickEntryCard extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
_buildQuickEntryCard(
|
||||
context,
|
||||
icon: Icons.assignment,
|
||||
label: AppLocalizations.of(
|
||||
context,
|
||||
@@ -57,6 +61,7 @@ class QuickEntryCard extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
_buildQuickEntryCard(
|
||||
context,
|
||||
icon: Icons.notifications_active,
|
||||
label: AppLocalizations.of(
|
||||
context,
|
||||
@@ -64,6 +69,7 @@ class QuickEntryCard extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
_buildQuickEntryCard(
|
||||
context,
|
||||
icon: Icons.map,
|
||||
label: AppLocalizations.of(
|
||||
context,
|
||||
@@ -71,6 +77,7 @@ class QuickEntryCard extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
_buildQuickEntryCard(
|
||||
context,
|
||||
icon: Icons.devices,
|
||||
label: AppLocalizations.of(
|
||||
context,
|
||||
@@ -84,7 +91,11 @@ class QuickEntryCard extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildQuickEntryCard({required IconData icon, required String label}) {
|
||||
Widget _buildQuickEntryCard(
|
||||
BuildContext context, {
|
||||
required IconData icon,
|
||||
required String label,
|
||||
}) {
|
||||
return InkWell(
|
||||
onTap: () => print('点击:$label'),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
@@ -94,26 +105,26 @@ class QuickEntryCard extends StatelessWidget {
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: context.appColors.cardBackground,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
boxShadow: const [
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Color(0x0D000000),
|
||||
color: context.appColors.cardShadow,
|
||||
blurRadius: 4,
|
||||
offset: Offset(0, 2),
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(icon, color: const Color(0xFF165DFF), size: 26),
|
||||
Icon(icon, color: context.appColors.primary, size: 26),
|
||||
const SizedBox(height: 6),
|
||||
Text(
|
||||
label,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
color: Color(0xFF4E5969),
|
||||
style: TextStyle(
|
||||
color: context.appColors.textSecondary,
|
||||
fontSize: 12,
|
||||
height: 1.2,
|
||||
),
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -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 WorkOrderCard extends StatelessWidget {
|
||||
@@ -19,16 +20,16 @@ class WorkOrderCard extends StatelessWidget {
|
||||
AppLocalizations.of(
|
||||
context,
|
||||
).translate('home_v2.pending_work_order'),
|
||||
style: const TextStyle(
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xFF1D2129),
|
||||
color: context.appColors.textPrimary,
|
||||
),
|
||||
),
|
||||
const Icon(
|
||||
Icon(
|
||||
Icons.arrow_forward_ios,
|
||||
size: 16,
|
||||
color: Color(0xFF86909C),
|
||||
color: context.appColors.textTertiary,
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -37,34 +38,37 @@ class WorkOrderCard extends StatelessWidget {
|
||||
children: [
|
||||
Expanded(
|
||||
child: _buildWorkOrderCard(
|
||||
context,
|
||||
title: AppLocalizations.of(
|
||||
context,
|
||||
).translate('home_v2.work_order_pending'),
|
||||
count: stats.pending,
|
||||
color: const Color(0xFFF53F3F),
|
||||
bgColor: Colors.white,
|
||||
color: context.appColors.danger,
|
||||
bgColor: context.appColors.cardBackground,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: _buildWorkOrderCard(
|
||||
context,
|
||||
title: AppLocalizations.of(
|
||||
context,
|
||||
).translate('home_v2.work_order_processing'),
|
||||
count: stats.processing,
|
||||
color: const Color(0xFFFF7D00),
|
||||
bgColor: const Color(0xFFFFF7E6),
|
||||
color: context.appColors.warning,
|
||||
bgColor: context.appColors.warning.withOpacity(0.1),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: _buildWorkOrderCard(
|
||||
context,
|
||||
title: AppLocalizations.of(
|
||||
context,
|
||||
).translate('home_v2.work_order_pending_acceptance'),
|
||||
count: stats.pendingAcceptance,
|
||||
color: const Color(0xFF1D2129),
|
||||
bgColor: Colors.white,
|
||||
color: context.appColors.textPrimary,
|
||||
bgColor: context.appColors.cardBackground,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -73,7 +77,8 @@ class WorkOrderCard extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildWorkOrderCard({
|
||||
Widget _buildWorkOrderCard(
|
||||
BuildContext context, {
|
||||
required String title,
|
||||
required int count,
|
||||
required Color color,
|
||||
@@ -84,11 +89,11 @@ class WorkOrderCard extends StatelessWidget {
|
||||
decoration: BoxDecoration(
|
||||
color: bgColor,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
boxShadow: const [
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Color(0x0D000000),
|
||||
color: context.appColors.cardShadow,
|
||||
blurRadius: 4,
|
||||
offset: Offset(0, 2),
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user