mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-14 09:17:37 +00:00
Extracted EnergyConsumptionByPhasesTitle
into its own widget to improve readability and assert separation of concerns.
This commit is contained in:
@ -39,7 +39,26 @@ class _EnergyConsumptionByPhasesChartBoxState
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
spacing: 20,
|
||||
children: [
|
||||
Row(
|
||||
const EnergyConsumptionByPhasesTitle(),
|
||||
Expanded(
|
||||
child: EnergyConsumptionByPhasesChart(
|
||||
energyData: state.chartData,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class EnergyConsumptionByPhasesTitle extends StatelessWidget {
|
||||
const EnergyConsumptionByPhasesTitle({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
@ -66,16 +85,6 @@ class _EnergyConsumptionByPhasesChartBoxState
|
||||
('C', 0.15),
|
||||
].map((phase) => _buildPhaseCell(context, phase)),
|
||||
],
|
||||
),
|
||||
Expanded(
|
||||
child: EnergyConsumptionByPhasesChart(
|
||||
energyData: state.chartData,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user