|
...
|
...
|
@@ -15,21 +15,22 @@ PlatformException _createConnectionError(String channelName) { |
|
|
|
message: 'Unable to establish connection on channel: "$channelName".',
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool _deepEquals(Object? a, Object? b) {
|
|
|
|
if (a is List && b is List) {
|
|
|
|
return a.length == b.length &&
|
|
|
|
a.indexed
|
|
|
|
.every(((int, dynamic) item) => _deepEquals(item.$2, b[item.$1]));
|
|
|
|
.every(((int, dynamic) item) => _deepEquals(item.$2, b[item.$1]));
|
|
|
|
}
|
|
|
|
if (a is Map && b is Map) {
|
|
|
|
return a.length == b.length && a.entries.every((MapEntry<Object?, Object?> entry) =>
|
|
|
|
(b as Map<Object?, Object?>).containsKey(entry.key) &&
|
|
|
|
_deepEquals(entry.value, b[entry.key]));
|
|
|
|
return a.length == b.length &&
|
|
|
|
a.entries.every((MapEntry<Object?, Object?> entry) =>
|
|
|
|
(b as Map<Object?, Object?>).containsKey(entry.key) &&
|
|
|
|
_deepEquals(entry.value, b[entry.key]));
|
|
|
|
}
|
|
|
|
return a == b;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class HealthUploadResult {
|
|
|
|
HealthUploadResult({
|
|
|
|
required this.commonUploadSuccess,
|
|
...
|
...
|
@@ -52,7 +53,8 @@ class HealthUploadResult { |
|
|
|
}
|
|
|
|
|
|
|
|
Object encode() {
|
|
|
|
return _toList(); }
|
|
|
|
return _toList();
|
|
|
|
}
|
|
|
|
|
|
|
|
static HealthUploadResult decode(Object result) {
|
|
|
|
result as List<Object?>;
|
|
...
|
...
|
@@ -77,10 +79,158 @@ class HealthUploadResult { |
|
|
|
|
|
|
|
@override
|
|
|
|
// ignore: avoid_equals_and_hash_code_on_mutable_classes
|
|
|
|
int get hashCode => Object.hashAll(_toList())
|
|
|
|
;
|
|
|
|
int get hashCode => Object.hashAll(_toList());
|
|
|
|
}
|
|
|
|
|
|
|
|
class HealthUploadDataPoint {
|
|
|
|
HealthUploadDataPoint({
|
|
|
|
required this.dataType,
|
|
|
|
required this.time,
|
|
|
|
required this.value,
|
|
|
|
});
|
|
|
|
|
|
|
|
int dataType;
|
|
|
|
|
|
|
|
int time;
|
|
|
|
|
|
|
|
double value;
|
|
|
|
|
|
|
|
List<Object?> _toList() {
|
|
|
|
return <Object?>[
|
|
|
|
dataType,
|
|
|
|
time,
|
|
|
|
value,
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
Object encode() {
|
|
|
|
return _toList();
|
|
|
|
}
|
|
|
|
|
|
|
|
static HealthUploadDataPoint decode(Object result) {
|
|
|
|
result as List<Object?>;
|
|
|
|
return HealthUploadDataPoint(
|
|
|
|
dataType: result[0]! as int,
|
|
|
|
time: result[1]! as int,
|
|
|
|
value: result[2]! as double,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
// ignore: avoid_equals_and_hash_code_on_mutable_classes
|
|
|
|
bool operator ==(Object other) {
|
|
|
|
if (other is! HealthUploadDataPoint || other.runtimeType != runtimeType) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if (identical(this, other)) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return _deepEquals(encode(), other.encode());
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
// ignore: avoid_equals_and_hash_code_on_mutable_classes
|
|
|
|
int get hashCode => Object.hashAll(_toList());
|
|
|
|
}
|
|
|
|
|
|
|
|
class HealthSleepUploadDataPoint {
|
|
|
|
HealthSleepUploadDataPoint({
|
|
|
|
required this.dataType,
|
|
|
|
required this.fromTime,
|
|
|
|
required this.toTime,
|
|
|
|
});
|
|
|
|
|
|
|
|
int dataType;
|
|
|
|
|
|
|
|
int fromTime;
|
|
|
|
|
|
|
|
int toTime;
|
|
|
|
|
|
|
|
List<Object?> _toList() {
|
|
|
|
return <Object?>[
|
|
|
|
dataType,
|
|
|
|
fromTime,
|
|
|
|
toTime,
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
Object encode() {
|
|
|
|
return _toList();
|
|
|
|
}
|
|
|
|
|
|
|
|
static HealthSleepUploadDataPoint decode(Object result) {
|
|
|
|
result as List<Object?>;
|
|
|
|
return HealthSleepUploadDataPoint(
|
|
|
|
dataType: result[0]! as int,
|
|
|
|
fromTime: result[1]! as int,
|
|
|
|
toTime: result[2]! as int,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
// ignore: avoid_equals_and_hash_code_on_mutable_classes
|
|
|
|
bool operator ==(Object other) {
|
|
|
|
if (other is! HealthSleepUploadDataPoint ||
|
|
|
|
other.runtimeType != runtimeType) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if (identical(this, other)) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return _deepEquals(encode(), other.encode());
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
// ignore: avoid_equals_and_hash_code_on_mutable_classes
|
|
|
|
int get hashCode => Object.hashAll(_toList());
|
|
|
|
}
|
|
|
|
|
|
|
|
class HealthActivityTargetData {
|
|
|
|
HealthActivityTargetData({
|
|
|
|
this.move,
|
|
|
|
this.stand,
|
|
|
|
});
|
|
|
|
|
|
|
|
int? move;
|
|
|
|
|
|
|
|
int? stand;
|
|
|
|
|
|
|
|
List<Object?> _toList() {
|
|
|
|
return <Object?>[
|
|
|
|
move,
|
|
|
|
stand,
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
Object encode() {
|
|
|
|
return _toList();
|
|
|
|
}
|
|
|
|
|
|
|
|
static HealthActivityTargetData decode(Object result) {
|
|
|
|
result as List<Object?>;
|
|
|
|
return HealthActivityTargetData(
|
|
|
|
move: result[0] as int?,
|
|
|
|
stand: result[1] as int?,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
// ignore: avoid_equals_and_hash_code_on_mutable_classes
|
|
|
|
bool operator ==(Object other) {
|
|
|
|
if (other is! HealthActivityTargetData ||
|
|
|
|
other.runtimeType != runtimeType) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if (identical(this, other)) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return _deepEquals(encode(), other.encode());
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
// ignore: avoid_equals_and_hash_code_on_mutable_classes
|
|
|
|
int get hashCode => Object.hashAll(_toList());
|
|
|
|
}
|
|
|
|
|
|
|
|
class _PigeonCodec extends StandardMessageCodec {
|
|
|
|
const _PigeonCodec();
|
|
...
|
...
|
@@ -89,9 +239,18 @@ class _PigeonCodec extends StandardMessageCodec { |
|
|
|
if (value is int) {
|
|
|
|
buffer.putUint8(4);
|
|
|
|
buffer.putInt64(value);
|
|
|
|
} else if (value is HealthUploadResult) {
|
|
|
|
} else if (value is HealthUploadResult) {
|
|
|
|
buffer.putUint8(129);
|
|
|
|
writeValue(buffer, value.encode());
|
|
|
|
} else if (value is HealthUploadDataPoint) {
|
|
|
|
buffer.putUint8(130);
|
|
|
|
writeValue(buffer, value.encode());
|
|
|
|
} else if (value is HealthSleepUploadDataPoint) {
|
|
|
|
buffer.putUint8(131);
|
|
|
|
writeValue(buffer, value.encode());
|
|
|
|
} else if (value is HealthActivityTargetData) {
|
|
|
|
buffer.putUint8(132);
|
|
|
|
writeValue(buffer, value.encode());
|
|
|
|
} else {
|
|
|
|
super.writeValue(buffer, value);
|
|
|
|
}
|
|
...
|
...
|
@@ -100,8 +259,14 @@ class _PigeonCodec extends StandardMessageCodec { |
|
|
|
@override
|
|
|
|
Object? readValueOfType(int type, ReadBuffer buffer) {
|
|
|
|
switch (type) {
|
|
|
|
case 129:
|
|
|
|
case 129:
|
|
|
|
return HealthUploadResult.decode(readValue(buffer)!);
|
|
|
|
case 130:
|
|
|
|
return HealthUploadDataPoint.decode(readValue(buffer)!);
|
|
|
|
case 131:
|
|
|
|
return HealthSleepUploadDataPoint.decode(readValue(buffer)!);
|
|
|
|
case 132:
|
|
|
|
return HealthActivityTargetData.decode(readValue(buffer)!);
|
|
|
|
default:
|
|
|
|
return super.readValueOfType(type, buffer);
|
|
|
|
}
|
|
...
|
...
|
@@ -112,9 +277,11 @@ class HealthKitHostApi { |
|
|
|
/// Constructor for [HealthKitHostApi]. The [binaryMessenger] named argument is
|
|
|
|
/// available for dependency injection. If it is left null, the default
|
|
|
|
/// BinaryMessenger will be used which routes to the host platform.
|
|
|
|
HealthKitHostApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''})
|
|
|
|
HealthKitHostApi(
|
|
|
|
{BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''})
|
|
|
|
: pigeonVar_binaryMessenger = binaryMessenger,
|
|
|
|
pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
|
|
|
|
pigeonVar_messageChannelSuffix =
|
|
|
|
messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
|
|
|
|
final BinaryMessenger? pigeonVar_binaryMessenger;
|
|
|
|
|
|
|
|
static const MessageCodec<Object?> pigeonChannelCodec = _PigeonCodec();
|
|
...
|
...
|
@@ -122,8 +289,10 @@ class HealthKitHostApi { |
|
|
|
final String pigeonVar_messageChannelSuffix;
|
|
|
|
|
|
|
|
Future<bool> checkHealthAppAuthorization() async {
|
|
|
|
final String pigeonVar_channelName = 'dev.flutter.pigeon.doublefeel_flutter.HealthKitHostApi.checkHealthAppAuthorization$pigeonVar_messageChannelSuffix';
|
|
|
|
final BasicMessageChannel<Object?> pigeonVar_channel = BasicMessageChannel<Object?>(
|
|
|
|
final String pigeonVar_channelName =
|
|
|
|
'dev.flutter.pigeon.doublefeel_flutter.HealthKitHostApi.checkHealthAppAuthorization$pigeonVar_messageChannelSuffix';
|
|
|
|
final BasicMessageChannel<Object?> pigeonVar_channel =
|
|
|
|
BasicMessageChannel<Object?>(
|
|
|
|
pigeonVar_channelName,
|
|
|
|
pigeonChannelCodec,
|
|
|
|
binaryMessenger: pigeonVar_binaryMessenger,
|
|
...
|
...
|
@@ -150,8 +319,10 @@ class HealthKitHostApi { |
|
|
|
}
|
|
|
|
|
|
|
|
Future<String> getHealthServerAuthUrl() async {
|
|
|
|
final String pigeonVar_channelName = 'dev.flutter.pigeon.doublefeel_flutter.HealthKitHostApi.getHealthServerAuthUrl$pigeonVar_messageChannelSuffix';
|
|
|
|
final BasicMessageChannel<Object?> pigeonVar_channel = BasicMessageChannel<Object?>(
|
|
|
|
final String pigeonVar_channelName =
|
|
|
|
'dev.flutter.pigeon.doublefeel_flutter.HealthKitHostApi.getHealthServerAuthUrl$pigeonVar_messageChannelSuffix';
|
|
|
|
final BasicMessageChannel<Object?> pigeonVar_channel =
|
|
|
|
BasicMessageChannel<Object?>(
|
|
|
|
pigeonVar_channelName,
|
|
|
|
pigeonChannelCodec,
|
|
|
|
binaryMessenger: pigeonVar_binaryMessenger,
|
|
...
|
...
|
@@ -179,8 +350,10 @@ class HealthKitHostApi { |
|
|
|
|
|
|
|
/// Opens Huawei Health client authorization UI. Returns whether user granted.
|
|
|
|
Future<bool> requestHealthClientAuthorization() async {
|
|
|
|
final String pigeonVar_channelName = 'dev.flutter.pigeon.doublefeel_flutter.HealthKitHostApi.requestHealthClientAuthorization$pigeonVar_messageChannelSuffix';
|
|
|
|
final BasicMessageChannel<Object?> pigeonVar_channel = BasicMessageChannel<Object?>(
|
|
|
|
final String pigeonVar_channelName =
|
|
|
|
'dev.flutter.pigeon.doublefeel_flutter.HealthKitHostApi.requestHealthClientAuthorization$pigeonVar_messageChannelSuffix';
|
|
|
|
final BasicMessageChannel<Object?> pigeonVar_channel =
|
|
|
|
BasicMessageChannel<Object?>(
|
|
|
|
pigeonVar_channelName,
|
|
|
|
pigeonChannelCodec,
|
|
|
|
binaryMessenger: pigeonVar_binaryMessenger,
|
|
...
|
...
|
@@ -207,8 +380,10 @@ class HealthKitHostApi { |
|
|
|
}
|
|
|
|
|
|
|
|
Future<bool> cancelHealthAppAuthorization() async {
|
|
|
|
final String pigeonVar_channelName = 'dev.flutter.pigeon.doublefeel_flutter.HealthKitHostApi.cancelHealthAppAuthorization$pigeonVar_messageChannelSuffix';
|
|
|
|
final BasicMessageChannel<Object?> pigeonVar_channel = BasicMessageChannel<Object?>(
|
|
|
|
final String pigeonVar_channelName =
|
|
|
|
'dev.flutter.pigeon.doublefeel_flutter.HealthKitHostApi.cancelHealthAppAuthorization$pigeonVar_messageChannelSuffix';
|
|
|
|
final BasicMessageChannel<Object?> pigeonVar_channel =
|
|
|
|
BasicMessageChannel<Object?>(
|
|
|
|
pigeonVar_channelName,
|
|
|
|
pigeonChannelCodec,
|
|
|
|
binaryMessenger: pigeonVar_binaryMessenger,
|
|
...
|
...
|
@@ -236,8 +411,10 @@ class HealthKitHostApi { |
|
|
|
|
|
|
|
/// Runs native health read and server upload pipeline.
|
|
|
|
Future<HealthUploadResult> performHealthUpload() async {
|
|
|
|
final String pigeonVar_channelName = 'dev.flutter.pigeon.doublefeel_flutter.HealthKitHostApi.performHealthUpload$pigeonVar_messageChannelSuffix';
|
|
|
|
final BasicMessageChannel<Object?> pigeonVar_channel = BasicMessageChannel<Object?>(
|
|
|
|
final String pigeonVar_channelName =
|
|
|
|
'dev.flutter.pigeon.doublefeel_flutter.HealthKitHostApi.performHealthUpload$pigeonVar_messageChannelSuffix';
|
|
|
|
final BasicMessageChannel<Object?> pigeonVar_channel =
|
|
|
|
BasicMessageChannel<Object?>(
|
|
|
|
pigeonVar_channelName,
|
|
|
|
pigeonChannelCodec,
|
|
|
|
binaryMessenger: pigeonVar_binaryMessenger,
|
|
...
|
...
|
@@ -262,4 +439,493 @@ class HealthKitHostApi { |
|
|
|
return (pigeonVar_replyList[0] as HealthUploadResult?)!;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<List<HealthUploadDataPoint>> fetchHrvData(
|
|
|
|
int startTime, int endTime) async {
|
|
|
|
final String pigeonVar_channelName =
|
|
|
|
'dev.flutter.pigeon.doublefeel_flutter.HealthKitHostApi.fetchHrvData$pigeonVar_messageChannelSuffix';
|
|
|
|
final BasicMessageChannel<Object?> pigeonVar_channel =
|
|
|
|
BasicMessageChannel<Object?>(
|
|
|
|
pigeonVar_channelName,
|
|
|
|
pigeonChannelCodec,
|
|
|
|
binaryMessenger: pigeonVar_binaryMessenger,
|
|
|
|
);
|
|
|
|
final Future<Object?> pigeonVar_sendFuture =
|
|
|
|
pigeonVar_channel.send(<Object?>[startTime, endTime]);
|
|
|
|
final List<Object?>? pigeonVar_replyList =
|
|
|
|
await pigeonVar_sendFuture as List<Object?>?;
|
|
|
|
if (pigeonVar_replyList == null) {
|
|
|
|
throw _createConnectionError(pigeonVar_channelName);
|
|
|
|
} else if (pigeonVar_replyList.length > 1) {
|
|
|
|
throw PlatformException(
|
|
|
|
code: pigeonVar_replyList[0]! as String,
|
|
|
|
message: pigeonVar_replyList[1] as String?,
|
|
|
|
details: pigeonVar_replyList[2],
|
|
|
|
);
|
|
|
|
} else if (pigeonVar_replyList[0] == null) {
|
|
|
|
throw PlatformException(
|
|
|
|
code: 'null-error',
|
|
|
|
message: 'Host platform returned null value for non-null return value.',
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return (pigeonVar_replyList[0] as List<Object?>?)!
|
|
|
|
.cast<HealthUploadDataPoint>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<List<HealthUploadDataPoint>> fetchHeartRateData(
|
|
|
|
int startTime, int endTime) async {
|
|
|
|
final String pigeonVar_channelName =
|
|
|
|
'dev.flutter.pigeon.doublefeel_flutter.HealthKitHostApi.fetchHeartRateData$pigeonVar_messageChannelSuffix';
|
|
|
|
final BasicMessageChannel<Object?> pigeonVar_channel =
|
|
|
|
BasicMessageChannel<Object?>(
|
|
|
|
pigeonVar_channelName,
|
|
|
|
pigeonChannelCodec,
|
|
|
|
binaryMessenger: pigeonVar_binaryMessenger,
|
|
|
|
);
|
|
|
|
final Future<Object?> pigeonVar_sendFuture =
|
|
|
|
pigeonVar_channel.send(<Object?>[startTime, endTime]);
|
|
|
|
final List<Object?>? pigeonVar_replyList =
|
|
|
|
await pigeonVar_sendFuture as List<Object?>?;
|
|
|
|
if (pigeonVar_replyList == null) {
|
|
|
|
throw _createConnectionError(pigeonVar_channelName);
|
|
|
|
} else if (pigeonVar_replyList.length > 1) {
|
|
|
|
throw PlatformException(
|
|
|
|
code: pigeonVar_replyList[0]! as String,
|
|
|
|
message: pigeonVar_replyList[1] as String?,
|
|
|
|
details: pigeonVar_replyList[2],
|
|
|
|
);
|
|
|
|
} else if (pigeonVar_replyList[0] == null) {
|
|
|
|
throw PlatformException(
|
|
|
|
code: 'null-error',
|
|
|
|
message: 'Host platform returned null value for non-null return value.',
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return (pigeonVar_replyList[0] as List<Object?>?)!
|
|
|
|
.cast<HealthUploadDataPoint>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<List<HealthUploadDataPoint>> fetchWalkingHeartRateData(
|
|
|
|
int startTime, int endTime) async {
|
|
|
|
final String pigeonVar_channelName =
|
|
|
|
'dev.flutter.pigeon.doublefeel_flutter.HealthKitHostApi.fetchWalkingHeartRateData$pigeonVar_messageChannelSuffix';
|
|
|
|
final BasicMessageChannel<Object?> pigeonVar_channel =
|
|
|
|
BasicMessageChannel<Object?>(
|
|
|
|
pigeonVar_channelName,
|
|
|
|
pigeonChannelCodec,
|
|
|
|
binaryMessenger: pigeonVar_binaryMessenger,
|
|
|
|
);
|
|
|
|
final Future<Object?> pigeonVar_sendFuture =
|
|
|
|
pigeonVar_channel.send(<Object?>[startTime, endTime]);
|
|
|
|
final List<Object?>? pigeonVar_replyList =
|
|
|
|
await pigeonVar_sendFuture as List<Object?>?;
|
|
|
|
if (pigeonVar_replyList == null) {
|
|
|
|
throw _createConnectionError(pigeonVar_channelName);
|
|
|
|
} else if (pigeonVar_replyList.length > 1) {
|
|
|
|
throw PlatformException(
|
|
|
|
code: pigeonVar_replyList[0]! as String,
|
|
|
|
message: pigeonVar_replyList[1] as String?,
|
|
|
|
details: pigeonVar_replyList[2],
|
|
|
|
);
|
|
|
|
} else if (pigeonVar_replyList[0] == null) {
|
|
|
|
throw PlatformException(
|
|
|
|
code: 'null-error',
|
|
|
|
message: 'Host platform returned null value for non-null return value.',
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return (pigeonVar_replyList[0] as List<Object?>?)!
|
|
|
|
.cast<HealthUploadDataPoint>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<List<HealthUploadDataPoint>> fetchRestingHeartRateData(
|
|
|
|
int startTime, int endTime) async {
|
|
|
|
final String pigeonVar_channelName =
|
|
|
|
'dev.flutter.pigeon.doublefeel_flutter.HealthKitHostApi.fetchRestingHeartRateData$pigeonVar_messageChannelSuffix';
|
|
|
|
final BasicMessageChannel<Object?> pigeonVar_channel =
|
|
|
|
BasicMessageChannel<Object?>(
|
|
|
|
pigeonVar_channelName,
|
|
|
|
pigeonChannelCodec,
|
|
|
|
binaryMessenger: pigeonVar_binaryMessenger,
|
|
|
|
);
|
|
|
|
final Future<Object?> pigeonVar_sendFuture =
|
|
|
|
pigeonVar_channel.send(<Object?>[startTime, endTime]);
|
|
|
|
final List<Object?>? pigeonVar_replyList =
|
|
|
|
await pigeonVar_sendFuture as List<Object?>?;
|
|
|
|
if (pigeonVar_replyList == null) {
|
|
|
|
throw _createConnectionError(pigeonVar_channelName);
|
|
|
|
} else if (pigeonVar_replyList.length > 1) {
|
|
|
|
throw PlatformException(
|
|
|
|
code: pigeonVar_replyList[0]! as String,
|
|
|
|
message: pigeonVar_replyList[1] as String?,
|
|
|
|
details: pigeonVar_replyList[2],
|
|
|
|
);
|
|
|
|
} else if (pigeonVar_replyList[0] == null) {
|
|
|
|
throw PlatformException(
|
|
|
|
code: 'null-error',
|
|
|
|
message: 'Host platform returned null value for non-null return value.',
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return (pigeonVar_replyList[0] as List<Object?>?)!
|
|
|
|
.cast<HealthUploadDataPoint>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<List<HealthUploadDataPoint>> fetchSleepingHeartRateData(
|
|
|
|
int startTime, int endTime) async {
|
|
|
|
final String pigeonVar_channelName =
|
|
|
|
'dev.flutter.pigeon.doublefeel_flutter.HealthKitHostApi.fetchSleepingHeartRateData$pigeonVar_messageChannelSuffix';
|
|
|
|
final BasicMessageChannel<Object?> pigeonVar_channel =
|
|
|
|
BasicMessageChannel<Object?>(
|
|
|
|
pigeonVar_channelName,
|
|
|
|
pigeonChannelCodec,
|
|
|
|
binaryMessenger: pigeonVar_binaryMessenger,
|
|
|
|
);
|
|
|
|
final Future<Object?> pigeonVar_sendFuture =
|
|
|
|
pigeonVar_channel.send(<Object?>[startTime, endTime]);
|
|
|
|
final List<Object?>? pigeonVar_replyList =
|
|
|
|
await pigeonVar_sendFuture as List<Object?>?;
|
|
|
|
if (pigeonVar_replyList == null) {
|
|
|
|
throw _createConnectionError(pigeonVar_channelName);
|
|
|
|
} else if (pigeonVar_replyList.length > 1) {
|
|
|
|
throw PlatformException(
|
|
|
|
code: pigeonVar_replyList[0]! as String,
|
|
|
|
message: pigeonVar_replyList[1] as String?,
|
|
|
|
details: pigeonVar_replyList[2],
|
|
|
|
);
|
|
|
|
} else if (pigeonVar_replyList[0] == null) {
|
|
|
|
throw PlatformException(
|
|
|
|
code: 'null-error',
|
|
|
|
message: 'Host platform returned null value for non-null return value.',
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return (pigeonVar_replyList[0] as List<Object?>?)!
|
|
|
|
.cast<HealthUploadDataPoint>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<List<HealthUploadDataPoint>> fetchOxygenSaturationData(
|
|
|
|
int startTime, int endTime) async {
|
|
|
|
final String pigeonVar_channelName =
|
|
|
|
'dev.flutter.pigeon.doublefeel_flutter.HealthKitHostApi.fetchOxygenSaturationData$pigeonVar_messageChannelSuffix';
|
|
|
|
final BasicMessageChannel<Object?> pigeonVar_channel =
|
|
|
|
BasicMessageChannel<Object?>(
|
|
|
|
pigeonVar_channelName,
|
|
|
|
pigeonChannelCodec,
|
|
|
|
binaryMessenger: pigeonVar_binaryMessenger,
|
|
|
|
);
|
|
|
|
final Future<Object?> pigeonVar_sendFuture =
|
|
|
|
pigeonVar_channel.send(<Object?>[startTime, endTime]);
|
|
|
|
final List<Object?>? pigeonVar_replyList =
|
|
|
|
await pigeonVar_sendFuture as List<Object?>?;
|
|
|
|
if (pigeonVar_replyList == null) {
|
|
|
|
throw _createConnectionError(pigeonVar_channelName);
|
|
|
|
} else if (pigeonVar_replyList.length > 1) {
|
|
|
|
throw PlatformException(
|
|
|
|
code: pigeonVar_replyList[0]! as String,
|
|
|
|
message: pigeonVar_replyList[1] as String?,
|
|
|
|
details: pigeonVar_replyList[2],
|
|
|
|
);
|
|
|
|
} else if (pigeonVar_replyList[0] == null) {
|
|
|
|
throw PlatformException(
|
|
|
|
code: 'null-error',
|
|
|
|
message: 'Host platform returned null value for non-null return value.',
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return (pigeonVar_replyList[0] as List<Object?>?)!
|
|
|
|
.cast<HealthUploadDataPoint>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<List<HealthUploadDataPoint>> fetchActiveEnergyData(
|
|
|
|
int startTime, int endTime) async {
|
|
|
|
final String pigeonVar_channelName =
|
|
|
|
'dev.flutter.pigeon.doublefeel_flutter.HealthKitHostApi.fetchActiveEnergyData$pigeonVar_messageChannelSuffix';
|
|
|
|
final BasicMessageChannel<Object?> pigeonVar_channel =
|
|
|
|
BasicMessageChannel<Object?>(
|
|
|
|
pigeonVar_channelName,
|
|
|
|
pigeonChannelCodec,
|
|
|
|
binaryMessenger: pigeonVar_binaryMessenger,
|
|
|
|
);
|
|
|
|
final Future<Object?> pigeonVar_sendFuture =
|
|
|
|
pigeonVar_channel.send(<Object?>[startTime, endTime]);
|
|
|
|
final List<Object?>? pigeonVar_replyList =
|
|
|
|
await pigeonVar_sendFuture as List<Object?>?;
|
|
|
|
if (pigeonVar_replyList == null) {
|
|
|
|
throw _createConnectionError(pigeonVar_channelName);
|
|
|
|
} else if (pigeonVar_replyList.length > 1) {
|
|
|
|
throw PlatformException(
|
|
|
|
code: pigeonVar_replyList[0]! as String,
|
|
|
|
message: pigeonVar_replyList[1] as String?,
|
|
|
|
details: pigeonVar_replyList[2],
|
|
|
|
);
|
|
|
|
} else if (pigeonVar_replyList[0] == null) {
|
|
|
|
throw PlatformException(
|
|
|
|
code: 'null-error',
|
|
|
|
message: 'Host platform returned null value for non-null return value.',
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return (pigeonVar_replyList[0] as List<Object?>?)!
|
|
|
|
.cast<HealthUploadDataPoint>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<List<HealthUploadDataPoint>> fetchExerciseData(
|
|
|
|
int startTime, int endTime) async {
|
|
|
|
final String pigeonVar_channelName =
|
|
|
|
'dev.flutter.pigeon.doublefeel_flutter.HealthKitHostApi.fetchExerciseData$pigeonVar_messageChannelSuffix';
|
|
|
|
final BasicMessageChannel<Object?> pigeonVar_channel =
|
|
|
|
BasicMessageChannel<Object?>(
|
|
|
|
pigeonVar_channelName,
|
|
|
|
pigeonChannelCodec,
|
|
|
|
binaryMessenger: pigeonVar_binaryMessenger,
|
|
|
|
);
|
|
|
|
final Future<Object?> pigeonVar_sendFuture =
|
|
|
|
pigeonVar_channel.send(<Object?>[startTime, endTime]);
|
|
|
|
final List<Object?>? pigeonVar_replyList =
|
|
|
|
await pigeonVar_sendFuture as List<Object?>?;
|
|
|
|
if (pigeonVar_replyList == null) {
|
|
|
|
throw _createConnectionError(pigeonVar_channelName);
|
|
|
|
} else if (pigeonVar_replyList.length > 1) {
|
|
|
|
throw PlatformException(
|
|
|
|
code: pigeonVar_replyList[0]! as String,
|
|
|
|
message: pigeonVar_replyList[1] as String?,
|
|
|
|
details: pigeonVar_replyList[2],
|
|
|
|
);
|
|
|
|
} else if (pigeonVar_replyList[0] == null) {
|
|
|
|
throw PlatformException(
|
|
|
|
code: 'null-error',
|
|
|
|
message: 'Host platform returned null value for non-null return value.',
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return (pigeonVar_replyList[0] as List<Object?>?)!
|
|
|
|
.cast<HealthUploadDataPoint>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<List<HealthUploadDataPoint>> fetchStandData(
|
|
|
|
int startTime, int endTime) async {
|
|
|
|
final String pigeonVar_channelName =
|
|
|
|
'dev.flutter.pigeon.doublefeel_flutter.HealthKitHostApi.fetchStandData$pigeonVar_messageChannelSuffix';
|
|
|
|
final BasicMessageChannel<Object?> pigeonVar_channel =
|
|
|
|
BasicMessageChannel<Object?>(
|
|
|
|
pigeonVar_channelName,
|
|
|
|
pigeonChannelCodec,
|
|
|
|
binaryMessenger: pigeonVar_binaryMessenger,
|
|
|
|
);
|
|
|
|
final Future<Object?> pigeonVar_sendFuture =
|
|
|
|
pigeonVar_channel.send(<Object?>[startTime, endTime]);
|
|
|
|
final List<Object?>? pigeonVar_replyList =
|
|
|
|
await pigeonVar_sendFuture as List<Object?>?;
|
|
|
|
if (pigeonVar_replyList == null) {
|
|
|
|
throw _createConnectionError(pigeonVar_channelName);
|
|
|
|
} else if (pigeonVar_replyList.length > 1) {
|
|
|
|
throw PlatformException(
|
|
|
|
code: pigeonVar_replyList[0]! as String,
|
|
|
|
message: pigeonVar_replyList[1] as String?,
|
|
|
|
details: pigeonVar_replyList[2],
|
|
|
|
);
|
|
|
|
} else if (pigeonVar_replyList[0] == null) {
|
|
|
|
throw PlatformException(
|
|
|
|
code: 'null-error',
|
|
|
|
message: 'Host platform returned null value for non-null return value.',
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return (pigeonVar_replyList[0] as List<Object?>?)!
|
|
|
|
.cast<HealthUploadDataPoint>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<List<HealthUploadDataPoint>> fetchStepCountData(
|
|
|
|
int startTime, int endTime) async {
|
|
|
|
final String pigeonVar_channelName =
|
|
|
|
'dev.flutter.pigeon.doublefeel_flutter.HealthKitHostApi.fetchStepCountData$pigeonVar_messageChannelSuffix';
|
|
|
|
final BasicMessageChannel<Object?> pigeonVar_channel =
|
|
|
|
BasicMessageChannel<Object?>(
|
|
|
|
pigeonVar_channelName,
|
|
|
|
pigeonChannelCodec,
|
|
|
|
binaryMessenger: pigeonVar_binaryMessenger,
|
|
|
|
);
|
|
|
|
final Future<Object?> pigeonVar_sendFuture =
|
|
|
|
pigeonVar_channel.send(<Object?>[startTime, endTime]);
|
|
|
|
final List<Object?>? pigeonVar_replyList =
|
|
|
|
await pigeonVar_sendFuture as List<Object?>?;
|
|
|
|
if (pigeonVar_replyList == null) {
|
|
|
|
throw _createConnectionError(pigeonVar_channelName);
|
|
|
|
} else if (pigeonVar_replyList.length > 1) {
|
|
|
|
throw PlatformException(
|
|
|
|
code: pigeonVar_replyList[0]! as String,
|
|
|
|
message: pigeonVar_replyList[1] as String?,
|
|
|
|
details: pigeonVar_replyList[2],
|
|
|
|
);
|
|
|
|
} else if (pigeonVar_replyList[0] == null) {
|
|
|
|
throw PlatformException(
|
|
|
|
code: 'null-error',
|
|
|
|
message: 'Host platform returned null value for non-null return value.',
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return (pigeonVar_replyList[0] as List<Object?>?)!
|
|
|
|
.cast<HealthUploadDataPoint>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<List<HealthSleepUploadDataPoint>> fetchSleepData(
|
|
|
|
int startTime, int endTime) async {
|
|
|
|
final String pigeonVar_channelName =
|
|
|
|
'dev.flutter.pigeon.doublefeel_flutter.HealthKitHostApi.fetchSleepData$pigeonVar_messageChannelSuffix';
|
|
|
|
final BasicMessageChannel<Object?> pigeonVar_channel =
|
|
|
|
BasicMessageChannel<Object?>(
|
|
|
|
pigeonVar_channelName,
|
|
|
|
pigeonChannelCodec,
|
|
|
|
binaryMessenger: pigeonVar_binaryMessenger,
|
|
|
|
);
|
|
|
|
final Future<Object?> pigeonVar_sendFuture =
|
|
|
|
pigeonVar_channel.send(<Object?>[startTime, endTime]);
|
|
|
|
final List<Object?>? pigeonVar_replyList =
|
|
|
|
await pigeonVar_sendFuture as List<Object?>?;
|
|
|
|
if (pigeonVar_replyList == null) {
|
|
|
|
throw _createConnectionError(pigeonVar_channelName);
|
|
|
|
} else if (pigeonVar_replyList.length > 1) {
|
|
|
|
throw PlatformException(
|
|
|
|
code: pigeonVar_replyList[0]! as String,
|
|
|
|
message: pigeonVar_replyList[1] as String?,
|
|
|
|
details: pigeonVar_replyList[2],
|
|
|
|
);
|
|
|
|
} else if (pigeonVar_replyList[0] == null) {
|
|
|
|
throw PlatformException(
|
|
|
|
code: 'null-error',
|
|
|
|
message: 'Host platform returned null value for non-null return value.',
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return (pigeonVar_replyList[0] as List<Object?>?)!
|
|
|
|
.cast<HealthSleepUploadDataPoint>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<List<HealthUploadDataPoint>> fetchSleepingWristTemperatureData(
|
|
|
|
int startTime, int endTime) async {
|
|
|
|
final String pigeonVar_channelName =
|
|
|
|
'dev.flutter.pigeon.doublefeel_flutter.HealthKitHostApi.fetchSleepingWristTemperatureData$pigeonVar_messageChannelSuffix';
|
|
|
|
final BasicMessageChannel<Object?> pigeonVar_channel =
|
|
|
|
BasicMessageChannel<Object?>(
|
|
|
|
pigeonVar_channelName,
|
|
|
|
pigeonChannelCodec,
|
|
|
|
binaryMessenger: pigeonVar_binaryMessenger,
|
|
|
|
);
|
|
|
|
final Future<Object?> pigeonVar_sendFuture =
|
|
|
|
pigeonVar_channel.send(<Object?>[startTime, endTime]);
|
|
|
|
final List<Object?>? pigeonVar_replyList =
|
|
|
|
await pigeonVar_sendFuture as List<Object?>?;
|
|
|
|
if (pigeonVar_replyList == null) {
|
|
|
|
throw _createConnectionError(pigeonVar_channelName);
|
|
|
|
} else if (pigeonVar_replyList.length > 1) {
|
|
|
|
throw PlatformException(
|
|
|
|
code: pigeonVar_replyList[0]! as String,
|
|
|
|
message: pigeonVar_replyList[1] as String?,
|
|
|
|
details: pigeonVar_replyList[2],
|
|
|
|
);
|
|
|
|
} else if (pigeonVar_replyList[0] == null) {
|
|
|
|
throw PlatformException(
|
|
|
|
code: 'null-error',
|
|
|
|
message: 'Host platform returned null value for non-null return value.',
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return (pigeonVar_replyList[0] as List<Object?>?)!
|
|
|
|
.cast<HealthUploadDataPoint>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<List<HealthUploadDataPoint>> fetchRespiratoryRateData(
|
|
|
|
int startTime, int endTime) async {
|
|
|
|
final String pigeonVar_channelName =
|
|
|
|
'dev.flutter.pigeon.doublefeel_flutter.HealthKitHostApi.fetchRespiratoryRateData$pigeonVar_messageChannelSuffix';
|
|
|
|
final BasicMessageChannel<Object?> pigeonVar_channel =
|
|
|
|
BasicMessageChannel<Object?>(
|
|
|
|
pigeonVar_channelName,
|
|
|
|
pigeonChannelCodec,
|
|
|
|
binaryMessenger: pigeonVar_binaryMessenger,
|
|
|
|
);
|
|
|
|
final Future<Object?> pigeonVar_sendFuture =
|
|
|
|
pigeonVar_channel.send(<Object?>[startTime, endTime]);
|
|
|
|
final List<Object?>? pigeonVar_replyList =
|
|
|
|
await pigeonVar_sendFuture as List<Object?>?;
|
|
|
|
if (pigeonVar_replyList == null) {
|
|
|
|
throw _createConnectionError(pigeonVar_channelName);
|
|
|
|
} else if (pigeonVar_replyList.length > 1) {
|
|
|
|
throw PlatformException(
|
|
|
|
code: pigeonVar_replyList[0]! as String,
|
|
|
|
message: pigeonVar_replyList[1] as String?,
|
|
|
|
details: pigeonVar_replyList[2],
|
|
|
|
);
|
|
|
|
} else if (pigeonVar_replyList[0] == null) {
|
|
|
|
throw PlatformException(
|
|
|
|
code: 'null-error',
|
|
|
|
message: 'Host platform returned null value for non-null return value.',
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return (pigeonVar_replyList[0] as List<Object?>?)!
|
|
|
|
.cast<HealthUploadDataPoint>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<List<HealthUploadDataPoint>> fetchIrregularHeartRhythmData(
|
|
|
|
int startTime, int endTime) async {
|
|
|
|
final String pigeonVar_channelName =
|
|
|
|
'dev.flutter.pigeon.doublefeel_flutter.HealthKitHostApi.fetchIrregularHeartRhythmData$pigeonVar_messageChannelSuffix';
|
|
|
|
final BasicMessageChannel<Object?> pigeonVar_channel =
|
|
|
|
BasicMessageChannel<Object?>(
|
|
|
|
pigeonVar_channelName,
|
|
|
|
pigeonChannelCodec,
|
|
|
|
binaryMessenger: pigeonVar_binaryMessenger,
|
|
|
|
);
|
|
|
|
final Future<Object?> pigeonVar_sendFuture =
|
|
|
|
pigeonVar_channel.send(<Object?>[startTime, endTime]);
|
|
|
|
final List<Object?>? pigeonVar_replyList =
|
|
|
|
await pigeonVar_sendFuture as List<Object?>?;
|
|
|
|
if (pigeonVar_replyList == null) {
|
|
|
|
throw _createConnectionError(pigeonVar_channelName);
|
|
|
|
} else if (pigeonVar_replyList.length > 1) {
|
|
|
|
throw PlatformException(
|
|
|
|
code: pigeonVar_replyList[0]! as String,
|
|
|
|
message: pigeonVar_replyList[1] as String?,
|
|
|
|
details: pigeonVar_replyList[2],
|
|
|
|
);
|
|
|
|
} else if (pigeonVar_replyList[0] == null) {
|
|
|
|
throw PlatformException(
|
|
|
|
code: 'null-error',
|
|
|
|
message: 'Host platform returned null value for non-null return value.',
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return (pigeonVar_replyList[0] as List<Object?>?)!
|
|
|
|
.cast<HealthUploadDataPoint>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<HealthActivityTargetData?> fetchActivityTargetData(
|
|
|
|
int startTime, int endTime) async {
|
|
|
|
final String pigeonVar_channelName =
|
|
|
|
'dev.flutter.pigeon.doublefeel_flutter.HealthKitHostApi.fetchActivityTargetData$pigeonVar_messageChannelSuffix';
|
|
|
|
final BasicMessageChannel<Object?> pigeonVar_channel =
|
|
|
|
BasicMessageChannel<Object?>(
|
|
|
|
pigeonVar_channelName,
|
|
|
|
pigeonChannelCodec,
|
|
|
|
binaryMessenger: pigeonVar_binaryMessenger,
|
|
|
|
);
|
|
|
|
final Future<Object?> pigeonVar_sendFuture =
|
|
|
|
pigeonVar_channel.send(<Object?>[startTime, endTime]);
|
|
|
|
final List<Object?>? pigeonVar_replyList =
|
|
|
|
await pigeonVar_sendFuture as List<Object?>?;
|
|
|
|
if (pigeonVar_replyList == null) {
|
|
|
|
throw _createConnectionError(pigeonVar_channelName);
|
|
|
|
} else if (pigeonVar_replyList.length > 1) {
|
|
|
|
throw PlatformException(
|
|
|
|
code: pigeonVar_replyList[0]! as String,
|
|
|
|
message: pigeonVar_replyList[1] as String?,
|
|
|
|
details: pigeonVar_replyList[2],
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return (pigeonVar_replyList[0] as HealthActivityTargetData?);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|