upload_sleep.dart
1023 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import 'apple_health_upload_sample.dart';
class HealthSleepUploadData {
const HealthSleepUploadData({
required this.dataType,
required this.fromTime,
required this.toTime,
});
final int dataType;
final int fromTime;
final int toTime;
Map<String, dynamic> toJson() {
return {
'data_type': dataType,
'from_time': fromTime,
'to_time': toTime,
};
}
factory HealthSleepUploadData.fromJson(Map<String, dynamic> json) {
return HealthSleepUploadData(
dataType: healthUploadTimeFromJson(json['data_type']),
fromTime: healthUploadTimeFromJson(json['from_time']),
toTime: healthUploadTimeFromJson(json['to_time']),
);
}
@override
bool operator ==(Object other) {
if (identical(this, other)) return true;
return other is HealthSleepUploadData &&
other.fromTime == fromTime &&
other.toTime == toTime &&
other.dataType == dataType;
}
@override
int get hashCode => Object.hash(dataType, fromTime, toTime);
}