mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 23:27:25 +00:00
28 lines
708 B
Dart
28 lines
708 B
Dart
import 'package:equatable/equatable.dart';
|
|
|
|
class PhasesEnergyConsumption extends Equatable {
|
|
final int month;
|
|
final double phaseA;
|
|
final double phaseB;
|
|
final double phaseC;
|
|
|
|
const PhasesEnergyConsumption({
|
|
required this.month,
|
|
required this.phaseA,
|
|
required this.phaseB,
|
|
required this.phaseC,
|
|
});
|
|
|
|
@override
|
|
List<Object?> get props => [month, phaseA, phaseB, phaseC];
|
|
|
|
factory PhasesEnergyConsumption.fromJson(Map<String, dynamic> json) {
|
|
return PhasesEnergyConsumption(
|
|
month: json['month'] as int,
|
|
phaseA: (json['phaseA'] as num).toDouble(),
|
|
phaseB: (json['phaseB'] as num).toDouble(),
|
|
phaseC: (json['phaseC'] as num).toDouble(),
|
|
);
|
|
}
|
|
}
|