mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-15 17:47:53 +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,
|
mainAxisSize: MainAxisSize.min,
|
||||||
spacing: 20,
|
spacing: 20,
|
||||||
children: [
|
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,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
@ -66,16 +85,6 @@ class _EnergyConsumptionByPhasesChartBoxState
|
|||||||
('C', 0.15),
|
('C', 0.15),
|
||||||
].map((phase) => _buildPhaseCell(context, phase)),
|
].map((phase) => _buildPhaseCell(context, phase)),
|
||||||
],
|
],
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: EnergyConsumptionByPhasesChart(
|
|
||||||
energyData: state.chartData,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user