health_kit_raw_data_api.dart
2.64 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
import 'package:pigeon/pigeon.dart';
class HealthKitRawDataPoint {
int dataType;
int startTime;
int endTime;
double? value;
bool? isMotionLike;
HealthKitRawDataPoint({
required this.dataType,
required this.startTime,
required this.endTime,
this.value,
this.isMotionLike,
});
}
class HealthKitRawSleepDataPoint {
int dataType;
List<HealthKitRawDataPoint> sleepDataPoints;
HealthKitRawSleepDataPoint({
required this.dataType,
required this.sleepDataPoints,
});
}
class HealthKitRawWorkoutDataPoint {
int workoutType;
int startTime;
int endTime;
HealthKitRawWorkoutDataPoint({
required this.workoutType,
required this.startTime,
required this.endTime,
});
}
class HealthKitRawMotionDataPoint {
int motionType;
int startTime;
int endTime;
HealthKitRawMotionDataPoint({
required this.motionType,
required this.startTime,
required this.endTime,
});
}
class HealthKitRawActivityDataPoint {
int endTime;
// 千卡
double? activeEnergyBurned;
double? activeEnergyBurnedGoal;
// 公里
double? appleMoveTime;
double? appleMoveTimeGoal;
// 分钟
double? appleExerciseTime;
double? exerciseTimeGoal;
//小时
double? appleStandHours;
double? standHoursGoal;
HealthKitRawActivityDataPoint({
required this.endTime,
this.activeEnergyBurned,
this.activeEnergyBurnedGoal,
this.appleMoveTime,
this.appleMoveTimeGoal,
this.appleExerciseTime,
this.exerciseTimeGoal,
this.appleStandHours,
this.standHoursGoal,
});
}
@ConfigurePigeon(
PigeonOptions(
dartOut: 'lib/pigeon/health_kit_raw_data_api.g.dart',
dartPackageName: 'doublefeel_flutter',
dartOptions: DartOptions(),
swiftOut: 'ios/Runner/Pigeon/HealthKitRawDataApi.swift',
swiftOptions: SwiftOptions(),
copyrightHeader: 'pigeon/copyright.txt',
),
)
@HostApi()
abstract class HealthKitRawDataHostApi {
/// 从AppleHealth 中读取原始数据
@async
List<HealthKitRawDataPoint> getHealthKitRawData(
int dataType, int startTime, int endTime);
/// 从从AppleHealth中读取睡眠数据
@async
List<HealthKitRawSleepDataPoint> getHealthKitRawSleepData(
int startTime, int endTime);
/// 从从AppleHealth中读取活动统计数据
@async
List<HealthKitRawActivityDataPoint> getHealthKitRawActivityData(
int startTime, int endTime);
/// 从从AppleHealth中读取锻炼数据
@async
List<HealthKitRawWorkoutDataPoint> getHealthKitRawWorkoutData(
int startTime, int endTime);
/// 从从AppleHealth中读取锻炼数据
@async
List<HealthKitRawMotionDataPoint> getHealthKitRawMotionData(
int startTime, int endTime);
}