mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-16 01:56:24 +00:00
@ -5,8 +5,7 @@ import 'package:syncrow_web/utils/constants/assets.dart';
|
||||
class PhaseWidget extends StatefulWidget {
|
||||
final List<Map<String, dynamic>> phaseData;
|
||||
|
||||
const PhaseWidget({
|
||||
super.key,
|
||||
PhaseWidget({
|
||||
required this.phaseData,
|
||||
});
|
||||
@override
|
||||
@ -20,7 +19,7 @@ class _PhaseWidgetState extends State<PhaseWidget> {
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(height: 10),
|
||||
Row(
|
||||
children: List.generate(widget.phaseData.length, (index) {
|
||||
return InkWell(
|
||||
@ -44,28 +43,27 @@ class _PhaseWidgetState extends State<PhaseWidget> {
|
||||
);
|
||||
}),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
if (_selectedPhaseIndex == 0)
|
||||
phase(
|
||||
totalActive: widget.phaseData[0]['activePower'] ?? '0',
|
||||
totalCurrent: widget.phaseData[0]['current'] ?? '0',
|
||||
totalFactor: widget.phaseData[0]['powerFactor'] ?? '0',
|
||||
totalVoltage: widget.phaseData[0]['voltage'] ?? '0',
|
||||
)
|
||||
else
|
||||
_selectedPhaseIndex == 1
|
||||
? phase(
|
||||
totalActive: widget.phaseData[1]['activePower'] ?? '0',
|
||||
totalCurrent: widget.phaseData[1]['current'] ?? '0',
|
||||
totalFactor: widget.phaseData[1]['powerFactor'] ?? '0',
|
||||
totalVoltage: widget.phaseData[1]['voltage'] ?? '0',
|
||||
)
|
||||
: phase(
|
||||
totalActive: widget.phaseData[2]['activePower'] ?? '0',
|
||||
totalCurrent: widget.phaseData[2]['current'] ?? '0',
|
||||
totalFactor: widget.phaseData[2]['powerFactor'] ?? '0',
|
||||
totalVoltage: widget.phaseData[2]['voltage'] ?? '0',
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
_selectedPhaseIndex == 0
|
||||
? phase(
|
||||
totalActive: widget.phaseData[0]['activePower'] ?? '0',
|
||||
totalCurrent: widget.phaseData[0]['current'] ?? '0',
|
||||
totalFactor: widget.phaseData[0]['powerFactor'] ?? '0',
|
||||
totalVoltage: widget.phaseData[0]['voltage'] ?? '0',
|
||||
)
|
||||
: _selectedPhaseIndex == 1
|
||||
? phase(
|
||||
totalActive: widget.phaseData[1]['activePower'] ?? '0',
|
||||
totalCurrent: widget.phaseData[1]['current'] ?? '0',
|
||||
totalFactor: widget.phaseData[1]['powerFactor'] ?? '0',
|
||||
totalVoltage: widget.phaseData[1]['voltage'] ?? '0',
|
||||
)
|
||||
: phase(
|
||||
totalActive: widget.phaseData[2]['activePower'] ?? '0',
|
||||
totalCurrent: widget.phaseData[2]['current'] ?? '0',
|
||||
totalFactor: widget.phaseData[2]['powerFactor'] ?? '0',
|
||||
totalVoltage: widget.phaseData[2]['voltage'] ?? '0',
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user