samsung integration addded
parent
df0b926e59
commit
5ea70397e2
File diff suppressed because one or more lines are too long
@ -0,0 +1,56 @@
|
||||
class Vitals {
|
||||
final String value;
|
||||
final String timestamp;
|
||||
|
||||
Vitals({
|
||||
required this.value,
|
||||
required this.timestamp,
|
||||
});
|
||||
|
||||
factory Vitals.fromMap(Map<dynamic, dynamic> map) {
|
||||
return Vitals(
|
||||
value: map['value'] ?? "",
|
||||
timestamp: map['timestamp'] ?? "",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class VitalsWRTType {
|
||||
final List<Vitals> heartRate;
|
||||
final List<Vitals> sleep;
|
||||
final List<Vitals> step;
|
||||
final List<Vitals> activity;
|
||||
final List<Vitals> bodyOxygen;
|
||||
final List<Vitals> bodyTemperature;
|
||||
|
||||
VitalsWRTType({required this.bodyOxygen, required this.bodyTemperature, required this.heartRate, required this.sleep, required this.step, required this.activity});
|
||||
|
||||
factory VitalsWRTType.fromMap(Map<dynamic, dynamic> map) {
|
||||
List<Vitals> activity = [];
|
||||
List<Vitals> steps = [];
|
||||
List<Vitals> sleeps = [];
|
||||
List<Vitals> heartRate = [];
|
||||
List<Vitals> bodyOxygen = [];
|
||||
List<Vitals> bodyTemperature = [];
|
||||
map["activity"].forEach((element) {
|
||||
activity.add(Vitals.fromMap(element));
|
||||
});
|
||||
map["steps"].forEach((element) {
|
||||
steps.add(Vitals.fromMap(element));
|
||||
});
|
||||
map["sleep"].forEach((element) {
|
||||
sleeps.add(Vitals.fromMap(element));
|
||||
});
|
||||
map["heartRate"].forEach((element) {
|
||||
heartRate.add(Vitals.fromMap(element));
|
||||
});
|
||||
map["bloodOxygen"].forEach((element) {
|
||||
bodyOxygen.add(Vitals.fromMap(element));
|
||||
});
|
||||
map["bodyTemperature"].forEach((element) {
|
||||
bodyTemperature.add(Vitals.fromMap(element));
|
||||
});
|
||||
|
||||
return VitalsWRTType(bodyTemperature: bodyTemperature, bodyOxygen: bodyOxygen, heartRate: heartRate, sleep: sleeps, step: steps, activity: activity);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue