update gitignore
This commit is contained in:
45
lib/model/electric_model.dart
Normal file
45
lib/model/electric_model.dart
Normal file
@ -0,0 +1,45 @@
|
||||
class ElectricModel {
|
||||
String? fase;
|
||||
String? voltage;
|
||||
String? current;
|
||||
String? power;
|
||||
String? energy;
|
||||
String? pf;
|
||||
String? time;
|
||||
String? date;
|
||||
|
||||
ElectricModel(
|
||||
{this.fase,
|
||||
this.voltage,
|
||||
this.current,
|
||||
this.power,
|
||||
this.energy,
|
||||
this.pf,
|
||||
this.time,
|
||||
this.date});
|
||||
|
||||
ElectricModel.fromJson(Map<String, dynamic> json) {
|
||||
fase = json['fase'];
|
||||
voltage = json['voltage'];
|
||||
current = json['current'];
|
||||
power = json['power'];
|
||||
energy = json['energy'];
|
||||
pf = json['pf'];
|
||||
time = json['time'];
|
||||
// just get the date only
|
||||
date = json['date'] == null ? '' : json['date'].substring(0, 10);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['fase'] = fase;
|
||||
data['voltage'] = voltage;
|
||||
data['current'] = current;
|
||||
data['power'] = power;
|
||||
data['energy'] = energy;
|
||||
data['pf'] = pf;
|
||||
data['time'] = time;
|
||||
data['date'] = date;
|
||||
return data;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user