Commit 76128ab286eb3c694e32bd0b3ad28f31fa449b78

Authored by 权海
1 parent 5e3f9e29

feat(ui):flutter获取AppleHealth数据测试成功

... ... @@ -260,30 +260,31 @@ private open class HealthKitApiPigeonCodec : StandardMessageCodec() {
}
}
/** Generated interface from Pigeon that represents a handler of messages from Flutter. */
interface HealthKitHostApi {
fun checkHealthAppAuthorization(): Boolean
fun getHealthServerAuthUrl(): String
fun checkHealthAppAuthorization(callback: (Result<Boolean>) -> Unit)
fun getHealthServerAuthUrl(callback: (Result<String>) -> Unit)
/** Opens Huawei Health client authorization UI. Returns whether user granted. */
fun requestHealthClientAuthorization(): Boolean
fun cancelHealthAppAuthorization(): Boolean
/** Runs native health read and server upload pipeline. */
fun performHealthUpload(): HealthUploadResult
fun fetchHrvData(startTime: Long, endTime: Long): List<HealthUploadDataPoint>
fun fetchHeartRateData(startTime: Long, endTime: Long): List<HealthUploadDataPoint>
fun fetchWalkingHeartRateData(startTime: Long, endTime: Long): List<HealthUploadDataPoint>
fun fetchRestingHeartRateData(startTime: Long, endTime: Long): List<HealthUploadDataPoint>
fun fetchSleepingHeartRateData(startTime: Long, endTime: Long): List<HealthUploadDataPoint>
fun fetchOxygenSaturationData(startTime: Long, endTime: Long): List<HealthUploadDataPoint>
fun fetchActiveEnergyData(startTime: Long, endTime: Long): List<HealthUploadDataPoint>
fun fetchExerciseData(startTime: Long, endTime: Long): List<HealthUploadDataPoint>
fun fetchStandData(startTime: Long, endTime: Long): List<HealthUploadDataPoint>
fun fetchStepCountData(startTime: Long, endTime: Long): List<HealthUploadDataPoint>
fun fetchSleepData(startTime: Long, endTime: Long): List<HealthSleepUploadDataPoint>
fun fetchSleepingWristTemperatureData(startTime: Long, endTime: Long): List<HealthUploadDataPoint>
fun fetchRespiratoryRateData(startTime: Long, endTime: Long): List<HealthUploadDataPoint>
fun fetchIrregularHeartRhythmData(startTime: Long, endTime: Long): List<HealthUploadDataPoint>
fun fetchActivityTargetData(startTime: Long, endTime: Long): HealthActivityTargetData?
fun fetchHrvData(startTime: Long, endTime: Long, callback: (Result<List<HealthUploadDataPoint>>) -> Unit)
fun fetchHeartRateData(startTime: Long, endTime: Long, callback: (Result<List<HealthUploadDataPoint>>) -> Unit)
fun fetchWalkingHeartRateData(startTime: Long, endTime: Long, callback: (Result<List<HealthUploadDataPoint>>) -> Unit)
fun fetchRestingHeartRateData(startTime: Long, endTime: Long, callback: (Result<List<HealthUploadDataPoint>>) -> Unit)
fun fetchSleepingHeartRateData(startTime: Long, endTime: Long, callback: (Result<List<HealthUploadDataPoint>>) -> Unit)
fun fetchOxygenSaturationData(startTime: Long, endTime: Long, callback: (Result<List<HealthUploadDataPoint>>) -> Unit)
fun fetchActiveEnergyData(startTime: Long, endTime: Long, callback: (Result<List<HealthUploadDataPoint>>) -> Unit)
fun fetchExerciseData(startTime: Long, endTime: Long, callback: (Result<List<HealthUploadDataPoint>>) -> Unit)
fun fetchStandData(startTime: Long, endTime: Long, callback: (Result<List<HealthUploadDataPoint>>) -> Unit)
fun fetchStepCountData(startTime: Long, endTime: Long, callback: (Result<List<HealthUploadDataPoint>>) -> Unit)
fun fetchSleepData(startTime: Long, endTime: Long, callback: (Result<List<HealthSleepUploadDataPoint>>) -> Unit)
fun fetchSleepingWristTemperatureData(startTime: Long, endTime: Long, callback: (Result<List<HealthUploadDataPoint>>) -> Unit)
fun fetchRespiratoryRateData(startTime: Long, endTime: Long, callback: (Result<List<HealthUploadDataPoint>>) -> Unit)
fun fetchIrregularHeartRhythmData(startTime: Long, endTime: Long, callback: (Result<List<HealthUploadDataPoint>>) -> Unit)
fun fetchActivityTargetData(startTime: Long, endTime: Long, callback: (Result<HealthActivityTargetData?>) -> Unit)
companion object {
/** The codec used by HealthKitHostApi. */
... ... @@ -298,12 +299,15 @@ interface HealthKitHostApi {
val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.doublefeel_flutter.HealthKitHostApi.checkHealthAppAuthorization$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { _, reply ->
val wrapped: List<Any?> = try {
listOf(api.checkHealthAppAuthorization())
} catch (exception: Throwable) {
HealthKitApiPigeonUtils.wrapError(exception)
api.checkHealthAppAuthorization{ result: Result<Boolean> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(HealthKitApiPigeonUtils.wrapError(error))
} else {
val data = result.getOrNull()
reply.reply(HealthKitApiPigeonUtils.wrapResult(data))
}
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
... ... @@ -313,12 +317,15 @@ interface HealthKitHostApi {
val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.doublefeel_flutter.HealthKitHostApi.getHealthServerAuthUrl$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { _, reply ->
val wrapped: List<Any?> = try {
listOf(api.getHealthServerAuthUrl())
} catch (exception: Throwable) {
HealthKitApiPigeonUtils.wrapError(exception)
api.getHealthServerAuthUrl{ result: Result<String> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(HealthKitApiPigeonUtils.wrapError(error))
} else {
val data = result.getOrNull()
reply.reply(HealthKitApiPigeonUtils.wrapResult(data))
}
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
... ... @@ -376,12 +383,15 @@ interface HealthKitHostApi {
val args = message as List<Any?>
val startTimeArg = args[0] as Long
val endTimeArg = args[1] as Long
val wrapped: List<Any?> = try {
listOf(api.fetchHrvData(startTimeArg, endTimeArg))
} catch (exception: Throwable) {
HealthKitApiPigeonUtils.wrapError(exception)
api.fetchHrvData(startTimeArg, endTimeArg) { result: Result<List<HealthUploadDataPoint>> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(HealthKitApiPigeonUtils.wrapError(error))
} else {
val data = result.getOrNull()
reply.reply(HealthKitApiPigeonUtils.wrapResult(data))
}
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
... ... @@ -394,12 +404,15 @@ interface HealthKitHostApi {
val args = message as List<Any?>
val startTimeArg = args[0] as Long
val endTimeArg = args[1] as Long
val wrapped: List<Any?> = try {
listOf(api.fetchHeartRateData(startTimeArg, endTimeArg))
} catch (exception: Throwable) {
HealthKitApiPigeonUtils.wrapError(exception)
api.fetchHeartRateData(startTimeArg, endTimeArg) { result: Result<List<HealthUploadDataPoint>> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(HealthKitApiPigeonUtils.wrapError(error))
} else {
val data = result.getOrNull()
reply.reply(HealthKitApiPigeonUtils.wrapResult(data))
}
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
... ... @@ -412,12 +425,15 @@ interface HealthKitHostApi {
val args = message as List<Any?>
val startTimeArg = args[0] as Long
val endTimeArg = args[1] as Long
val wrapped: List<Any?> = try {
listOf(api.fetchWalkingHeartRateData(startTimeArg, endTimeArg))
} catch (exception: Throwable) {
HealthKitApiPigeonUtils.wrapError(exception)
api.fetchWalkingHeartRateData(startTimeArg, endTimeArg) { result: Result<List<HealthUploadDataPoint>> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(HealthKitApiPigeonUtils.wrapError(error))
} else {
val data = result.getOrNull()
reply.reply(HealthKitApiPigeonUtils.wrapResult(data))
}
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
... ... @@ -430,12 +446,15 @@ interface HealthKitHostApi {
val args = message as List<Any?>
val startTimeArg = args[0] as Long
val endTimeArg = args[1] as Long
val wrapped: List<Any?> = try {
listOf(api.fetchRestingHeartRateData(startTimeArg, endTimeArg))
} catch (exception: Throwable) {
HealthKitApiPigeonUtils.wrapError(exception)
api.fetchRestingHeartRateData(startTimeArg, endTimeArg) { result: Result<List<HealthUploadDataPoint>> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(HealthKitApiPigeonUtils.wrapError(error))
} else {
val data = result.getOrNull()
reply.reply(HealthKitApiPigeonUtils.wrapResult(data))
}
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
... ... @@ -448,12 +467,15 @@ interface HealthKitHostApi {
val args = message as List<Any?>
val startTimeArg = args[0] as Long
val endTimeArg = args[1] as Long
val wrapped: List<Any?> = try {
listOf(api.fetchSleepingHeartRateData(startTimeArg, endTimeArg))
} catch (exception: Throwable) {
HealthKitApiPigeonUtils.wrapError(exception)
api.fetchSleepingHeartRateData(startTimeArg, endTimeArg) { result: Result<List<HealthUploadDataPoint>> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(HealthKitApiPigeonUtils.wrapError(error))
} else {
val data = result.getOrNull()
reply.reply(HealthKitApiPigeonUtils.wrapResult(data))
}
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
... ... @@ -466,12 +488,15 @@ interface HealthKitHostApi {
val args = message as List<Any?>
val startTimeArg = args[0] as Long
val endTimeArg = args[1] as Long
val wrapped: List<Any?> = try {
listOf(api.fetchOxygenSaturationData(startTimeArg, endTimeArg))
} catch (exception: Throwable) {
HealthKitApiPigeonUtils.wrapError(exception)
api.fetchOxygenSaturationData(startTimeArg, endTimeArg) { result: Result<List<HealthUploadDataPoint>> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(HealthKitApiPigeonUtils.wrapError(error))
} else {
val data = result.getOrNull()
reply.reply(HealthKitApiPigeonUtils.wrapResult(data))
}
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
... ... @@ -484,12 +509,15 @@ interface HealthKitHostApi {
val args = message as List<Any?>
val startTimeArg = args[0] as Long
val endTimeArg = args[1] as Long
val wrapped: List<Any?> = try {
listOf(api.fetchActiveEnergyData(startTimeArg, endTimeArg))
} catch (exception: Throwable) {
HealthKitApiPigeonUtils.wrapError(exception)
api.fetchActiveEnergyData(startTimeArg, endTimeArg) { result: Result<List<HealthUploadDataPoint>> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(HealthKitApiPigeonUtils.wrapError(error))
} else {
val data = result.getOrNull()
reply.reply(HealthKitApiPigeonUtils.wrapResult(data))
}
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
... ... @@ -502,12 +530,15 @@ interface HealthKitHostApi {
val args = message as List<Any?>
val startTimeArg = args[0] as Long
val endTimeArg = args[1] as Long
val wrapped: List<Any?> = try {
listOf(api.fetchExerciseData(startTimeArg, endTimeArg))
} catch (exception: Throwable) {
HealthKitApiPigeonUtils.wrapError(exception)
api.fetchExerciseData(startTimeArg, endTimeArg) { result: Result<List<HealthUploadDataPoint>> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(HealthKitApiPigeonUtils.wrapError(error))
} else {
val data = result.getOrNull()
reply.reply(HealthKitApiPigeonUtils.wrapResult(data))
}
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
... ... @@ -520,12 +551,15 @@ interface HealthKitHostApi {
val args = message as List<Any?>
val startTimeArg = args[0] as Long
val endTimeArg = args[1] as Long
val wrapped: List<Any?> = try {
listOf(api.fetchStandData(startTimeArg, endTimeArg))
} catch (exception: Throwable) {
HealthKitApiPigeonUtils.wrapError(exception)
api.fetchStandData(startTimeArg, endTimeArg) { result: Result<List<HealthUploadDataPoint>> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(HealthKitApiPigeonUtils.wrapError(error))
} else {
val data = result.getOrNull()
reply.reply(HealthKitApiPigeonUtils.wrapResult(data))
}
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
... ... @@ -538,12 +572,15 @@ interface HealthKitHostApi {
val args = message as List<Any?>
val startTimeArg = args[0] as Long
val endTimeArg = args[1] as Long
val wrapped: List<Any?> = try {
listOf(api.fetchStepCountData(startTimeArg, endTimeArg))
} catch (exception: Throwable) {
HealthKitApiPigeonUtils.wrapError(exception)
api.fetchStepCountData(startTimeArg, endTimeArg) { result: Result<List<HealthUploadDataPoint>> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(HealthKitApiPigeonUtils.wrapError(error))
} else {
val data = result.getOrNull()
reply.reply(HealthKitApiPigeonUtils.wrapResult(data))
}
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
... ... @@ -556,12 +593,15 @@ interface HealthKitHostApi {
val args = message as List<Any?>
val startTimeArg = args[0] as Long
val endTimeArg = args[1] as Long
val wrapped: List<Any?> = try {
listOf(api.fetchSleepData(startTimeArg, endTimeArg))
} catch (exception: Throwable) {
HealthKitApiPigeonUtils.wrapError(exception)
api.fetchSleepData(startTimeArg, endTimeArg) { result: Result<List<HealthSleepUploadDataPoint>> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(HealthKitApiPigeonUtils.wrapError(error))
} else {
val data = result.getOrNull()
reply.reply(HealthKitApiPigeonUtils.wrapResult(data))
}
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
... ... @@ -574,12 +614,15 @@ interface HealthKitHostApi {
val args = message as List<Any?>
val startTimeArg = args[0] as Long
val endTimeArg = args[1] as Long
val wrapped: List<Any?> = try {
listOf(api.fetchSleepingWristTemperatureData(startTimeArg, endTimeArg))
} catch (exception: Throwable) {
HealthKitApiPigeonUtils.wrapError(exception)
api.fetchSleepingWristTemperatureData(startTimeArg, endTimeArg) { result: Result<List<HealthUploadDataPoint>> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(HealthKitApiPigeonUtils.wrapError(error))
} else {
val data = result.getOrNull()
reply.reply(HealthKitApiPigeonUtils.wrapResult(data))
}
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
... ... @@ -592,12 +635,15 @@ interface HealthKitHostApi {
val args = message as List<Any?>
val startTimeArg = args[0] as Long
val endTimeArg = args[1] as Long
val wrapped: List<Any?> = try {
listOf(api.fetchRespiratoryRateData(startTimeArg, endTimeArg))
} catch (exception: Throwable) {
HealthKitApiPigeonUtils.wrapError(exception)
api.fetchRespiratoryRateData(startTimeArg, endTimeArg) { result: Result<List<HealthUploadDataPoint>> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(HealthKitApiPigeonUtils.wrapError(error))
} else {
val data = result.getOrNull()
reply.reply(HealthKitApiPigeonUtils.wrapResult(data))
}
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
... ... @@ -610,12 +656,15 @@ interface HealthKitHostApi {
val args = message as List<Any?>
val startTimeArg = args[0] as Long
val endTimeArg = args[1] as Long
val wrapped: List<Any?> = try {
listOf(api.fetchIrregularHeartRhythmData(startTimeArg, endTimeArg))
} catch (exception: Throwable) {
HealthKitApiPigeonUtils.wrapError(exception)
api.fetchIrregularHeartRhythmData(startTimeArg, endTimeArg) { result: Result<List<HealthUploadDataPoint>> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(HealthKitApiPigeonUtils.wrapError(error))
} else {
val data = result.getOrNull()
reply.reply(HealthKitApiPigeonUtils.wrapResult(data))
}
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
... ... @@ -628,12 +677,15 @@ interface HealthKitHostApi {
val args = message as List<Any?>
val startTimeArg = args[0] as Long
val endTimeArg = args[1] as Long
val wrapped: List<Any?> = try {
listOf(api.fetchActivityTargetData(startTimeArg, endTimeArg))
} catch (exception: Throwable) {
HealthKitApiPigeonUtils.wrapError(exception)
api.fetchActivityTargetData(startTimeArg, endTimeArg) { result: Result<HealthActivityTargetData?> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(HealthKitApiPigeonUtils.wrapError(error))
} else {
val data = result.getOrNull()
reply.reply(HealthKitApiPigeonUtils.wrapResult(data))
}
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
... ...
... ... @@ -92,7 +92,7 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/webview_flutter_wkwebview/darwin"
SPEC CHECKSUMS:
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
fluttertoast: 2c67e14dce98bbdb200df9e1acf610d7a6264ea1
image_cropper: c4326ea50132b1e1564499e5d32a84f01fb03537
image_picker_ios: 7fe1ff8e34c1790d6fff70a32484959f563a928a
... ...
... ... @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 54;
objectVersion = 77;
objects = {
/* Begin PBXBuildFile section */
... ...
... ... @@ -53,6 +53,13 @@
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<EnvironmentVariables>
<EnvironmentVariable
key = "DEBUG_LOCAL"
value = "1"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
</LaunchAction>
<ProfileAction
buildConfiguration = "Profile"
... ...
//
// AppleHealthTestView.swift
// Runner
//
// Created by 权海 on 2026/6/15.
//
import SwiftUI
struct AppleHealthTestView: View {
@State private var logs: [String] = []
@State private var isRunning = false
@State private var runningTitle: String?
private let api = HealthKitHostApiImpl()
private let logTimeFormatter: DateFormatter = {
let formatter = DateFormatter()
formatter.dateFormat = "HH:mm:ss.SSS"
return formatter
}()
var body: some View {
NavigationStack {
VStack(spacing: 0) {
logPanel
Divider()
HStack(spacing: 12) {
actionButton(title: "AppleHealth 权限检查", systemImage: "checkmark.shield") {
await runPermissionCheck()
}
actionButton(title: "获取数据接口", systemImage: "waveform.path.ecg") {
await runDataFetch()
}
}
.padding(16)
.background(.regularMaterial)
}
.navigationTitle("Apple Health Test")
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .topBarTrailing) {
Button("清空") {
logs.removeAll()
}
.disabled(isRunning || logs.isEmpty)
}
}
}
}
private var logPanel: some View {
ScrollViewReader { proxy in
ScrollView {
LazyVStack(alignment: .leading, spacing: 8) {
if logs.isEmpty {
ContentUnavailableView(
"暂无日志",
systemImage: "list.bullet.rectangle",
description: Text("点击底部按钮开始测试 HealthKitHostApiImpl。")
)
.frame(maxWidth: .infinity, minHeight: 280)
} else {
ForEach(Array(logs.enumerated()), id: \.offset) { index, line in
Text(line)
.font(.system(.footnote, design: .monospaced))
.foregroundStyle(line.contains("❌") ? .red : .primary)
.textSelection(.enabled)
.frame(maxWidth: .infinity, alignment: .leading)
.id(index)
}
}
}
.padding(16)
}
.background(Color(.systemGroupedBackground))
.onChange(of: logs.count) { _, newValue in
guard newValue > 0 else { return }
withAnimation(.easeOut(duration: 0.2)) {
proxy.scrollTo(newValue - 1, anchor: .bottom)
}
}
}
}
private func actionButton(
title: String,
systemImage: String,
action: @escaping () async -> Void
) -> some View {
Button {
guard !isRunning else { return }
Task {
await runAction(title, action: action)
}
} label: {
Label(isRunning && runningTitle == title ? "执行中..." : title, systemImage: systemImage)
.font(.system(size: 15, weight: .semibold))
.frame(maxWidth: .infinity)
.frame(height: 48)
}
.buttonStyle(.borderedProminent)
.disabled(isRunning)
}
@MainActor
private func runAction(_ title: String, action: @escaping () async -> Void) async {
isRunning = true
runningTitle = title
appendLog("▶️ \(title) 开始")
await action()
appendLog("✅ \(title) 完成")
isRunning = false
runningTitle = nil
}
private func runPermissionCheck() async {
do {
let isAuthorized = try await checkHealthAuthorization()
await appendLog("checkHealthAppAuthorization = \(isAuthorized)")
let authUrl = try await getHealthServerAuthUrl()
await appendLog("getHealthServerAuthUrl = \(authUrl.isEmpty ? "<empty, iOS system managed>" : authUrl)")
if !isAuthorized {
await appendLog("当前未授权,开始 requestHealthClientAuthorization")
let granted = try api.requestHealthClientAuthorization()
await appendLog("requestHealthClientAuthorization = \(granted)")
} else {
await appendLog("当前已授权,跳过 requestHealthClientAuthorization")
}
let cancelResult = try api.cancelHealthAppAuthorization()
await appendLog("cancelHealthAppAuthorization = \(cancelResult) (iOS 不支持应用内撤销)")
} catch {
await appendError("权限检查失败", error)
}
}
private func runDataFetch() async {
let endTime = Int64(Date().timeIntervalSince1970)
let startTime = Int64(Calendar.current.date(byAdding: .day, value: -7, to: Date())?.timeIntervalSince1970 ?? Date().timeIntervalSince1970)
await appendLog("数据范围: \(formatTimestamp(startTime)) -> \(formatTimestamp(endTime))")
do {
let uploadResult = try api.performHealthUpload()
await appendLog(
"performHealthUpload common=\(uploadResult.commonUploadSuccess), sleep=\(uploadResult.sleepUploadSuccess), error=\(uploadResult.errorMessage ?? "nil")"
)
} catch {
await appendError("performHealthUpload 失败", error)
}
await fetchCommon("HRV", startTime, endTime, api.fetchHrvData)
await fetchCommon("心率", startTime, endTime, api.fetchHeartRateData)
await fetchCommon("步行心率", startTime, endTime, api.fetchWalkingHeartRateData)
await fetchCommon("静息心率", startTime, endTime, api.fetchRestingHeartRateData)
await fetchCommon("睡眠心率", startTime, endTime, api.fetchSleepingHeartRateData)
await fetchCommon("血氧", startTime, endTime, api.fetchOxygenSaturationData)
await fetchCommon("活动能量", startTime, endTime, api.fetchActiveEnergyData)
await fetchCommon("锻炼", startTime, endTime, api.fetchExerciseData)
await fetchCommon("站立", startTime, endTime, api.fetchStandData)
await fetchCommon("步数", startTime, endTime, api.fetchStepCountData)
await fetchCommon("睡眠腕温", startTime, endTime, api.fetchSleepingWristTemperatureData)
await fetchCommon("呼吸频率", startTime, endTime, api.fetchRespiratoryRateData)
await fetchCommon("不规则心律", startTime, endTime, api.fetchIrregularHeartRhythmData)
await fetchSleep(startTime: startTime, endTime: endTime)
await fetchActivityTarget(startTime: startTime, endTime: endTime)
}
private func fetchCommon(
_ title: String,
_ startTime: Int64,
_ endTime: Int64,
_ fetch: @escaping (Int64, Int64, @escaping (Result<[HealthUploadDataPoint], Error>) -> Void) -> Void
) async {
do {
let points = try await withCheckedThrowingContinuation { continuation in
fetch(startTime, endTime) { result in
continuation.resume(with: result)
}
}
await appendLog("\(title): \(points.count) 条")
await appendSample(points)
} catch {
await appendError("\(title) 获取失败", error)
}
}
private func fetchSleep(startTime: Int64, endTime: Int64) async {
do {
let points = try await withCheckedThrowingContinuation { continuation in
api.fetchSleepData(startTime: startTime, endTime: endTime) { result in
continuation.resume(with: result)
}
}
await appendLog("睡眠: \(points.count) 条")
for point in points.prefix(3) {
await appendLog(" sample dataType=\(point.dataType), from=\(formatTimestamp(point.fromTime)), to=\(formatTimestamp(point.toTime))")
}
} catch {
await appendError("睡眠获取失败", error)
}
}
private func fetchActivityTarget(startTime: Int64, endTime: Int64) async {
do {
let target = try await withCheckedThrowingContinuation { continuation in
api.fetchActivityTargetData(startTime: startTime, endTime: endTime) { result in
continuation.resume(with: result)
}
}
if let target {
await appendLog("活动目标: move=\(target.move.map(String.init) ?? "nil"), stand=\(target.stand.map(String.init) ?? "nil")")
} else {
await appendLog("活动目标: nil")
}
} catch {
await appendError("活动目标获取失败", error)
}
}
private func checkHealthAuthorization() async throws -> Bool {
try await withCheckedThrowingContinuation { continuation in
api.checkHealthAppAuthorization { result in
continuation.resume(with: result)
}
}
}
private func getHealthServerAuthUrl() async throws -> String {
try await withCheckedThrowingContinuation { continuation in
api.getHealthServerAuthUrl { result in
continuation.resume(with: result)
}
}
}
@MainActor
private func appendLog(_ message: String) {
logs.append("[\(logTimeFormatter.string(from: Date()))] \(message)")
}
@MainActor
private func appendError(_ prefix: String, _ error: Error) {
appendLog("❌ \(prefix): \(error.localizedDescription)")
}
@MainActor
private func appendSample(_ points: [HealthUploadDataPoint]) {
for point in points.prefix(3) {
appendLog(" sample dataType=\(point.dataType), time=\(formatTimestamp(point.time)), value=\(point.value)")
}
}
private func formatTimestamp(_ timestamp: Int64) -> String {
let date = Date(timeIntervalSince1970: TimeInterval(timestamp))
let formatter = DateFormatter()
formatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
return formatter.string(from: date)
}
}
#Preview {
AppleHealthTestView()
}
... ...
... ... @@ -272,8 +272,12 @@ final class HealthDataReader {
func fetchActivityTargetData(startDate: Date, endDate: Date) async throws -> NativeActivityTarget? {
let calendar = Calendar.current
let start = calendar.dateComponents([.era, .year, .month, .day], from: startDate)
let end = calendar.dateComponents([.era, .year, .month, .day], from: endDate)
var start = calendar.dateComponents([.era, .year, .month, .day], from: startDate)
var end = calendar.dateComponents([.era, .year, .month, .day], from: endDate)
start.calendar = calendar
end.calendar = calendar
let predicate = HKQuery.predicate(forActivitySummariesBetweenStart: start, end: end)
return try await withCheckedThrowingContinuation { continuation in
... ...
... ... @@ -291,30 +291,31 @@ class HealthKitApiPigeonCodec: FlutterStandardMessageCodec, @unchecked Sendable
static let shared = HealthKitApiPigeonCodec(readerWriter: HealthKitApiPigeonCodecReaderWriter())
}
/// Generated protocol from Pigeon that represents a handler of messages from Flutter.
protocol HealthKitHostApi {
func checkHealthAppAuthorization() throws -> Bool
func getHealthServerAuthUrl() throws -> String
func checkHealthAppAuthorization(completion: @escaping (Result<Bool, Error>) -> Void)
func getHealthServerAuthUrl(completion: @escaping (Result<String, Error>) -> Void)
/// Opens Huawei Health client authorization UI. Returns whether user granted.
func requestHealthClientAuthorization() throws -> Bool
func cancelHealthAppAuthorization() throws -> Bool
/// Runs native health read and server upload pipeline.
func performHealthUpload() throws -> HealthUploadResult
func fetchHrvData(startTime: Int64, endTime: Int64) throws -> [HealthUploadDataPoint]
func fetchHeartRateData(startTime: Int64, endTime: Int64) throws -> [HealthUploadDataPoint]
func fetchWalkingHeartRateData(startTime: Int64, endTime: Int64) throws -> [HealthUploadDataPoint]
func fetchRestingHeartRateData(startTime: Int64, endTime: Int64) throws -> [HealthUploadDataPoint]
func fetchSleepingHeartRateData(startTime: Int64, endTime: Int64) throws -> [HealthUploadDataPoint]
func fetchOxygenSaturationData(startTime: Int64, endTime: Int64) throws -> [HealthUploadDataPoint]
func fetchActiveEnergyData(startTime: Int64, endTime: Int64) throws -> [HealthUploadDataPoint]
func fetchExerciseData(startTime: Int64, endTime: Int64) throws -> [HealthUploadDataPoint]
func fetchStandData(startTime: Int64, endTime: Int64) throws -> [HealthUploadDataPoint]
func fetchStepCountData(startTime: Int64, endTime: Int64) throws -> [HealthUploadDataPoint]
func fetchSleepData(startTime: Int64, endTime: Int64) throws -> [HealthSleepUploadDataPoint]
func fetchSleepingWristTemperatureData(startTime: Int64, endTime: Int64) throws -> [HealthUploadDataPoint]
func fetchRespiratoryRateData(startTime: Int64, endTime: Int64) throws -> [HealthUploadDataPoint]
func fetchIrregularHeartRhythmData(startTime: Int64, endTime: Int64) throws -> [HealthUploadDataPoint]
func fetchActivityTargetData(startTime: Int64, endTime: Int64) throws -> HealthActivityTargetData?
func fetchHrvData(startTime: Int64, endTime: Int64, completion: @escaping (Result<[HealthUploadDataPoint], Error>) -> Void)
func fetchHeartRateData(startTime: Int64, endTime: Int64, completion: @escaping (Result<[HealthUploadDataPoint], Error>) -> Void)
func fetchWalkingHeartRateData(startTime: Int64, endTime: Int64, completion: @escaping (Result<[HealthUploadDataPoint], Error>) -> Void)
func fetchRestingHeartRateData(startTime: Int64, endTime: Int64, completion: @escaping (Result<[HealthUploadDataPoint], Error>) -> Void)
func fetchSleepingHeartRateData(startTime: Int64, endTime: Int64, completion: @escaping (Result<[HealthUploadDataPoint], Error>) -> Void)
func fetchOxygenSaturationData(startTime: Int64, endTime: Int64, completion: @escaping (Result<[HealthUploadDataPoint], Error>) -> Void)
func fetchActiveEnergyData(startTime: Int64, endTime: Int64, completion: @escaping (Result<[HealthUploadDataPoint], Error>) -> Void)
func fetchExerciseData(startTime: Int64, endTime: Int64, completion: @escaping (Result<[HealthUploadDataPoint], Error>) -> Void)
func fetchStandData(startTime: Int64, endTime: Int64, completion: @escaping (Result<[HealthUploadDataPoint], Error>) -> Void)
func fetchStepCountData(startTime: Int64, endTime: Int64, completion: @escaping (Result<[HealthUploadDataPoint], Error>) -> Void)
func fetchSleepData(startTime: Int64, endTime: Int64, completion: @escaping (Result<[HealthSleepUploadDataPoint], Error>) -> Void)
func fetchSleepingWristTemperatureData(startTime: Int64, endTime: Int64, completion: @escaping (Result<[HealthUploadDataPoint], Error>) -> Void)
func fetchRespiratoryRateData(startTime: Int64, endTime: Int64, completion: @escaping (Result<[HealthUploadDataPoint], Error>) -> Void)
func fetchIrregularHeartRhythmData(startTime: Int64, endTime: Int64, completion: @escaping (Result<[HealthUploadDataPoint], Error>) -> Void)
func fetchActivityTargetData(startTime: Int64, endTime: Int64, completion: @escaping (Result<HealthActivityTargetData?, Error>) -> Void)
}
/// Generated setup class from Pigeon to handle messages through the `binaryMessenger`.
... ... @@ -326,11 +327,13 @@ class HealthKitHostApiSetup {
let checkHealthAppAuthorizationChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.doublefeel_flutter.HealthKitHostApi.checkHealthAppAuthorization\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec)
if let api = api {
checkHealthAppAuthorizationChannel.setMessageHandler { _, reply in
do {
let result = try api.checkHealthAppAuthorization()
reply(wrapResult(result))
} catch {
reply(wrapError(error))
api.checkHealthAppAuthorization { result in
switch result {
case .success(let res):
reply(wrapResult(res))
case .failure(let error):
reply(wrapError(error))
}
}
}
} else {
... ... @@ -339,11 +342,13 @@ class HealthKitHostApiSetup {
let getHealthServerAuthUrlChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.doublefeel_flutter.HealthKitHostApi.getHealthServerAuthUrl\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec)
if let api = api {
getHealthServerAuthUrlChannel.setMessageHandler { _, reply in
do {
let result = try api.getHealthServerAuthUrl()
reply(wrapResult(result))
} catch {
reply(wrapError(error))
api.getHealthServerAuthUrl { result in
switch result {
case .success(let res):
reply(wrapResult(res))
case .failure(let error):
reply(wrapError(error))
}
}
}
} else {
... ... @@ -396,11 +401,13 @@ class HealthKitHostApiSetup {
let args = message as! [Any?]
let startTimeArg = args[0] as! Int64
let endTimeArg = args[1] as! Int64
do {
let result = try api.fetchHrvData(startTime: startTimeArg, endTime: endTimeArg)
reply(wrapResult(result))
} catch {
reply(wrapError(error))
api.fetchHrvData(startTime: startTimeArg, endTime: endTimeArg) { result in
switch result {
case .success(let res):
reply(wrapResult(res))
case .failure(let error):
reply(wrapError(error))
}
}
}
} else {
... ... @@ -412,11 +419,13 @@ class HealthKitHostApiSetup {
let args = message as! [Any?]
let startTimeArg = args[0] as! Int64
let endTimeArg = args[1] as! Int64
do {
let result = try api.fetchHeartRateData(startTime: startTimeArg, endTime: endTimeArg)
reply(wrapResult(result))
} catch {
reply(wrapError(error))
api.fetchHeartRateData(startTime: startTimeArg, endTime: endTimeArg) { result in
switch result {
case .success(let res):
reply(wrapResult(res))
case .failure(let error):
reply(wrapError(error))
}
}
}
} else {
... ... @@ -428,11 +437,13 @@ class HealthKitHostApiSetup {
let args = message as! [Any?]
let startTimeArg = args[0] as! Int64
let endTimeArg = args[1] as! Int64
do {
let result = try api.fetchWalkingHeartRateData(startTime: startTimeArg, endTime: endTimeArg)
reply(wrapResult(result))
} catch {
reply(wrapError(error))
api.fetchWalkingHeartRateData(startTime: startTimeArg, endTime: endTimeArg) { result in
switch result {
case .success(let res):
reply(wrapResult(res))
case .failure(let error):
reply(wrapError(error))
}
}
}
} else {
... ... @@ -444,11 +455,13 @@ class HealthKitHostApiSetup {
let args = message as! [Any?]
let startTimeArg = args[0] as! Int64
let endTimeArg = args[1] as! Int64
do {
let result = try api.fetchRestingHeartRateData(startTime: startTimeArg, endTime: endTimeArg)
reply(wrapResult(result))
} catch {
reply(wrapError(error))
api.fetchRestingHeartRateData(startTime: startTimeArg, endTime: endTimeArg) { result in
switch result {
case .success(let res):
reply(wrapResult(res))
case .failure(let error):
reply(wrapError(error))
}
}
}
} else {
... ... @@ -460,11 +473,13 @@ class HealthKitHostApiSetup {
let args = message as! [Any?]
let startTimeArg = args[0] as! Int64
let endTimeArg = args[1] as! Int64
do {
let result = try api.fetchSleepingHeartRateData(startTime: startTimeArg, endTime: endTimeArg)
reply(wrapResult(result))
} catch {
reply(wrapError(error))
api.fetchSleepingHeartRateData(startTime: startTimeArg, endTime: endTimeArg) { result in
switch result {
case .success(let res):
reply(wrapResult(res))
case .failure(let error):
reply(wrapError(error))
}
}
}
} else {
... ... @@ -476,11 +491,13 @@ class HealthKitHostApiSetup {
let args = message as! [Any?]
let startTimeArg = args[0] as! Int64
let endTimeArg = args[1] as! Int64
do {
let result = try api.fetchOxygenSaturationData(startTime: startTimeArg, endTime: endTimeArg)
reply(wrapResult(result))
} catch {
reply(wrapError(error))
api.fetchOxygenSaturationData(startTime: startTimeArg, endTime: endTimeArg) { result in
switch result {
case .success(let res):
reply(wrapResult(res))
case .failure(let error):
reply(wrapError(error))
}
}
}
} else {
... ... @@ -492,11 +509,13 @@ class HealthKitHostApiSetup {
let args = message as! [Any?]
let startTimeArg = args[0] as! Int64
let endTimeArg = args[1] as! Int64
do {
let result = try api.fetchActiveEnergyData(startTime: startTimeArg, endTime: endTimeArg)
reply(wrapResult(result))
} catch {
reply(wrapError(error))
api.fetchActiveEnergyData(startTime: startTimeArg, endTime: endTimeArg) { result in
switch result {
case .success(let res):
reply(wrapResult(res))
case .failure(let error):
reply(wrapError(error))
}
}
}
} else {
... ... @@ -508,11 +527,13 @@ class HealthKitHostApiSetup {
let args = message as! [Any?]
let startTimeArg = args[0] as! Int64
let endTimeArg = args[1] as! Int64
do {
let result = try api.fetchExerciseData(startTime: startTimeArg, endTime: endTimeArg)
reply(wrapResult(result))
} catch {
reply(wrapError(error))
api.fetchExerciseData(startTime: startTimeArg, endTime: endTimeArg) { result in
switch result {
case .success(let res):
reply(wrapResult(res))
case .failure(let error):
reply(wrapError(error))
}
}
}
} else {
... ... @@ -524,11 +545,13 @@ class HealthKitHostApiSetup {
let args = message as! [Any?]
let startTimeArg = args[0] as! Int64
let endTimeArg = args[1] as! Int64
do {
let result = try api.fetchStandData(startTime: startTimeArg, endTime: endTimeArg)
reply(wrapResult(result))
} catch {
reply(wrapError(error))
api.fetchStandData(startTime: startTimeArg, endTime: endTimeArg) { result in
switch result {
case .success(let res):
reply(wrapResult(res))
case .failure(let error):
reply(wrapError(error))
}
}
}
} else {
... ... @@ -540,11 +563,13 @@ class HealthKitHostApiSetup {
let args = message as! [Any?]
let startTimeArg = args[0] as! Int64
let endTimeArg = args[1] as! Int64
do {
let result = try api.fetchStepCountData(startTime: startTimeArg, endTime: endTimeArg)
reply(wrapResult(result))
} catch {
reply(wrapError(error))
api.fetchStepCountData(startTime: startTimeArg, endTime: endTimeArg) { result in
switch result {
case .success(let res):
reply(wrapResult(res))
case .failure(let error):
reply(wrapError(error))
}
}
}
} else {
... ... @@ -556,11 +581,13 @@ class HealthKitHostApiSetup {
let args = message as! [Any?]
let startTimeArg = args[0] as! Int64
let endTimeArg = args[1] as! Int64
do {
let result = try api.fetchSleepData(startTime: startTimeArg, endTime: endTimeArg)
reply(wrapResult(result))
} catch {
reply(wrapError(error))
api.fetchSleepData(startTime: startTimeArg, endTime: endTimeArg) { result in
switch result {
case .success(let res):
reply(wrapResult(res))
case .failure(let error):
reply(wrapError(error))
}
}
}
} else {
... ... @@ -572,11 +599,13 @@ class HealthKitHostApiSetup {
let args = message as! [Any?]
let startTimeArg = args[0] as! Int64
let endTimeArg = args[1] as! Int64
do {
let result = try api.fetchSleepingWristTemperatureData(startTime: startTimeArg, endTime: endTimeArg)
reply(wrapResult(result))
} catch {
reply(wrapError(error))
api.fetchSleepingWristTemperatureData(startTime: startTimeArg, endTime: endTimeArg) { result in
switch result {
case .success(let res):
reply(wrapResult(res))
case .failure(let error):
reply(wrapError(error))
}
}
}
} else {
... ... @@ -588,11 +617,13 @@ class HealthKitHostApiSetup {
let args = message as! [Any?]
let startTimeArg = args[0] as! Int64
let endTimeArg = args[1] as! Int64
do {
let result = try api.fetchRespiratoryRateData(startTime: startTimeArg, endTime: endTimeArg)
reply(wrapResult(result))
} catch {
reply(wrapError(error))
api.fetchRespiratoryRateData(startTime: startTimeArg, endTime: endTimeArg) { result in
switch result {
case .success(let res):
reply(wrapResult(res))
case .failure(let error):
reply(wrapError(error))
}
}
}
} else {
... ... @@ -604,11 +635,13 @@ class HealthKitHostApiSetup {
let args = message as! [Any?]
let startTimeArg = args[0] as! Int64
let endTimeArg = args[1] as! Int64
do {
let result = try api.fetchIrregularHeartRhythmData(startTime: startTimeArg, endTime: endTimeArg)
reply(wrapResult(result))
} catch {
reply(wrapError(error))
api.fetchIrregularHeartRhythmData(startTime: startTimeArg, endTime: endTimeArg) { result in
switch result {
case .success(let res):
reply(wrapResult(res))
case .failure(let error):
reply(wrapError(error))
}
}
}
} else {
... ... @@ -620,11 +653,13 @@ class HealthKitHostApiSetup {
let args = message as! [Any?]
let startTimeArg = args[0] as! Int64
let endTimeArg = args[1] as! Int64
do {
let result = try api.fetchActivityTargetData(startTime: startTimeArg, endTime: endTimeArg)
reply(wrapResult(result))
} catch {
reply(wrapError(error))
api.fetchActivityTargetData(startTime: startTimeArg, endTime: endTimeArg) { result in
switch result {
case .success(let res):
reply(wrapResult(res))
case .failure(let error):
reply(wrapError(error))
}
}
}
} else {
... ...
... ... @@ -7,15 +7,17 @@ final class HealthKitHostApiImpl: HealthKitHostApi {
self.service = service
}
func checkHealthAppAuthorization() throws -> Bool {
service.isHealthDataAvailable && !runBlocking {
await self.service.shouldRequestAuthorization()
func checkHealthAppAuthorization(completion: @escaping (Result<Bool, Error>) -> Void) {
Task {
let shouldAuth = await service.shouldRequestAuthorization()
let isAuthorized = service.isHealthDataAvailable && !shouldAuth
completion(.success(isAuthorized))
}
}
func getHealthServerAuthUrl() throws -> String {
func getHealthServerAuthUrl(completion: @escaping (Result<String, Error>) -> Void) {
// Apple Health authorization is system-managed, not URL based.
""
completion(.success(""))
}
func requestHealthClientAuthorization() throws -> Bool {
... ... @@ -50,99 +52,113 @@ final class HealthKitHostApiImpl: HealthKitHostApi {
)
}
func fetchHrvData(startTime: Int64, endTime: Int64) throws -> [HealthUploadDataPoint] {
try fetchCommon(startTime: startTime, endTime: endTime, service.fetchHrvData)
func fetchHrvData(startTime: Int64, endTime: Int64, completion: @escaping (Result<[HealthUploadDataPoint], Error>) -> Void) {
fetchCommon(startTime: startTime, endTime: endTime, service.fetchHrvData, completion: completion)
}
func fetchHeartRateData(startTime: Int64, endTime: Int64) throws -> [HealthUploadDataPoint] {
try fetchCommon(startTime: startTime, endTime: endTime, service.fetchHeartRateData)
func fetchHeartRateData(startTime: Int64, endTime: Int64, completion: @escaping (Result<[HealthUploadDataPoint], Error>) -> Void) {
fetchCommon(startTime: startTime, endTime: endTime, service.fetchHeartRateData, completion: completion)
}
func fetchWalkingHeartRateData(startTime: Int64, endTime: Int64) throws -> [HealthUploadDataPoint] {
try fetchCommon(startTime: startTime, endTime: endTime, service.fetchWalkingHeartRateData)
func fetchWalkingHeartRateData(startTime: Int64, endTime: Int64, completion: @escaping (Result<[HealthUploadDataPoint], Error>) -> Void) {
fetchCommon(startTime: startTime, endTime: endTime, service.fetchWalkingHeartRateData, completion: completion)
}
func fetchRestingHeartRateData(startTime: Int64, endTime: Int64) throws -> [HealthUploadDataPoint] {
try fetchCommon(startTime: startTime, endTime: endTime, service.fetchRestingHeartRateData)
func fetchRestingHeartRateData(startTime: Int64, endTime: Int64, completion: @escaping (Result<[HealthUploadDataPoint], Error>) -> Void) {
fetchCommon(startTime: startTime, endTime: endTime, service.fetchRestingHeartRateData, completion: completion)
}
func fetchSleepingHeartRateData(startTime: Int64, endTime: Int64) throws -> [HealthUploadDataPoint] {
try fetchCommon(startTime: startTime, endTime: endTime, service.fetchSleepingHeartRateData)
func fetchSleepingHeartRateData(startTime: Int64, endTime: Int64, completion: @escaping (Result<[HealthUploadDataPoint], Error>) -> Void) {
fetchCommon(startTime: startTime, endTime: endTime, service.fetchSleepingHeartRateData, completion: completion)
}
func fetchOxygenSaturationData(startTime: Int64, endTime: Int64) throws -> [HealthUploadDataPoint] {
try fetchCommon(startTime: startTime, endTime: endTime, service.fetchOxygenSaturationData)
func fetchOxygenSaturationData(startTime: Int64, endTime: Int64, completion: @escaping (Result<[HealthUploadDataPoint], Error>) -> Void) {
fetchCommon(startTime: startTime, endTime: endTime, service.fetchOxygenSaturationData, completion: completion)
}
func fetchActiveEnergyData(startTime: Int64, endTime: Int64) throws -> [HealthUploadDataPoint] {
try fetchCommon(startTime: startTime, endTime: endTime, service.fetchActiveEnergyData)
func fetchActiveEnergyData(startTime: Int64, endTime: Int64, completion: @escaping (Result<[HealthUploadDataPoint], Error>) -> Void) {
fetchCommon(startTime: startTime, endTime: endTime, service.fetchActiveEnergyData, completion: completion)
}
func fetchExerciseData(startTime: Int64, endTime: Int64) throws -> [HealthUploadDataPoint] {
try fetchCommon(startTime: startTime, endTime: endTime, service.fetchExerciseData)
func fetchExerciseData(startTime: Int64, endTime: Int64, completion: @escaping (Result<[HealthUploadDataPoint], Error>) -> Void) {
fetchCommon(startTime: startTime, endTime: endTime, service.fetchExerciseData, completion: completion)
}
func fetchStandData(startTime: Int64, endTime: Int64) throws -> [HealthUploadDataPoint] {
try fetchCommon(startTime: startTime, endTime: endTime, service.fetchStandData)
func fetchStandData(startTime: Int64, endTime: Int64, completion: @escaping (Result<[HealthUploadDataPoint], Error>) -> Void) {
fetchCommon(startTime: startTime, endTime: endTime, service.fetchStandData, completion: completion)
}
func fetchStepCountData(startTime: Int64, endTime: Int64) throws -> [HealthUploadDataPoint] {
try fetchCommon(startTime: startTime, endTime: endTime, service.fetchStepCountData)
func fetchStepCountData(startTime: Int64, endTime: Int64, completion: @escaping (Result<[HealthUploadDataPoint], Error>) -> Void) {
fetchCommon(startTime: startTime, endTime: endTime, service.fetchStepCountData, completion: completion)
}
func fetchSleepData(startTime: Int64, endTime: Int64) throws -> [HealthSleepUploadDataPoint] {
func fetchSleepData(startTime: Int64, endTime: Int64, completion: @escaping (Result<[HealthSleepUploadDataPoint], Error>) -> Void) {
let range = makeDateRange(startTime: startTime, endTime: endTime)
let intervals = try runBlockingThrows {
try await self.service.fetchSleepData(startDate: range.startDate, endDate: range.endDate)
}
return intervals.map { interval in
HealthSleepUploadDataPoint(
dataType: Int64(interval.dataType),
fromTime: Int64(interval.fromTime.rounded()),
toTime: Int64(interval.toTime.rounded())
)
Task {
do {
let intervals = try await service.fetchSleepData(startDate: range.startDate, endDate: range.endDate)
completion(.success(intervals.map { interval in
HealthSleepUploadDataPoint(
dataType: Int64(interval.dataType),
fromTime: Int64(interval.fromTime.rounded()),
toTime: Int64(interval.toTime.rounded())
)
}))
} catch {
completion(.failure(error))
}
}
}
func fetchSleepingWristTemperatureData(startTime: Int64, endTime: Int64) throws -> [HealthUploadDataPoint] {
try fetchCommon(startTime: startTime, endTime: endTime, service.fetchSleepingWristTemperatureData)
func fetchSleepingWristTemperatureData(startTime: Int64, endTime: Int64, completion: @escaping (Result<[HealthUploadDataPoint], Error>) -> Void) {
fetchCommon(startTime: startTime, endTime: endTime, service.fetchSleepingWristTemperatureData, completion: completion)
}
func fetchRespiratoryRateData(startTime: Int64, endTime: Int64) throws -> [HealthUploadDataPoint] {
try fetchCommon(startTime: startTime, endTime: endTime, service.fetchRespiratoryRateData)
func fetchRespiratoryRateData(startTime: Int64, endTime: Int64, completion: @escaping (Result<[HealthUploadDataPoint], Error>) -> Void) {
fetchCommon(startTime: startTime, endTime: endTime, service.fetchRespiratoryRateData, completion: completion)
}
func fetchIrregularHeartRhythmData(startTime: Int64, endTime: Int64) throws -> [HealthUploadDataPoint] {
try fetchCommon(startTime: startTime, endTime: endTime, service.fetchIrregularHeartRhythmData)
func fetchIrregularHeartRhythmData(startTime: Int64, endTime: Int64, completion: @escaping (Result<[HealthUploadDataPoint], Error>) -> Void) {
fetchCommon(startTime: startTime, endTime: endTime, service.fetchIrregularHeartRhythmData, completion: completion)
}
func fetchActivityTargetData(startTime: Int64, endTime: Int64) throws -> HealthActivityTargetData? {
func fetchActivityTargetData(startTime: Int64, endTime: Int64, completion: @escaping (Result<HealthActivityTargetData?, Error>) -> Void) {
let range = makeDateRange(startTime: startTime, endTime: endTime)
let target = try runBlockingThrows {
try await self.service.fetchActivityTargetData(startDate: range.startDate, endDate: range.endDate)
Task {
do {
let target = try await service.fetchActivityTargetData(startDate: range.startDate, endDate: range.endDate)
completion(.success(target.map {
HealthActivityTargetData(
move: $0.move.map(Int64.init),
stand: $0.stand.map(Int64.init)
)
}))
} catch {
completion(.failure(error))
}
}
guard let target else { return nil }
return HealthActivityTargetData(
move: target.move.map(Int64.init),
stand: target.stand.map(Int64.init)
)
}
private func fetchCommon(
startTime: Int64,
endTime: Int64,
_ fetch: @escaping (Date, Date) async throws -> [NativeHealthDataPoint]
) throws -> [HealthUploadDataPoint] {
_ fetch: @escaping (Date, Date) async throws -> [NativeHealthDataPoint],
completion: @escaping (Result<[HealthUploadDataPoint], Error>) -> Void
) {
let range = makeDateRange(startTime: startTime, endTime: endTime)
let points = try runBlockingThrows {
try await fetch(range.startDate, range.endDate)
}
return points.map { point in
HealthUploadDataPoint(
dataType: Int64(point.dataType.rawValue),
time: Int64(point.time.rounded()),
value: point.value
)
Task {
do {
let points = try await fetch(range.startDate, range.endDate)
completion(.success(points.map { point in
HealthUploadDataPoint(
dataType: Int64(point.dataType.rawValue),
time: Int64(point.time.rounded()),
value: point.value
)
}))
} catch {
completion(.failure(error))
}
}
}
... ...
... ... @@ -7,6 +7,7 @@ import 'package:doublefeel_flutter/app/apple_health_upload/models/upload_activit
import 'package:doublefeel_flutter/app/apple_health_upload/models/upload_sleep.dart';
import 'package:doublefeel_flutter/core/util/app_toast.dart';
import 'package:doublefeel_flutter/pigeon/health_kit_api.g.dart';
import 'package:flutter/foundation.dart';
import 'package:get/get.dart';
class AppleHealthUploadTestController extends GetxController {
... ... @@ -28,6 +29,7 @@ class AppleHealthUploadTestController extends GetxController {
_appendLog('开始检测 AppleHealth 权限');
try {
final hasPermission = await _hostApi.checkHealthAppAuthorization();
_printHostApiResult('checkHealthAppAuthorization', hasPermission);
if (hasPermission) {
permissionTitle.value = '权限:已授权';
_appendLog('AppleHealth 权限已授权');
... ... @@ -35,9 +37,11 @@ class AppleHealthUploadTestController extends GetxController {
}
final granted = await _hostApi.requestHealthClientAuthorization();
_printHostApiResult('requestHealthClientAuthorization', granted);
permissionTitle.value = granted ? '权限:已授权' : '权限:未授权';
_appendLog('AppleHealth 授权请求结果:$granted');
} catch (error, stackTrace) {
_printHostApiError('healthAuthorization', error, stackTrace);
permissionTitle.value = '权限:检测失败';
_appendLog('权限检测失败:$error');
_appendLog(stackTrace.toString());
... ... @@ -54,7 +58,7 @@ class AppleHealthUploadTestController extends GetxController {
final endTime = DateTime.now().millisecondsSinceEpoch ~/ 1000;
final startTime = DateTime.now()
.subtract(const Duration(days: 7))
.subtract(const Duration(days: 365 * 2))
.millisecondsSinceEpoch ~/
1000;
_appendLog('同步范围:$startTime -> $endTime');
... ... @@ -163,7 +167,15 @@ class AppleHealthUploadTestController extends GetxController {
required String label,
required Future<List<HealthUploadDataPoint>> Function() fetch,
}) async {
final points = await fetch();
late final List<HealthUploadDataPoint> points;
try {
points = await fetch();
_printHostApiResult(label, points);
} catch (error, stackTrace) {
_printHostApiError(label, error, stackTrace);
rethrow;
}
final models = points
.map((point) => point.toAppleHealthUploadSample())
.whereType<AppleHealthUploadSample>()
... ... @@ -173,7 +185,15 @@ class AppleHealthUploadTestController extends GetxController {
}
Future<void> _fetchSleep(int startTime, int endTime) async {
final points = await _hostApi.fetchSleepData(startTime, endTime);
late final List<HealthSleepUploadDataPoint> points;
try {
points = await _hostApi.fetchSleepData(startTime, endTime);
_printHostApiResult('sleep', points);
} catch (error, stackTrace) {
_printHostApiError('sleep', error, stackTrace);
rethrow;
}
final models =
points.map((item) => item.toHealthSleepUploadData()).toList();
_sleepData.addAll(models);
... ... @@ -181,7 +201,15 @@ class AppleHealthUploadTestController extends GetxController {
}
Future<void> _fetchActivityTarget(int startTime, int endTime) async {
final target = await _hostApi.fetchActivityTargetData(startTime, endTime);
late final HealthActivityTargetData? target;
try {
target = await _hostApi.fetchActivityTargetData(startTime, endTime);
_printHostApiResult('activityTarget', target);
} catch (error, stackTrace) {
_printHostApiError('activityTarget', error, stackTrace);
rethrow;
}
if (target != null) {
_activityTarget = HealthActivityTargetUploadData(
move: target.move,
... ... @@ -202,6 +230,65 @@ class AppleHealthUploadTestController extends GetxController {
}
}
void _printHostApiResult(String label, Object? value) {
debugPrint(
'[AppleHealthUploadTest][_hostApi.$label] result='
'${_stringifyHostApiValue(value)}',
wrapWidth: 1024,
);
}
void _printHostApiError(
String label,
Object error,
StackTrace stackTrace,
) {
debugPrint(
'[AppleHealthUploadTest][_hostApi.$label] error=$error\n$stackTrace',
wrapWidth: 1024,
);
}
String _stringifyHostApiValue(Object? value) {
try {
return jsonEncode(_hostApiValueToJson(value));
} catch (_) {
return value.toString();
}
}
Object? _hostApiValueToJson(Object? value) {
if (value is HealthUploadDataPoint) {
return {
'dataType': value.dataType,
'time': value.time,
'value': value.value,
};
}
if (value is HealthSleepUploadDataPoint) {
return {
'dataType': value.dataType,
'fromTime': value.fromTime,
'toTime': value.toTime,
};
}
if (value is HealthActivityTargetData) {
return {
'move': value.move,
'stand': value.stand,
};
}
if (value is List) {
return value.map(_hostApiValueToJson).toList();
}
if (value is Map) {
return value.map(
(key, item) => MapEntry(key.toString(), _hostApiValueToJson(item)),
);
}
return value;
}
void _appendLog(String message) {
final time = DateTime.now().toIso8601String();
logText.value = '${logText.value}[$time] $message\n';
... ...
... ... @@ -107,7 +107,7 @@ class _BottomButton extends StatelessWidget {
maxLines: 1,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
style: const TextStyle(fontSize: 13),
style: const TextStyle(fontSize: 12),
),
),
);
... ...
... ... @@ -62,7 +62,8 @@ import 'app_localizations_zh.dart';
/// be consistent with the languages listed in the AppLocalizations.supportedLocales
/// property.
abstract class AppLocalizations {
AppLocalizations(String locale) : localeName = intl.Intl.canonicalizedLocale(locale.toString());
AppLocalizations(String locale)
: localeName = intl.Intl.canonicalizedLocale(locale.toString());
final String localeName;
... ... @@ -70,7 +71,8 @@ abstract class AppLocalizations {
return Localizations.of<AppLocalizations>(context, AppLocalizations);
}
static const LocalizationsDelegate<AppLocalizations> delegate = _AppLocalizationsDelegate();
static const LocalizationsDelegate<AppLocalizations> delegate =
_AppLocalizationsDelegate();
/// A list of this localizations delegate along with the default localizations
/// delegates.
... ... @@ -82,7 +84,8 @@ abstract class AppLocalizations {
/// Additional delegates can be added by appending to this list in
/// MaterialApp. This list does not have to be used at all if a custom list
/// of delegates is preferred or required.
static const List<LocalizationsDelegate<dynamic>> localizationsDelegates = <LocalizationsDelegate<dynamic>>[
static const List<LocalizationsDelegate<dynamic>> localizationsDelegates =
<LocalizationsDelegate<dynamic>>[
delegate,
GlobalMaterialLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
... ... @@ -525,7 +528,8 @@ abstract class AppLocalizations {
///
/// In zh, this message translates to:
/// **'你们现在可以查看彼此的 HRV、压力与睡眠变化,并在对方疲惫时及时送上关心。'**
String get youCanNowViewEachOtherSHrvStressLevelsAndSleepPatternsAndReachOutToCheckInWhenTheOtherPersonSeemsTired;
String
get youCanNowViewEachOtherSHrvStressLevelsAndSleepPatternsAndReachOutToCheckInWhenTheOtherPersonSeemsTired;
/// No description provided for @bindPartnerTitle.
///
... ... @@ -1734,7 +1738,8 @@ abstract class AppLocalizations {
String get dailyActions;
}
class _AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations> {
class _AppLocalizationsDelegate
extends LocalizationsDelegate<AppLocalizations> {
const _AppLocalizationsDelegate();
@override
... ... @@ -1743,25 +1748,25 @@ class _AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations>
}
@override
bool isSupported(Locale locale) => <String>['en', 'zh'].contains(locale.languageCode);
bool isSupported(Locale locale) =>
<String>['en', 'zh'].contains(locale.languageCode);
@override
bool shouldReload(_AppLocalizationsDelegate old) => false;
}
AppLocalizations lookupAppLocalizations(Locale locale) {
// Lookup logic when only language code is specified.
switch (locale.languageCode) {
case 'en': return AppLocalizationsEn();
case 'zh': return AppLocalizationsZh();
case 'en':
return AppLocalizationsEn();
case 'zh':
return AppLocalizationsZh();
}
throw FlutterError(
'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely '
'an issue with the localizations generation tool. Please file an issue '
'on GitHub with a reproducible sample app and the gen-l10n configuration '
'that was used.'
);
'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely '
'an issue with the localizations generation tool. Please file an issue '
'on GitHub with a reproducible sample app and the gen-l10n configuration '
'that was used.');
}
... ...
// ignore: unused_import
import 'package:intl/intl.dart' as intl;
import 'app_localizations.dart';
// ignore_for_file: type=lint
... ... @@ -67,10 +69,12 @@ class AppLocalizationsEn extends AppLocalizations {
String get settings => 'Settings';
@override
String get onboardingIntroTitle => 'DoubleFeel is a health companion app built for Apple Watch';
String get onboardingIntroTitle =>
'DoubleFeel is a health companion app built for Apple Watch';
@override
String get onboardingIntroBody => 'We hope to help you\n<em>notice changes in your mind and body, and help the people who love you</em> see when you are <em>tired or need support</em>';
String get onboardingIntroBody =>
'We hope to help you\n<em>notice changes in your mind and body, and help the people who love you</em> see when you are <em>tired or need support</em>';
@override
String get onboardingStateQuestion => 'Which of these often happens to you?';
... ... @@ -82,16 +86,19 @@ class AppLocalizationsEn extends AppLocalizations {
String get onboardingStateTired => 'I get tired easily';
@override
String get onboardingStatePoorRest => 'I wake up but still do not feel rested';
String get onboardingStatePoorRest =>
'I wake up but still do not feel rested';
@override
String get onboardingStateNeedStimulants => 'I rely on cigarettes, alcohol, coffee, or other stimulants to stay alert';
String get onboardingStateNeedStimulants =>
'I rely on cigarettes, alcohol, coffee, or other stimulants to stay alert';
@override
String get onboardingStateNone => 'None of the above';
@override
String get onboardingStressGoalQuestion => 'What do you want to learn by understanding stress?';
String get onboardingStressGoalQuestion =>
'What do you want to learn by understanding stress?';
@override
String get onboardingStressGoalSource => 'Understand where stress comes from';
... ... @@ -100,7 +107,8 @@ class AppLocalizationsEn extends AppLocalizations {
String get onboardingStressGoalReminder => 'Get reminded when stress appears';
@override
String get onboardingStressGoalLovedOnes => 'Let people who care about me know my stress state';
String get onboardingStressGoalLovedOnes =>
'Let people who care about me know my stress state';
@override
String get onboardingStressGoalRelax => 'Understand stress and feel lighter';
... ... @@ -109,7 +117,8 @@ class AppLocalizationsEn extends AppLocalizations {
String get onboardingStressGoalBodyTalk => 'Communicate better with my body';
@override
String get onboardingReliefQuestion => 'Which methods do you think can ease stress?';
String get onboardingReliefQuestion =>
'Which methods do you think can ease stress?';
@override
String get onboardingReliefSleep => 'Regular sleep';
... ... @@ -133,7 +142,8 @@ class AppLocalizationsEn extends AppLocalizations {
String get onboardingKeyDataTitle => 'Did you know?';
@override
String get onboardingKeyDataSubtitle => 'Everyone has a magical and important body metric that can help us:';
String get onboardingKeyDataSubtitle =>
'Everyone has a magical and important body metric that can help us:';
@override
String get onboardingKeyDataStress => 'Monitor stress';
... ... @@ -148,7 +158,8 @@ class AppLocalizationsEn extends AppLocalizations {
String get onboardingKeyDataHabits => 'Build healthy habits';
@override
String get onboardingKeyDataLovedOnes => 'Help important people care about your state in time';
String get onboardingKeyDataLovedOnes =>
'Help important people care about your state in time';
@override
String get onboardingTellMeWhatItIs => 'Tell me what it is!';
... ... @@ -157,16 +168,19 @@ class AppLocalizationsEn extends AppLocalizations {
String get onboardingHrvTitle => 'It is HRV, heart rate variability';
@override
String get onboardingHrvSubtitle => 'It helps us measure overall stress and health';
String get onboardingHrvSubtitle =>
'It helps us measure overall stress and health';
@override
String get onboardingHrvDescription => 'Heart rate variability (HRV) is the tiny variation in time between heartbeats. It reflects autonomic nervous system activity and how the body responds to stress.';
String get onboardingHrvDescription =>
'Heart rate variability (HRV) is the tiny variation in time between heartbeats. It reflects autonomic nervous system activity and how the body responds to stress.';
@override
String get onboardingTellMeMore => 'Tell me more';
@override
String get onboardingResearchTitle => 'Many studies show that HRV changes are closely related to how our body and mind feel';
String get onboardingResearchTitle =>
'Many studies show that HRV changes are closely related to how our body and mind feel';
@override
String get onboardingResearchFatigue => 'Physical fatigue';
... ... @@ -184,25 +198,30 @@ class AppLocalizationsEn extends AppLocalizations {
String get onboardingHealthPermissionTitle => 'Allow health data access';
@override
String get onboardingHealthPermissionBody => 'DoubleFeel needs connected wearable health data to send reminders, count stress moments, and provide suggestions.';
String get onboardingHealthPermissionBody =>
'DoubleFeel needs connected wearable health data to send reminders, count stress moments, and provide suggestions.';
@override
String get onboardingHealthPermissionPrivacy => 'Your health data is stored locally. We do not upload any related data.';
String get onboardingHealthPermissionPrivacy =>
'Your health data is stored locally. We do not upload any related data.';
@override
String get onboardingNotificationTitle => 'Turn on notifications';
@override
String get onboardingNotificationSubtitle => 'Learn about every body change in time';
String get onboardingNotificationSubtitle =>
'Learn about every body change in time';
@override
String get onboardingNotificationBody => 'After Apple Watch data updates, we can remind you in time and help you act to improve your stress state.';
String get onboardingNotificationBody =>
'After Apple Watch data updates, we can remind you in time and help you act to improve your stress state.';
@override
String get onboardingMemberTitle => 'Get an annual membership offer';
@override
String get onboardingMemberBody => 'Start your pressure alert and health companion journey, so love and care are always present.';
String get onboardingMemberBody =>
'Start your pressure alert and health companion journey, so love and care are always present.';
@override
String get onboardingMemberOriginalPrice => 'Original ¥72.00/year';
... ... @@ -217,13 +236,16 @@ class AppLocalizationsEn extends AppLocalizations {
String get onboardingMemberAllOptions => 'View all purchase options';
@override
String get healthCompanionIsNowAvailable => 'Health Companion is now available';
String get healthCompanionIsNowAvailable =>
'Health Companion is now available';
@override
String get youCanNowViewEachOtherSHrvStressLevelsAndSleepPatternsAndReachOutToCheckInWhenTheOtherPersonSeemsTired => 'You can now view each other\'s HRV, stress levels, and sleep patterns, and reach out to check in when the other person seems tired.';
String get youCanNowViewEachOtherSHrvStressLevelsAndSleepPatternsAndReachOutToCheckInWhenTheOtherPersonSeemsTired =>
'You can now view each other\'s HRV, stress levels, and sleep patterns, and reach out to check in when the other person seems tired.';
@override
String get bindPartnerTitle => 'Add a Close Contact\nOne more person to care about your health';
String get bindPartnerTitle =>
'Add a Close Contact\nOne more person to care about your health';
@override
String get bindPartnerMyId => 'My ID';
... ... @@ -262,7 +284,8 @@ class AppLocalizationsEn extends AppLocalizations {
String get onboardingResearchGoodSleep => 'Good Sleep';
@override
String get loginSlogan => 'Start your pressure alert and health companion journey\nso love and care are always present';
String get loginSlogan =>
'Start your pressure alert and health companion journey\nso love and care are always present';
@override
String get loginWithPhone => 'Sign in with Phone';
... ... @@ -312,13 +335,15 @@ class AppLocalizationsEn extends AppLocalizations {
String get phoneLoginCodeHint => 'Enter verification code';
@override
String get phoneLoginAutoRegisterHint => 'Unregistered numbers will be registered automatically';
String get phoneLoginAutoRegisterHint =>
'Unregistered numbers will be registered automatically';
@override
String get phoneLoginLoggingIn => 'Signing in...';
@override
String get loginAgreeToTermsToast => 'Please read and agree to the Terms of Service and Privacy Policy first';
String get loginAgreeToTermsToast =>
'Please read and agree to the Terms of Service and Privacy Policy first';
@override
String get phoneLoginInvalidPhone => 'Invalid phone number';
... ... @@ -330,10 +355,12 @@ class AppLocalizationsEn extends AppLocalizations {
String get phoneLoginInvalidCode => 'Invalid verification code';
@override
String get todayHealthDataAuthTitle => 'Unable to access heart rate health data';
String get todayHealthDataAuthTitle =>
'Unable to access heart rate health data';
@override
String get todayHealthDataAuthDescription => 'DoubleFeel needs permission to access your health data to provide stress reminders, real-time stress statistics, and health suggestions. Otherwise, some app features may not work properly. Your health data is stored locally only and will not be uploaded to any server.';
String get todayHealthDataAuthDescription =>
'DoubleFeel needs permission to access your health data to provide stress reminders, real-time stress statistics, and health suggestions. Otherwise, some app features may not work properly. Your health data is stored locally only and will not be uploaded to any server.';
@override
String get todayHealthDataAuthAction => 'Authorize health data access';
... ... @@ -354,19 +381,24 @@ class AppLocalizationsEn extends AppLocalizations {
String get todayFaqLinkNoData => 'What if the app or watch face has no data?';
@override
String get todayFaqLinkHrvRealtimeUpdate => 'How can HRV data update in real time?';
String get todayFaqLinkHrvRealtimeUpdate =>
'How can HRV data update in real time?';
@override
String get todayFaqLinkWatchNoStatusNotification => 'Why can\'t my watch receive status notifications?';
String get todayFaqLinkWatchNoStatusNotification =>
'Why can\'t my watch receive status notifications?';
@override
String get todayFaqLinkWatchNoStatusAndInteractionNotification => 'Why can\'t my watch receive status and interaction notifications?';
String get todayFaqLinkWatchNoStatusAndInteractionNotification =>
'Why can\'t my watch receive status and interaction notifications?';
@override
String get todayFaqLinkWatchFaceDataDelay => 'Why is watch face data delayed or not updating?';
String get todayFaqLinkWatchFaceDataDelay =>
'Why is watch face data delayed or not updating?';
@override
String get todayFaqLinkWatchFaceBlackScreen => 'Why does the watch face turn black?';
String get todayFaqLinkWatchFaceBlackScreen =>
'Why does the watch face turn black?';
@override
String get todayStressStatusTitle => 'Overall stress status';
... ... @@ -393,136 +425,176 @@ class AppLocalizationsEn extends AppLocalizations {
String get todayStressStatusInsufficientData => 'Insufficient data';
@override
String get todayStressStatusOverloadDescription => 'Your current HRV is much lower than your long-term average, which may indicate fatigue, high stress, or insufficient recovery. Rest is recommended.';
String get todayStressStatusOverloadDescription =>
'Your current HRV is much lower than your long-term average, which may indicate fatigue, high stress, or insufficient recovery. Rest is recommended.';
@override
String get todayStressStatusCautionDescription => 'Your current HRV is below the normal range, and your body may be accumulating stress. Pay attention to rest and recovery.';
String get todayStressStatusCautionDescription =>
'Your current HRV is below the normal range, and your body may be accumulating stress. Pay attention to rest and recovery.';
@override
String get todayStressStatusNormalDescription => 'Your current body state is within your normal fluctuation range.';
String get todayStressStatusNormalDescription =>
'Your current body state is within your normal fluctuation range.';
@override
String get todayStressStatusExcellentDescription => 'Your current HRV is higher than your recent average, indicating better recovery and overall state.';
String get todayStressStatusExcellentDescription =>
'Your current HRV is higher than your recent average, indicating better recovery and overall state.';
@override
String get todayStressStatusInsufficientDataDescription => 'There is not enough available data to accurately assess your stress state yet.';
String get todayStressStatusInsufficientDataDescription =>
'There is not enough available data to accurately assess your stress state yet.';
@override
String get todayHrvMeasurementIntro => 'Apple Watch measures HRV every 2-5 hours by default. If you want to measure it manually right now, follow these steps:';
String get todayHrvMeasurementIntro =>
'Apple Watch measures HRV every 2-5 hours by default. If you want to measure it manually right now, follow these steps:';
@override
String get todayHrvMeasurementStep1 => '1. Wear your Apple Watch snugly, sit down, and stay calm';
String get todayHrvMeasurementStep1 =>
'1. Wear your Apple Watch snugly, sit down, and stay calm';
@override
String get todayHrvMeasurementStep2 => '2. Open Mindfulness on Apple Watch and start Breathe';
String get todayHrvMeasurementStep2 =>
'2. Open Mindfulness on Apple Watch and start Breathe';
@override
String get todayHrvMeasurementStep3 => '3. Keep breathing steadily and wait 1-3 minutes';
String get todayHrvMeasurementStep3 =>
'3. Keep breathing steadily and wait 1-3 minutes';
@override
String get todayHrvMeasurementStep4 => '4. After breathing is complete, lock and unlock your iPhone once';
String get todayHrvMeasurementStep4 =>
'4. After breathing is complete, lock and unlock your iPhone once';
@override
String get todayHrvMeasurementStep5 => '5. Wait about one minute. StressWatch will receive and display your data';
String get todayHrvMeasurementStep5 =>
'5. Wait about one minute. StressWatch will receive and display your data';
@override
String get todayHrvMeasurementHint => 'Tip: Data comes from Apple Watch. After measurement, there may be delays or data may not sync immediately. If this happens, measure again and wait for the data to be read.';
String get todayHrvMeasurementHint =>
'Tip: Data comes from Apple Watch. After measurement, there may be delays or data may not sync immediately. If this happens, measure again and wait for the data to be read.';
@override
String get todayHrvMeasurementWarning => 'Note: Health permissions must be enabled, and Low Power Mode must be turned off.';
String get todayHrvMeasurementWarning =>
'Note: Health permissions must be enabled, and Low Power Mode must be turned off.';
@override
String get todayStressStatusWhatTitle => 'What is overall stress status?';
@override
String get todayStressStatusWhatDescription1 => 'DoubleFeel combines your HRV (heart rate variability), resting heart rate, and body-state changes from the past 30 days to assess your overall stress level.';
String get todayStressStatusWhatDescription1 =>
'DoubleFeel combines your HRV (heart rate variability), resting heart rate, and body-state changes from the past 30 days to assess your overall stress level.';
@override
String get todayStressStatusWhatDescription2 => 'Because HRV fluctuates with emotions, exercise, sleep, and fatigue, a single reading has limited value. We recommend focusing on your overall stress status across the day, which is more stable and useful. It helps you understand your body state and helps close contacts notice changes in time.';
String get todayStressStatusWhatDescription2 =>
'Because HRV fluctuates with emotions, exercise, sleep, and fatigue, a single reading has limited value. We recommend focusing on your overall stress status across the day, which is more stable and useful. It helps you understand your body state and helps close contacts notice changes in time.';
@override
String get todayStressStatusWhyHrvTitle => 'Why use HRV (heart rate variability)?';
String get todayStressStatusWhyHrvTitle =>
'Why use HRV (heart rate variability)?';
@override
String get todayStressStatusWhyHrvDescription => 'HRV is an important metric for measuring body stress and recovery capacity.';
String get todayStressStatusWhyHrvDescription =>
'HRV is an important metric for measuring body stress and recovery capacity.';
@override
String get todayStressStatusUsually => 'In general:';
@override
String get todayStressStatusHrvHigher => '· Higher HRV usually means better recovery';
String get todayStressStatusHrvHigher =>
'· Higher HRV usually means better recovery';
@override
String get todayStressStatusHrvLower => '· Lower HRV may indicate fatigue, stress, or insufficient sleep';
String get todayStressStatusHrvLower =>
'· Lower HRV may indicate fatigue, stress, or insufficient sleep';
@override
String get todayStressStatusHrvChangesFast => '· HRV changes quickly, making it useful for short-term body-state changes.';
String get todayStressStatusHrvChangesFast =>
'· HRV changes quickly, making it useful for short-term body-state changes.';
@override
String get todayStressStatusAppWatchDifferenceTitle => 'How are stress statuses on the phone app and Apple Watch different?';
String get todayStressStatusAppWatchDifferenceTitle =>
'How are stress statuses on the phone app and Apple Watch different?';
@override
String get todayStressStatusAppWatchDifferenceApp => 'The phone app home page shows the day\'s overall stress status, combining HRV, resting heart rate, and overall trends.';
String get todayStressStatusAppWatchDifferenceApp =>
'The phone app home page shows the day\'s overall stress status, combining HRV, resting heart rate, and overall trends.';
@override
String get todayStressStatusAppWatchDifferenceWatch => 'Apple Watch shows the most recent real-time stress status, which is better for quickly checking your current body changes.';
String get todayStressStatusAppWatchDifferenceWatch =>
'Apple Watch shows the most recent real-time stress status, which is better for quickly checking your current body changes.';
@override
String get todayStressStatusWaitingDataTitle => 'Why does Waiting for data appear?';
String get todayStressStatusWaitingDataTitle =>
'Why does Waiting for data appear?';
@override
String get todayStressStatusWaitingDataDescription1 => 'Waiting for data means the current amount of collected data is not enough to generate a reliable stress assessment.';
String get todayStressStatusWaitingDataDescription1 =>
'Waiting for data means the current amount of collected data is not enough to generate a reliable stress assessment.';
@override
String get todayStressStatusWaitingDataDescription2 => 'Please keep wearing your Apple Watch and wait for the system to collect data automatically.';
String get todayStressStatusWaitingDataDescription2 =>
'Please keep wearing your Apple Watch and wait for the system to collect data automatically.';
@override
String get todayStressStatusWaitingDataReasonsIntro => 'Possible reasons include:';
String get todayStressStatusWaitingDataReasonsIntro =>
'Possible reasons include:';
@override
String get todayStressStatusWaitingDataReason1 => '1. Not enough HRV samples';
@override
String get todayStressStatusWaitingDataReason2 => '2. Missing resting heart rate data';
String get todayStressStatusWaitingDataReason2 =>
'2. Missing resting heart rate data';
@override
String get todayStressStatusWaitingDataReason3 => '3. Apple Watch has not been worn long enough';
String get todayStressStatusWaitingDataReason3 =>
'3. Apple Watch has not been worn long enough';
@override
String get todayStressStatusWaitingDataReason4 => '4. Apple Health permissions are not enabled';
String get todayStressStatusWaitingDataReason4 =>
'4. Apple Health permissions are not enabled';
@override
String get todayHrvPrincipleHowMeasureTitle => 'How does DoubleFeel measure stress status?';
String get todayHrvPrincipleHowMeasureTitle =>
'How does DoubleFeel measure stress status?';
@override
String get todayHrvPrincipleHowMeasureDescription1 => 'When you wear Apple Watch normally, the system automatically collects your heart rate data and syncs it to Apple Health.';
String get todayHrvPrincipleHowMeasureDescription1 =>
'When you wear Apple Watch normally, the system automatically collects your heart rate data and syncs it to Apple Health.';
@override
String get todayHrvPrincipleHowMeasureDescription2 => 'DoubleFeel calculates HRV (heart rate variability) indicators based on this data to assess your body stress and recovery state.';
String get todayHrvPrincipleHowMeasureDescription2 =>
'DoubleFeel calculates HRV (heart rate variability) indicators based on this data to assess your body stress and recovery state.';
@override
String get todayHrvPrincipleHowMeasureDescription3 => 'HRV is sensitive to stress, fatigue, sleep, emotions, and recovery, so it helps us notice body-state changes earlier.';
String get todayHrvPrincipleHowMeasureDescription3 =>
'HRV is sensitive to stress, fatigue, sleep, emotions, and recovery, so it helps us notice body-state changes earlier.';
@override
String get todayHrvPrincipleHowMeasureDescription4 => 'To make results more accurate, DoubleFeel compares your current HRV state with your own 30-day average instead of comparing it directly with other people.';
String get todayHrvPrincipleHowMeasureDescription4 =>
'To make results more accurate, DoubleFeel compares your current HRV state with your own 30-day average instead of comparing it directly with other people.';
@override
String get todayRealtimeStressWhatTitle => 'What is real-time stress?';
@override
String get todayRealtimeStressWhatDescription1 => 'Real-time stress is a body stress indicator dynamically generated by DoubleFeel based on your current HRV, heart rate state, and changes in your personal history.';
String get todayRealtimeStressWhatDescription1 =>
'Real-time stress is a body stress indicator dynamically generated by DoubleFeel based on your current HRV, heart rate state, and changes in your personal history.';
@override
String get todayRealtimeStressWhatDescription2 => 'A higher stress value means your body state is deviating more from your usual baseline and may reflect fatigue, insufficient recovery, or high stress.';
String get todayRealtimeStressWhatDescription2 =>
'A higher stress value means your body state is deviating more from your usual baseline and may reflect fatigue, insufficient recovery, or high stress.';
@override
String get todayRealtimeStressWhatDescription3 => 'It helps you notice body changes faster and adjust rest, exercise, and daily rhythm in time.';
String get todayRealtimeStressWhatDescription3 =>
'It helps you notice body changes faster and adjust rest, exercise, and daily rhythm in time.';
@override
String get todayRealtimeStressDivisionTitle => 'How is real-time stress divided?';
String get todayRealtimeStressDivisionTitle =>
'How is real-time stress divided?';
@override
String get todayRealtimeStressDivisionIntro => 'Real-time stress is shown as a percentage:';
String get todayRealtimeStressDivisionIntro =>
'Real-time stress is shown as a percentage:';
@override
String get todayRealtimeStressExcellentRange => 'Excellent: 1%-20%';
... ... @@ -537,79 +609,103 @@ class AppLocalizationsEn extends AppLocalizations {
String get todayRealtimeStressOverloadRange => 'Stress overload: 81%-100%';
@override
String get todayRealtimeStressExcellentDescription => 'Your recovery state is good and you are generally relaxed.';
String get todayRealtimeStressExcellentDescription =>
'Your recovery state is good and you are generally relaxed.';
@override
String get todayRealtimeStressNormalDescription => 'Your body is within the normal fluctuation range.';
String get todayRealtimeStressNormalDescription =>
'Your body is within the normal fluctuation range.';
@override
String get todayRealtimeStressCautionDescription => 'Your body may be accumulating stress and needs proper rest and recovery.';
String get todayRealtimeStressCautionDescription =>
'Your body may be accumulating stress and needs proper rest and recovery.';
@override
String get todayRealtimeStressOverloadDescription => 'Your body stress is clearly high. Reduce load and pay attention to sleep and recovery.';
String get todayRealtimeStressOverloadDescription =>
'Your body stress is clearly high. Reduce load and pay attention to sleep and recovery.';
@override
String get todayRealtimeStressDivisionBaseline => 'These ranges are adjusted dynamically based on your personal baseline and should not be directly compared between users.';
String get todayRealtimeStressDivisionBaseline =>
'These ranges are adjusted dynamically based on your personal baseline and should not be directly compared between users.';
@override
String get todayRealtimeStressDivisionAwake => 'Real-time stress mainly reflects body stress changes while awake.';
String get todayRealtimeStressDivisionAwake =>
'Real-time stress mainly reflects body stress changes while awake.';
@override
String get todayRealtimeStressLowBetterTitle => 'Is lower real-time stress always better?';
String get todayRealtimeStressLowBetterTitle =>
'Is lower real-time stress always better?';
@override
String get todayRealtimeStressLowBetterNo => 'Not necessarily.';
@override
String get todayRealtimeStressLowBetterType => 'Body stress can be normal or abnormal.';
String get todayRealtimeStressLowBetterType =>
'Body stress can be normal or abnormal.';
@override
String get todayRealtimeStressLowBetterExample => 'For example, real-time stress rising briefly during or after exercise is a normal recovery response. It can also rise temporarily during focused work or emotional excitement, which are normal body adjustments.';
String get todayRealtimeStressLowBetterExample =>
'For example, real-time stress rising briefly during or after exercise is a normal recovery response. It can also rise temporarily during focused work or emotional excitement, which are normal body adjustments.';
@override
String get todayRealtimeStressLowBetterHighStress => 'But if stress remains high while resting, sitting for a long time, or after poor sleep, it may indicate physical fatigue, mental stress, insufficient sleep recovery, incomplete exercise recovery, too much caffeine, alcohol, stimulants, or possible discomfort.';
String get todayRealtimeStressLowBetterHighStress =>
'But if stress remains high while resting, sitting for a long time, or after poor sleep, it may indicate physical fatigue, mental stress, insufficient sleep recovery, incomplete exercise recovery, too much caffeine, alcohol, stimulants, or possible discomfort.';
@override
String get todayRealtimeStressLowBetterTrend => 'DoubleFeel focuses more on your long-term trend than on a single fluctuation.';
String get todayRealtimeStressLowBetterTrend =>
'DoubleFeel focuses more on your long-term trend than on a single fluctuation.';
@override
String get todayRealtimeStressScenarioTitle => 'When should HRV and real-time stress be used?';
String get todayRealtimeStressScenarioTitle =>
'When should HRV and real-time stress be used?';
@override
String get todayRealtimeStressScenarioHrvDefault => 'With Apple Watch default settings, HRV updates every 2-5 hours.';
String get todayRealtimeStressScenarioHrvDefault =>
'With Apple Watch default settings, HRV updates every 2-5 hours.';
@override
String get todayRealtimeStressScenarioRegionLimit => 'In some regions, Apple Watch breathing features may be limited, which can affect HRV update frequency. Turning on breathing features may also consume more battery.';
String get todayRealtimeStressScenarioRegionLimit =>
'In some regions, Apple Watch breathing features may be limited, which can affect HRV update frequency. Turning on breathing features may also consume more battery.';
@override
String get todayRealtimeStressScenarioIntro => 'To address the long interval between HRV updates, DoubleFeel designed real-time stress:';
String get todayRealtimeStressScenarioIntro =>
'To address the long interval between HRV updates, DoubleFeel designed real-time stress:';
@override
String get todayRealtimeStressScenarioUpdateEvery6Min => '· Real-time stress updates every 6 minutes';
String get todayRealtimeStressScenarioUpdateEvery6Min =>
'· Real-time stress updates every 6 minutes';
@override
String get todayRealtimeStressScenarioTimely => '· It can reflect body-state changes more promptly';
String get todayRealtimeStressScenarioTimely =>
'· It can reflect body-state changes more promptly';
@override
String get todayRealtimeStressScenarioConsistentTrend => '· In most cases, the real-time stress trend is consistent with the HRV trend';
String get todayRealtimeStressScenarioConsistentTrend =>
'· In most cases, the real-time stress trend is consistent with the HRV trend';
@override
String get todayRealtimeStressScenarioSummary => 'This lets users see long-term HRV trends while also using real-time stress as a short-term body-state reference.';
String get todayRealtimeStressScenarioSummary =>
'This lets users see long-term HRV trends while also using real-time stress as a short-term body-state reference.';
@override
String get todayFaqNoDataTitle => 'What if the app or watch face has no data?';
String get todayFaqNoDataTitle =>
'What if the app or watch face has no data?';
@override
String get todayFaqNoDataDescription1 => '1. Confirm that Apple Watch is on watchOS 10.0 or above and iPhone is on iOS 14 or above. You can check system versions in About.';
String get todayFaqNoDataDescription1 =>
'1. Confirm that Apple Watch is on watchOS 10.0 or above and iPhone is on iOS 14 or above. You can check system versions in About.';
@override
String get todayFaqNoDataDescription2 => '2. Confirm all permissions are enabled: iPhone Health > Sharing > Apps > DoubleFeel > Turn On All Permissions.';
String get todayFaqNoDataDescription2 =>
'2. Confirm all permissions are enabled: iPhone Health > Sharing > Apps > DoubleFeel > Turn On All Permissions.';
@override
String get todayFaqNoDataDescription3 => '3. Confirm the device is not in Low Power Mode, low battery, or worn too loosely, as these can affect data collection.';
String get todayFaqNoDataDescription3 =>
'3. Confirm the device is not in Low Power Mode, low battery, or worn too loosely, as these can affect data collection.';
@override
String get todayFaqContactPrefix => 'If everything above is correct, you can ';
String get todayFaqContactPrefix =>
'If everything above is correct, you can ';
@override
String get todayFaqContactAction => 'contact us';
... ... @@ -618,70 +714,90 @@ class AppLocalizationsEn extends AppLocalizations {
String get todayFaqContactSuffix => '.';
@override
String get todayFaqWatchNoNotificationTitle => 'Watch cannot receive status notifications?';
String get todayFaqWatchNoNotificationTitle =>
'Watch cannot receive status notifications?';
@override
String get todayFaqWatchNoNotificationDescription1 => 'Apple Watch and iPhone notifications have priority rules: when your iPhone is unlocked and the screen is on, notifications only appear on the phone and will not appear on the watch.';
String get todayFaqWatchNoNotificationDescription1 =>
'Apple Watch and iPhone notifications have priority rules: when your iPhone is unlocked and the screen is on, notifications only appear on the phone and will not appear on the watch.';
@override
String get todayFaqWatchNoNotificationDescription2 => 'If stress data displays and updates normally but your watch does not receive notifications, try the following:';
String get todayFaqWatchNoNotificationDescription2 =>
'If stress data displays and updates normally but your watch does not receive notifications, try the following:';
@override
String get todayFaqWatchNoNotificationCheckPhoneNotification => '1. Check whether iPhone notifications are enabled (Settings > DoubleFeel > Notifications).';
String get todayFaqWatchNoNotificationCheckPhoneNotification =>
'1. Check whether iPhone notifications are enabled (Settings > DoubleFeel > Notifications).';
@override
String get todayFaqWatchNoNotificationCheckPhoneBackgroundRefresh => '2. Check whether iPhone Background App Refresh is enabled (Settings > DoubleFeel > Background App Refresh).';
String get todayFaqWatchNoNotificationCheckPhoneBackgroundRefresh =>
'2. Check whether iPhone Background App Refresh is enabled (Settings > DoubleFeel > Background App Refresh).';
@override
String get todayFaqWatchNoNotificationCheckWatchBackgroundRefresh => '3. Check whether Apple Watch Background App Refresh is enabled (Settings > General > Background App Refresh, and make sure DoubleFeel is enabled).';
String get todayFaqWatchNoNotificationCheckWatchBackgroundRefresh =>
'3. Check whether Apple Watch Background App Refresh is enabled (Settings > General > Background App Refresh, and make sure DoubleFeel is enabled).';
@override
String get todayFaqWatchNoNotificationCheckModes => '4. Make sure Low Power, Focus, Do Not Disturb, Theater, Sleep, and similar modes are off.';
String get todayFaqWatchNoNotificationCheckModes =>
'4. Make sure Low Power, Focus, Do Not Disturb, Theater, Sleep, and similar modes are off.';
@override
String get todayFaqWatchNoNotificationReinstall => '5. Reinstall DoubleFeel and restart Apple Watch and iPhone.';
String get todayFaqWatchNoNotificationReinstall =>
'5. Reinstall DoubleFeel and restart Apple Watch and iPhone.';
@override
String get todayFaqWatchFaceDelayTitle => 'Watch face data not updating or delayed?';
String get todayFaqWatchFaceDelayTitle =>
'Watch face data not updating or delayed?';
@override
String get todayFaqWatchFaceDelayDescription1 => 'Due to Apple system limits, all watch faces, third-party or official, may have delays from a few minutes to half an hour. Developers cannot control the refresh frequency.';
String get todayFaqWatchFaceDelayDescription1 =>
'Due to Apple system limits, all watch faces, third-party or official, may have delays from a few minutes to half an hour. Developers cannot control the refresh frequency.';
@override
String get todayFaqWatchFaceDelayIfOverOneHour => 'If the phone data refreshes but the watch face still has not updated after more than 1 hour:';
String get todayFaqWatchFaceDelayIfOverOneHour =>
'If the phone data refreshes but the watch face still has not updated after more than 1 hour:';
@override
String get todayFaqWatchFaceDelayOpenWatchApp => 'Manually open DoubleFeel on Apple Watch and wait about 1 minute.';
String get todayFaqWatchFaceDelayOpenWatchApp =>
'Manually open DoubleFeel on Apple Watch and wait about 1 minute.';
@override
String get todayFaqWatchFaceDelayIfStill => 'If it still does not update:';
@override
String get todayFaqWatchFaceDelayRestartApp => 'Close the DoubleFeel background process and restart it.';
String get todayFaqWatchFaceDelayRestartApp =>
'Close the DoubleFeel background process and restart it.';
@override
String get todayFaqWatchFaceDelayCheckIntro => 'If it still does not work, check:';
String get todayFaqWatchFaceDelayCheckIntro =>
'If it still does not work, check:';
@override
String get todayFaqWatchFaceDelayCheckData => '· Whether both phone and watch apps can show HRV data normally.';
String get todayFaqWatchFaceDelayCheckData =>
'· Whether both phone and watch apps can show HRV data normally.';
@override
String get todayFaqWatchFaceDelayCheckPhoneHealth => '· Make sure all permissions are enabled on iPhone: iOS Settings > Privacy & Security > Health > DoubleFeel.';
String get todayFaqWatchFaceDelayCheckPhoneHealth =>
'· Make sure all permissions are enabled on iPhone: iOS Settings > Privacy & Security > Health > DoubleFeel.';
@override
String get todayFaqWatchFaceDelayCheckWatchHealth => '· Make sure all permissions are enabled on Apple Watch: Settings > Health > Data Sources & Access > DoubleFeel.';
String get todayFaqWatchFaceDelayCheckWatchHealth =>
'· Make sure all permissions are enabled on Apple Watch: Settings > Health > Data Sources & Access > DoubleFeel.';
@override
String get todayFaqWatchFaceDelayCheckBackgroundRefresh => '· Confirm DoubleFeel is enabled in Apple Watch > Settings > General > Background App Refresh.';
String get todayFaqWatchFaceDelayCheckBackgroundRefresh =>
'· Confirm DoubleFeel is enabled in Apple Watch > Settings > General > Background App Refresh.';
@override
String get todayFaqWatchFaceDelayRestartWatch => '· If it still does not refresh automatically, restart Apple Watch. Long runtimes or high background usage may cause watch face updates to pause.';
String get todayFaqWatchFaceDelayRestartWatch =>
'· If it still does not refresh automatically, restart Apple Watch. Long runtimes or high background usage may cause watch face updates to pause.';
@override
String get todayFaqWatchFaceBlackScreenTitle => 'Watch face turns black?';
@override
String get todayFaqWatchFaceBlackScreenDescription => 'If the custom interactive watch face turns black after being added and only shows time and date, long-press the watch face, tap Edit, swipe left to Complications, choose DoubleFeel, and add each component again as needed.';
String get todayFaqWatchFaceBlackScreenDescription =>
'If the custom interactive watch face turns black after being added and only shows time and date, long-press the watch face, tap Edit, swipe left to Complications, choose DoubleFeel, and add each component again as needed.';
@override
String get today => 'Today';
... ... @@ -699,16 +815,19 @@ class AppLocalizationsEn extends AppLocalizations {
String get allPlans => 'All Plans';
@override
String get clickToAddTheHrvThemedWatchFace => 'Click to add the HRV-themed watch face';
String get clickToAddTheHrvThemedWatchFace =>
'Click to add the HRV-themed watch face';
@override
String get stayOnTopOfYourHealthFluctuations => 'Stay on top of your health fluctuations';
String get stayOnTopOfYourHealthFluctuations =>
'Stay on top of your health fluctuations';
@override
String get addACloseContact => 'Add a close contact';
@override
String get oneMorePersonLookingOutForYourHealth => 'One more person looking out for your health';
String get oneMorePersonLookingOutForYourHealth =>
'One more person looking out for your health';
@override
String get addAFriend => 'Add a friend';
... ... @@ -765,7 +884,8 @@ class AppLocalizationsEn extends AppLocalizations {
String get questionsAndFeedback => 'Questions and Feedback';
@override
String get ifYouWouldLikeUsToReplyPleaseProvideYourEmailAddress => 'If you would like us to reply, please provide your email address';
String get ifYouWouldLikeUsToReplyPleaseProvideYourEmailAddress =>
'If you would like us to reply, please provide your email address';
@override
String get uploadProof => 'Upload Proof';
... ... @@ -774,7 +894,8 @@ class AppLocalizationsEn extends AppLocalizations {
String get frequentlyAskedQuestions => 'Frequently Asked Questions';
@override
String get areYouSureYouWantToDeleteYourAccount => 'Are you sure you want to delete your account?';
String get areYouSureYouWantToDeleteYourAccount =>
'Are you sure you want to delete your account?';
@override
String get accountSettings => 'Account Settings';
... ...
// ignore: unused_import
import 'package:intl/intl.dart' as intl;
import 'app_localizations.dart';
// ignore_for_file: type=lint
... ... @@ -70,7 +72,8 @@ class AppLocalizationsZh extends AppLocalizations {
String get onboardingIntroTitle => 'DoubleFeel 是专为 Apple Watch 打造的健康陪伴app';
@override
String get onboardingIntroBody => '我们希望可以帮助你\n<em>关注自己的身心变化,也让爱你的人</em>及时发现你的<em>疲惫与需要</em>';
String get onboardingIntroBody =>
'我们希望可以帮助你\n<em>关注自己的身心变化,也让爱你的人</em>及时发现你的<em>疲惫与需要</em>';
@override
String get onboardingStateQuestion => '请问以下哪些描述,经常发生在你身上?';
... ... @@ -160,7 +163,8 @@ class AppLocalizationsZh extends AppLocalizations {
String get onboardingHrvSubtitle => '它能帮助我们衡量整体的压力和健康状态';
@override
String get onboardingHrvDescription => '心率变异性(HRV, Heart Rate Variability)即心跳之间间隔时间的微小变化,反映了自主神经系统活动和身体对压力的反应能力';
String get onboardingHrvDescription =>
'心率变异性(HRV, Heart Rate Variability)即心跳之间间隔时间的微小变化,反映了自主神经系统活动和身体对压力的反应能力';
@override
String get onboardingTellMeMore => '展开说说';
... ... @@ -184,10 +188,12 @@ class AppLocalizationsZh extends AppLocalizations {
String get onboardingHealthPermissionTitle => '允许访问健康数据';
@override
String get onboardingHealthPermissionBody => 'DoubleFeel需要连接健康穿戴设备数据,以提醒、统计压力时刻、提供建议。';
String get onboardingHealthPermissionBody =>
'DoubleFeel需要连接健康穿戴设备数据,以提醒、统计压力时刻、提供建议。';
@override
String get onboardingHealthPermissionPrivacy => '请放心,你的健康数据只会存储在本地,我们不上传任何相关数据。';
String get onboardingHealthPermissionPrivacy =>
'请放心,你的健康数据只会存储在本地,我们不上传任何相关数据。';
@override
String get onboardingNotificationTitle => '开启通知';
... ... @@ -196,7 +202,8 @@ class AppLocalizationsZh extends AppLocalizations {
String get onboardingNotificationSubtitle => '及时了解身体每一次异动';
@override
String get onboardingNotificationBody => 'AppleWatch数据更新后会及时提醒你,帮助你及时行动,改善压力状态';
String get onboardingNotificationBody =>
'AppleWatch数据更新后会及时提醒你,帮助你及时行动,改善压力状态';
@override
String get onboardingMemberTitle => '获得年度会员优惠';
... ... @@ -220,7 +227,9 @@ class AppLocalizationsZh extends AppLocalizations {
String get healthCompanionIsNowAvailable => '健康陪伴已开启';
@override
String get youCanNowViewEachOtherSHrvStressLevelsAndSleepPatternsAndReachOutToCheckInWhenTheOtherPersonSeemsTired => '你们现在可以查看彼此的 HRV、压力与睡眠变化,并在对方疲惫时及时送上关心。';
String
get youCanNowViewEachOtherSHrvStressLevelsAndSleepPatternsAndReachOutToCheckInWhenTheOtherPersonSeemsTired =>
'你们现在可以查看彼此的 HRV、压力与睡眠变化,并在对方疲惫时及时送上关心。';
@override
String get bindPartnerTitle => '添加亲密联系人\n多一个人关注你的健康';
... ... @@ -333,7 +342,8 @@ class AppLocalizationsZh extends AppLocalizations {
String get todayHealthDataAuthTitle => '无法获取心率健康数据';
@override
String get todayHealthDataAuthDescription => 'DoubleFeel 需要授权访问你的健康数据,才能提供压力提醒、实时压力统计和健康建议;否则应用功能可能无法正常使用。请放心,你的健康数据仅存储在本地,不会上传到任何服务器。';
String get todayHealthDataAuthDescription =>
'DoubleFeel 需要授权访问你的健康数据,才能提供压力提醒、实时压力统计和健康建议;否则应用功能可能无法正常使用。请放心,你的健康数据仅存储在本地,不会上传到任何服务器。';
@override
String get todayHealthDataAuthAction => '授权访问健康数据';
... ... @@ -360,7 +370,8 @@ class AppLocalizationsZh extends AppLocalizations {
String get todayFaqLinkWatchNoStatusNotification => '手表为什么无法收到状态通知?';
@override
String get todayFaqLinkWatchNoStatusAndInteractionNotification => '手表为什么无法收到状态和互动通知?';
String get todayFaqLinkWatchNoStatusAndInteractionNotification =>
'手表为什么无法收到状态和互动通知?';
@override
String get todayFaqLinkWatchFaceDataDelay => '手表表盘数据不更新或者有延迟?';
... ... @@ -393,22 +404,27 @@ class AppLocalizationsZh extends AppLocalizations {
String get todayStressStatusInsufficientData => '数据不足';
@override
String get todayStressStatusOverloadDescription => '当前 HRV 明显低于你的长期平均水平,可能意味着身体疲劳、压力过高或恢复不足。建议及时休息。';
String get todayStressStatusOverloadDescription =>
'当前 HRV 明显低于你的长期平均水平,可能意味着身体疲劳、压力过高或恢复不足。建议及时休息。';
@override
String get todayStressStatusCautionDescription => '当前 HRV 低于正常范围,身体可能正在积累压力,需要注意作息与恢复。';
String get todayStressStatusCautionDescription =>
'当前 HRV 低于正常范围,身体可能正在积累压力,需要注意作息与恢复。';
@override
String get todayStressStatusNormalDescription => '当前身体状态处于你的正常波动范围内。';
@override
String get todayStressStatusExcellentDescription => '当前 HRV 高于近期平均水平,代表身体恢复与整体状态较好。';
String get todayStressStatusExcellentDescription =>
'当前 HRV 高于近期平均水平,代表身体恢复与整体状态较好。';
@override
String get todayStressStatusInsufficientDataDescription => '当前可用数据不足,暂时无法准确判断压力状态。';
String get todayStressStatusInsufficientDataDescription =>
'当前可用数据不足,暂时无法准确判断压力状态。';
@override
String get todayHrvMeasurementIntro => 'AppleWatch默认每2-5小时测量一次HRV,如果你希望立即手动进行测量,可以参考以下方法:';
String get todayHrvMeasurementIntro =>
'AppleWatch默认每2-5小时测量一次HRV,如果你希望立即手动进行测量,可以参考以下方法:';
@override
String get todayHrvMeasurementStep1 => '1、戴紧AppleWatch,坐下来,保持心境平和';
... ... @@ -426,7 +442,8 @@ class AppLocalizationsZh extends AppLocalizations {
String get todayHrvMeasurementStep5 => '5、等待一分钟左右,StressWatch会收到你的数据并展示';
@override
String get todayHrvMeasurementHint => '提示:数据源来自AppleWatch,在测量之后可能存在延迟或是数据未能同步的情况。如若出现上述情况,请重新测量并等待数据读取。';
String get todayHrvMeasurementHint =>
'提示:数据源来自AppleWatch,在测量之后可能存在延迟或是数据未能同步的情况。如若出现上述情况,请重新测量并等待数据读取。';
@override
String get todayHrvMeasurementWarning => '注意:需打开健康里的权限,同时关闭省电模式。';
... ... @@ -435,10 +452,12 @@ class AppLocalizationsZh extends AppLocalizations {
String get todayStressStatusWhatTitle => '什么是综合压力状态?';
@override
String get todayStressStatusWhatDescription1 => 'DoubleFeel 会结合你过去 30 天的 HRV(心率变异性)、静息心率以及当天的身体状态变化,综合评估你的整体压力水平。';
String get todayStressStatusWhatDescription1 =>
'DoubleFeel 会结合你过去 30 天的 HRV(心率变异性)、静息心率以及当天的身体状态变化,综合评估你的整体压力水平。';
@override
String get todayStressStatusWhatDescription2 => '由于 HRV 会随着情绪、运动、睡眠和疲劳不断波动,单次数据参考意义有限,因此我们更建议关注一整天的综合压力状态,让结果更稳定、更有参考价值。综合压力不仅能帮助你了解自己的身体状态,也能让亲密联系人更及时地关注你的变化。';
String get todayStressStatusWhatDescription2 =>
'由于 HRV 会随着情绪、运动、睡眠和疲劳不断波动,单次数据参考意义有限,因此我们更建议关注一整天的综合压力状态,让结果更稳定、更有参考价值。综合压力不仅能帮助你了解自己的身体状态,也能让亲密联系人更及时地关注你的变化。';
@override
String get todayStressStatusWhyHrvTitle => '为什么要参考 HRV(心率变异性)?';
... ... @@ -459,22 +478,27 @@ class AppLocalizationsZh extends AppLocalizations {
String get todayStressStatusHrvChangesFast => '· HRV 变化较快,更适合观察短时间内的身体状态变化。';
@override
String get todayStressStatusAppWatchDifferenceTitle => '手机 App 与 Apple Watch 显示的压力状态有什么区别?';
String get todayStressStatusAppWatchDifferenceTitle =>
'手机 App 与 Apple Watch 显示的压力状态有什么区别?';
@override
String get todayStressStatusAppWatchDifferenceApp => '手机 App 首页显示的是当天的综合压力状态,会综合分析 HRV、静息心率与整体趋势。';
String get todayStressStatusAppWatchDifferenceApp =>
'手机 App 首页显示的是当天的综合压力状态,会综合分析 HRV、静息心率与整体趋势。';
@override
String get todayStressStatusAppWatchDifferenceWatch => 'Apple Watch 显示的是最近一次的实时压力状态,更适合快速查看当前身体变化。';
String get todayStressStatusAppWatchDifferenceWatch =>
'Apple Watch 显示的是最近一次的实时压力状态,更适合快速查看当前身体变化。';
@override
String get todayStressStatusWaitingDataTitle => '为什么会出现“等待数据”?';
@override
String get todayStressStatusWaitingDataDescription1 => '“等待数据”代表当前采集到的数据量不足,暂时无法生成可靠的压力评估。';
String get todayStressStatusWaitingDataDescription1 =>
'“等待数据”代表当前采集到的数据量不足,暂时无法生成可靠的压力评估。';
@override
String get todayStressStatusWaitingDataDescription2 => '请继续佩戴 Apple Watch,等待系统自动采集数据。';
String get todayStressStatusWaitingDataDescription2 =>
'请继续佩戴 Apple Watch,等待系统自动采集数据。';
@override
String get todayStressStatusWaitingDataReasonsIntro => '可能原因包括:';
... ... @@ -495,28 +519,35 @@ class AppLocalizationsZh extends AppLocalizations {
String get todayHrvPrincipleHowMeasureTitle => 'DoubleFeel 如何测量压力状态?';
@override
String get todayHrvPrincipleHowMeasureDescription1 => '当你正常佩戴 Apple Watch 时,系统会自动采集你的心率数据,并同步至 Apple Health。';
String get todayHrvPrincipleHowMeasureDescription1 =>
'当你正常佩戴 Apple Watch 时,系统会自动采集你的心率数据,并同步至 Apple Health。';
@override
String get todayHrvPrincipleHowMeasureDescription2 => 'DoubleFeel 会基于这些数据计算 HRV(心率变异性)相关指标,用于评估你的身体压力与恢复状态。';
String get todayHrvPrincipleHowMeasureDescription2 =>
'DoubleFeel 会基于这些数据计算 HRV(心率变异性)相关指标,用于评估你的身体压力与恢复状态。';
@override
String get todayHrvPrincipleHowMeasureDescription3 => 'HRV 对压力、疲劳、睡眠、情绪与身体恢复都非常敏感,因此它能够帮助我们更早发现身体状态变化。';
String get todayHrvPrincipleHowMeasureDescription3 =>
'HRV 对压力、疲劳、睡眠、情绪与身体恢复都非常敏感,因此它能够帮助我们更早发现身体状态变化。';
@override
String get todayHrvPrincipleHowMeasureDescription4 => '为了让结果更准确,DoubleFeel 会将你当前的 HRV 状态与过去 30 天的个人平均水平进行对比,而不是直接与其他人比较。';
String get todayHrvPrincipleHowMeasureDescription4 =>
'为了让结果更准确,DoubleFeel 会将你当前的 HRV 状态与过去 30 天的个人平均水平进行对比,而不是直接与其他人比较。';
@override
String get todayRealtimeStressWhatTitle => '什么是实时压力?';
@override
String get todayRealtimeStressWhatDescription1 => '实时压力是 DoubleFeel 根据你当前的 HRV、心率状态与个人历史数据变化,动态生成的身体压力指标。';
String get todayRealtimeStressWhatDescription1 =>
'实时压力是 DoubleFeel 根据你当前的 HRV、心率状态与个人历史数据变化,动态生成的身体压力指标。';
@override
String get todayRealtimeStressWhatDescription2 => '压力值越高,代表你的身体状态相比平时偏离越明显,可能正处于疲劳、恢复不足或高压力状态。';
String get todayRealtimeStressWhatDescription2 =>
'压力值越高,代表你的身体状态相比平时偏离越明显,可能正处于疲劳、恢复不足或高压力状态。';
@override
String get todayRealtimeStressWhatDescription3 => '它能够帮助你更快发现身体变化,并及时调整休息、运动与生活节奏。';
String get todayRealtimeStressWhatDescription3 =>
'它能够帮助你更快发现身体变化,并及时调整休息、运动与生活节奏。';
@override
String get todayRealtimeStressDivisionTitle => '实时压力如何划分?';
... ... @@ -546,10 +577,12 @@ class AppLocalizationsZh extends AppLocalizations {
String get todayRealtimeStressCautionDescription => '身体可能正在积累压力,需要适当休息与恢复。';
@override
String get todayRealtimeStressOverloadDescription => '身体压力明显偏高,建议减少负荷、注意睡眠与恢复。';
String get todayRealtimeStressOverloadDescription =>
'身体压力明显偏高,建议减少负荷、注意睡眠与恢复。';
@override
String get todayRealtimeStressDivisionBaseline => '以上区间会结合你的个人基线动态调整,不同用户之间并不直接比较。';
String get todayRealtimeStressDivisionBaseline =>
'以上区间会结合你的个人基线动态调整,不同用户之间并不直接比较。';
@override
String get todayRealtimeStressDivisionAwake => '此外,实时压力主要反映清醒状态下的身体压力变化。';
... ... @@ -564,25 +597,31 @@ class AppLocalizationsZh extends AppLocalizations {
String get todayRealtimeStressLowBetterType => '身体压力分为“正常压力”与“异常压力”。';
@override
String get todayRealtimeStressLowBetterExample => '例如:运动期间或运动后,实时压力短时间升高属于正常恢复反应;工作专注、情绪兴奋时,压力也可能暂时升高,这些都属于正常的身体调节。';
String get todayRealtimeStressLowBetterExample =>
'例如:运动期间或运动后,实时压力短时间升高属于正常恢复反应;工作专注、情绪兴奋时,压力也可能暂时升高,这些都属于正常的身体调节。';
@override
String get todayRealtimeStressLowBetterHighStress => '但如果在静息、久坐或睡眠不足的情况下,压力长期偏高,则可能意味着身体疲劳、心理压力较大、睡眠恢复不足、运动恢复不充分、摄入过多咖啡因、酒精或刺激物、身体可能处于不适状态。';
String get todayRealtimeStressLowBetterHighStress =>
'但如果在静息、久坐或睡眠不足的情况下,压力长期偏高,则可能意味着身体疲劳、心理压力较大、睡眠恢复不足、运动恢复不充分、摄入过多咖啡因、酒精或刺激物、身体可能处于不适状态。';
@override
String get todayRealtimeStressLowBetterTrend => 'DoubleFeel 更关注的是你的长期变化趋势,而不是单次波动。';
String get todayRealtimeStressLowBetterTrend =>
'DoubleFeel 更关注的是你的长期变化趋势,而不是单次波动。';
@override
String get todayRealtimeStressScenarioTitle => 'HRV 与实时压力适用场景?';
@override
String get todayRealtimeStressScenarioHrvDefault => '在 Apple Watch 的默认设置下,HRV 每 2~5 小时更新一次。';
String get todayRealtimeStressScenarioHrvDefault =>
'在 Apple Watch 的默认设置下,HRV 每 2~5 小时更新一次。';
@override
String get todayRealtimeStressScenarioRegionLimit => '在部分地区,由于 Apple Watch 的呼吸功能受限,HRV 的更新频率可能会受到影响,并且开启呼吸功能后也会消耗更多电量。';
String get todayRealtimeStressScenarioRegionLimit =>
'在部分地区,由于 Apple Watch 的呼吸功能受限,HRV 的更新频率可能会受到影响,并且开启呼吸功能后也会消耗更多电量。';
@override
String get todayRealtimeStressScenarioIntro => '为了解决 HRV 更新间隔较长的问题,DoubleFeel 设计了实时压力功能:';
String get todayRealtimeStressScenarioIntro =>
'为了解决 HRV 更新间隔较长的问题,DoubleFeel 设计了实时压力功能:';
@override
String get todayRealtimeStressScenarioUpdateEvery6Min => '· 实时压力每 6 分钟更新一次';
... ... @@ -591,22 +630,27 @@ class AppLocalizationsZh extends AppLocalizations {
String get todayRealtimeStressScenarioTimely => '· 可以更及时地反映身体状态变化';
@override
String get todayRealtimeStressScenarioConsistentTrend => '· 在大多数情况下,实时压力趋势与 HRV 趋势是一致的';
String get todayRealtimeStressScenarioConsistentTrend =>
'· 在大多数情况下,实时压力趋势与 HRV 趋势是一致的';
@override
String get todayRealtimeStressScenarioSummary => '这样用户既能获得 HRV 的长期趋势,也能通过实时压力获得短时身体状态的参考。';
String get todayRealtimeStressScenarioSummary =>
'这样用户既能获得 HRV 的长期趋势,也能通过实时压力获得短时身体状态的参考。';
@override
String get todayFaqNoDataTitle => 'APP或表盘有没有数据怎么办?';
@override
String get todayFaqNoDataDescription1 => '1. 确认苹果手表系统在10.0以上,手机系统在14以上,系统版本可在「关于本机」内查看。';
String get todayFaqNoDataDescription1 =>
'1. 确认苹果手表系统在10.0以上,手机系统在14以上,系统版本可在「关于本机」内查看。';
@override
String get todayFaqNoDataDescription2 => '2. 确认是否开启所有权限:手机「健康」-「共享」-「app」-「DoubleFeel」-「打开所有权限」。';
String get todayFaqNoDataDescription2 =>
'2. 确认是否开启所有权限:手机「健康」-「共享」-「app」-「DoubleFeel」-「打开所有权限」。';
@override
String get todayFaqNoDataDescription3 => '3. 确认设备是否处于省电模式、低电量状态或手表佩戴未贴紧,以上情况会影响手表数据采集。';
String get todayFaqNoDataDescription3 =>
'3. 确认设备是否处于省电模式、低电量状态或手表佩戴未贴紧,以上情况会影响手表数据采集。';
@override
String get todayFaqContactPrefix => '如以上均检查无问题,可以';
... ... @@ -621,37 +665,46 @@ class AppLocalizationsZh extends AppLocalizations {
String get todayFaqWatchNoNotificationTitle => '手表无法收到状态通知?';
@override
String get todayFaqWatchNoNotificationDescription1 => '苹果手表和手机的通知展示有优先级:当手机已解锁并亮屏时,通知只会在手机端展示,不会在手表上出现。';
String get todayFaqWatchNoNotificationDescription1 =>
'苹果手表和手机的通知展示有优先级:当手机已解锁并亮屏时,通知只会在手机端展示,不会在手表上出现。';
@override
String get todayFaqWatchNoNotificationDescription2 => '若压力数据可正常显示和自动更新,但手表未收到通知,可尝试以下操作:';
String get todayFaqWatchNoNotificationDescription2 =>
'若压力数据可正常显示和自动更新,但手表未收到通知,可尝试以下操作:';
@override
String get todayFaqWatchNoNotificationCheckPhoneNotification => '1. 检查手机是否打开通知(设置-DoubleFeel-通知)。';
String get todayFaqWatchNoNotificationCheckPhoneNotification =>
'1. 检查手机是否打开通知(设置-DoubleFeel-通知)。';
@override
String get todayFaqWatchNoNotificationCheckPhoneBackgroundRefresh => '2. 检查手机是否打开后台App刷新(设置-DoubleFeel-后台App刷新)。';
String get todayFaqWatchNoNotificationCheckPhoneBackgroundRefresh =>
'2. 检查手机是否打开后台App刷新(设置-DoubleFeel-后台App刷新)。';
@override
String get todayFaqWatchNoNotificationCheckWatchBackgroundRefresh => '3. 检查手表是否打开后台App刷新(设置-通用-后台App刷新,并确保DoubleFeel开启)。';
String get todayFaqWatchNoNotificationCheckWatchBackgroundRefresh =>
'3. 检查手表是否打开后台App刷新(设置-通用-后台App刷新,并确保DoubleFeel开启)。';
@override
String get todayFaqWatchNoNotificationCheckModes => '4. 确保未处于低电量/专注/勿扰/剧院/睡眠等模式。';
String get todayFaqWatchNoNotificationCheckModes =>
'4. 确保未处于低电量/专注/勿扰/剧院/睡眠等模式。';
@override
String get todayFaqWatchNoNotificationReinstall => '5. 重装DoubleFeel 并重启AppleWatch与iPhone。';
String get todayFaqWatchNoNotificationReinstall =>
'5. 重装DoubleFeel 并重启AppleWatch与iPhone。';
@override
String get todayFaqWatchFaceDelayTitle => '手表表盘数据不更新或有延迟?';
@override
String get todayFaqWatchFaceDelayDescription1 => '由于苹果系统限制,所有手表表盘(第三方或官方)都会存在几分钟至半小时的延迟,开发者无法控制刷新频率。';
String get todayFaqWatchFaceDelayDescription1 =>
'由于苹果系统限制,所有手表表盘(第三方或官方)都会存在几分钟至半小时的延迟,开发者无法控制刷新频率。';
@override
String get todayFaqWatchFaceDelayIfOverOneHour => '若手机数据刷新后超过1小时表盘仍未更新:';
@override
String get todayFaqWatchFaceDelayOpenWatchApp => '请在手表上手动打开DoubleFeel,等待约1分钟。';
String get todayFaqWatchFaceDelayOpenWatchApp =>
'请在手表上手动打开DoubleFeel,等待约1分钟。';
@override
String get todayFaqWatchFaceDelayIfStill => '若仍未更新:';
... ... @@ -666,22 +719,27 @@ class AppLocalizationsZh extends AppLocalizations {
String get todayFaqWatchFaceDelayCheckData => '· 手机和手表app是否可正常看到HRV数据。';
@override
String get todayFaqWatchFaceDelayCheckPhoneHealth => '· 确保手机端「iOS设置-隐私与安全性-健康-DoubleFeel」全部授权。';
String get todayFaqWatchFaceDelayCheckPhoneHealth =>
'· 确保手机端「iOS设置-隐私与安全性-健康-DoubleFeel」全部授权。';
@override
String get todayFaqWatchFaceDelayCheckWatchHealth => '· 确保手表端「设置-健康-数据来源、App和服务-DoubleFeel」全部授权。';
String get todayFaqWatchFaceDelayCheckWatchHealth =>
'· 确保手表端「设置-健康-数据来源、App和服务-DoubleFeel」全部授权。';
@override
String get todayFaqWatchFaceDelayCheckBackgroundRefresh => '· 确认AppleWatch-设置-通用-后台App刷新中DoubleFeel已开启。';
String get todayFaqWatchFaceDelayCheckBackgroundRefresh =>
'· 确认AppleWatch-设置-通用-后台App刷新中DoubleFeel已开启。';
@override
String get todayFaqWatchFaceDelayRestartWatch => '· 若仍未自动刷新,请重启手表。长时间运行或后台占用过高可能导致表盘暂停更新。';
String get todayFaqWatchFaceDelayRestartWatch =>
'· 若仍未自动刷新,请重启手表。长时间运行或后台占用过高可能导致表盘暂停更新。';
@override
String get todayFaqWatchFaceBlackScreenTitle => '手表表盘出现黑屏?';
@override
String get todayFaqWatchFaceBlackScreenDescription => '若添加专属互动表盘后出现黑屏(仅显示时间和日期),可长按表盘,点击「编辑」,左滑至「复杂功能」,选择 DoubleFeel,然后按需选择各组件重新添加。';
String get todayFaqWatchFaceBlackScreenDescription =>
'若添加专属互动表盘后出现黑屏(仅显示时间和日期),可长按表盘,点击「编辑」,左滑至「复杂功能」,选择 DoubleFeel,然后按需选择各组件重新添加。';
@override
String get today => '今天';
... ... @@ -765,7 +823,8 @@ class AppLocalizationsZh extends AppLocalizations {
String get questionsAndFeedback => '问题和反馈';
@override
String get ifYouWouldLikeUsToReplyPleaseProvideYourEmailAddress => '如果需要我们回复,请填写联系邮箱';
String get ifYouWouldLikeUsToReplyPleaseProvideYourEmailAddress =>
'如果需要我们回复,请填写联系邮箱';
@override
String get uploadProof => '上传凭证';
... ...
... ... @@ -15,22 +15,21 @@ 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,
... ... @@ -53,8 +52,7 @@ class HealthUploadResult {
}
Object encode() {
return _toList();
}
return _toList(); }
static HealthUploadResult decode(Object result) {
result as List<Object?>;
... ... @@ -79,7 +77,8 @@ 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 {
... ... @@ -104,8 +103,7 @@ class HealthUploadDataPoint {
}
Object encode() {
return _toList();
}
return _toList(); }
static HealthUploadDataPoint decode(Object result) {
result as List<Object?>;
... ... @@ -130,7 +128,8 @@ class HealthUploadDataPoint {
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
int get hashCode => Object.hashAll(_toList());
int get hashCode => Object.hashAll(_toList())
;
}
class HealthSleepUploadDataPoint {
... ... @@ -155,8 +154,7 @@ class HealthSleepUploadDataPoint {
}
Object encode() {
return _toList();
}
return _toList(); }
static HealthSleepUploadDataPoint decode(Object result) {
result as List<Object?>;
... ... @@ -170,8 +168,7 @@ class HealthSleepUploadDataPoint {
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
bool operator ==(Object other) {
if (other is! HealthSleepUploadDataPoint ||
other.runtimeType != runtimeType) {
if (other is! HealthSleepUploadDataPoint || other.runtimeType != runtimeType) {
return false;
}
if (identical(this, other)) {
... ... @@ -182,7 +179,8 @@ class HealthSleepUploadDataPoint {
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
int get hashCode => Object.hashAll(_toList());
int get hashCode => Object.hashAll(_toList())
;
}
class HealthActivityTargetData {
... ... @@ -203,8 +201,7 @@ class HealthActivityTargetData {
}
Object encode() {
return _toList();
}
return _toList(); }
static HealthActivityTargetData decode(Object result) {
result as List<Object?>;
... ... @@ -217,8 +214,7 @@ class HealthActivityTargetData {
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
bool operator ==(Object other) {
if (other is! HealthActivityTargetData ||
other.runtimeType != runtimeType) {
if (other is! HealthActivityTargetData || other.runtimeType != runtimeType) {
return false;
}
if (identical(this, other)) {
... ... @@ -229,9 +225,11 @@ class HealthActivityTargetData {
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
int get hashCode => Object.hashAll(_toList());
int get hashCode => Object.hashAll(_toList())
;
}
class _PigeonCodec extends StandardMessageCodec {
const _PigeonCodec();
@override
... ... @@ -239,16 +237,16 @@ 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) {
} else if (value is HealthUploadDataPoint) {
buffer.putUint8(130);
writeValue(buffer, value.encode());
} else if (value is HealthSleepUploadDataPoint) {
} else if (value is HealthSleepUploadDataPoint) {
buffer.putUint8(131);
writeValue(buffer, value.encode());
} else if (value is HealthActivityTargetData) {
} else if (value is HealthActivityTargetData) {
buffer.putUint8(132);
writeValue(buffer, value.encode());
} else {
... ... @@ -259,13 +257,13 @@ class _PigeonCodec extends StandardMessageCodec {
@override
Object? readValueOfType(int type, ReadBuffer buffer) {
switch (type) {
case 129:
case 129:
return HealthUploadResult.decode(readValue(buffer)!);
case 130:
case 130:
return HealthUploadDataPoint.decode(readValue(buffer)!);
case 131:
case 131:
return HealthSleepUploadDataPoint.decode(readValue(buffer)!);
case 132:
case 132:
return HealthActivityTargetData.decode(readValue(buffer)!);
default:
return super.readValueOfType(type, buffer);
... ... @@ -277,11 +275,9 @@ 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();
... ... @@ -289,10 +285,8 @@ 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,
... ... @@ -319,10 +313,8 @@ 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,
... ... @@ -350,10 +342,8 @@ 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,
... ... @@ -380,10 +370,8 @@ 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,
... ... @@ -411,10 +399,8 @@ 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,
... ... @@ -440,18 +426,14 @@ class HealthKitHostApi {
}
}
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?>(
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 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) {
... ... @@ -468,23 +450,18 @@ class HealthKitHostApi {
message: 'Host platform returned null value for non-null return value.',
);
} else {
return (pigeonVar_replyList[0] as List<Object?>?)!
.cast<HealthUploadDataPoint>();
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?>(
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 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) {
... ... @@ -501,23 +478,18 @@ class HealthKitHostApi {
message: 'Host platform returned null value for non-null return value.',
);
} else {
return (pigeonVar_replyList[0] as List<Object?>?)!
.cast<HealthUploadDataPoint>();
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?>(
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 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) {
... ... @@ -534,23 +506,18 @@ class HealthKitHostApi {
message: 'Host platform returned null value for non-null return value.',
);
} else {
return (pigeonVar_replyList[0] as List<Object?>?)!
.cast<HealthUploadDataPoint>();
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?>(
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 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) {
... ... @@ -567,23 +534,18 @@ class HealthKitHostApi {
message: 'Host platform returned null value for non-null return value.',
);
} else {
return (pigeonVar_replyList[0] as List<Object?>?)!
.cast<HealthUploadDataPoint>();
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?>(
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 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) {
... ... @@ -600,23 +562,18 @@ class HealthKitHostApi {
message: 'Host platform returned null value for non-null return value.',
);
} else {
return (pigeonVar_replyList[0] as List<Object?>?)!
.cast<HealthUploadDataPoint>();
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?>(
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 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) {
... ... @@ -633,23 +590,18 @@ class HealthKitHostApi {
message: 'Host platform returned null value for non-null return value.',
);
} else {
return (pigeonVar_replyList[0] as List<Object?>?)!
.cast<HealthUploadDataPoint>();
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?>(
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 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) {
... ... @@ -666,23 +618,18 @@ class HealthKitHostApi {
message: 'Host platform returned null value for non-null return value.',
);
} else {
return (pigeonVar_replyList[0] as List<Object?>?)!
.cast<HealthUploadDataPoint>();
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?>(
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 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) {
... ... @@ -699,23 +646,18 @@ class HealthKitHostApi {
message: 'Host platform returned null value for non-null return value.',
);
} else {
return (pigeonVar_replyList[0] as List<Object?>?)!
.cast<HealthUploadDataPoint>();
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?>(
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 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) {
... ... @@ -732,23 +674,18 @@ class HealthKitHostApi {
message: 'Host platform returned null value for non-null return value.',
);
} else {
return (pigeonVar_replyList[0] as List<Object?>?)!
.cast<HealthUploadDataPoint>();
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?>(
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 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) {
... ... @@ -765,23 +702,18 @@ class HealthKitHostApi {
message: 'Host platform returned null value for non-null return value.',
);
} else {
return (pigeonVar_replyList[0] as List<Object?>?)!
.cast<HealthUploadDataPoint>();
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?>(
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 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) {
... ... @@ -798,23 +730,18 @@ class HealthKitHostApi {
message: 'Host platform returned null value for non-null return value.',
);
} else {
return (pigeonVar_replyList[0] as List<Object?>?)!
.cast<HealthSleepUploadDataPoint>();
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?>(
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 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) {
... ... @@ -831,23 +758,18 @@ class HealthKitHostApi {
message: 'Host platform returned null value for non-null return value.',
);
} else {
return (pigeonVar_replyList[0] as List<Object?>?)!
.cast<HealthUploadDataPoint>();
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?>(
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 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) {
... ... @@ -864,23 +786,18 @@ class HealthKitHostApi {
message: 'Host platform returned null value for non-null return value.',
);
} else {
return (pigeonVar_replyList[0] as List<Object?>?)!
.cast<HealthUploadDataPoint>();
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?>(
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 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) {
... ... @@ -897,23 +814,18 @@ class HealthKitHostApi {
message: 'Host platform returned null value for non-null return value.',
);
} else {
return (pigeonVar_replyList[0] as List<Object?>?)!
.cast<HealthUploadDataPoint>();
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?>(
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 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) {
... ...
... ... @@ -64,8 +64,10 @@ class HealthActivityTargetData {
)
@HostApi()
abstract class HealthKitHostApi {
@async
bool checkHealthAppAuthorization();
@async
String getHealthServerAuthUrl();
/// Opens Huawei Health client authorization UI. Returns whether user granted.
... ... @@ -76,58 +78,73 @@ abstract class HealthKitHostApi {
/// Runs native health read and server upload pipeline.
HealthUploadResult performHealthUpload();
@async
List<HealthUploadDataPoint> fetchHrvData(int startTime, int endTime);
@async
List<HealthUploadDataPoint> fetchHeartRateData(int startTime, int endTime);
@async
List<HealthUploadDataPoint> fetchWalkingHeartRateData(
int startTime,
int endTime,
);
@async
List<HealthUploadDataPoint> fetchRestingHeartRateData(
int startTime,
int endTime,
);
@async
List<HealthUploadDataPoint> fetchSleepingHeartRateData(
int startTime,
int endTime,
);
@async
List<HealthUploadDataPoint> fetchOxygenSaturationData(
int startTime,
int endTime,
);
@async
List<HealthUploadDataPoint> fetchActiveEnergyData(
int startTime,
int endTime,
);
@async
List<HealthUploadDataPoint> fetchExerciseData(int startTime, int endTime);
@async
List<HealthUploadDataPoint> fetchStandData(int startTime, int endTime);
@async
List<HealthUploadDataPoint> fetchStepCountData(int startTime, int endTime);
@async
List<HealthSleepUploadDataPoint> fetchSleepData(int startTime, int endTime);
@async
List<HealthUploadDataPoint> fetchSleepingWristTemperatureData(
int startTime,
int endTime,
);
@async
List<HealthUploadDataPoint> fetchRespiratoryRateData(
int startTime,
int endTime,
);
@async
List<HealthUploadDataPoint> fetchIrregularHeartRhythmData(
int startTime,
int endTime,
);
@async
HealthActivityTargetData? fetchActivityTargetData(
int startTime,
int endTime,
... ...
... ... @@ -133,10 +133,10 @@ packages:
dependency: transitive
description:
name: characters
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
url: "https://pub.dev"
source: hosted
version: "1.3.0"
version: "1.4.0"
checked_yaml:
dependency: transitive
description:
... ... @@ -149,10 +149,10 @@ packages:
dependency: transitive
description:
name: clock
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b
url: "https://pub.dev"
source: hosted
version: "1.1.1"
version: "1.1.2"
code_builder:
dependency: transitive
description:
... ... @@ -165,10 +165,10 @@ packages:
dependency: transitive
description:
name: collection
sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf
sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
url: "https://pub.dev"
source: hosted
version: "1.19.0"
version: "1.19.1"
convert:
dependency: transitive
description:
... ... @@ -237,10 +237,10 @@ packages:
dependency: transitive
description:
name: fake_async
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
url: "https://pub.dev"
source: hosted
version: "1.3.1"
version: "1.3.3"
ffi:
dependency: transitive
description:
... ... @@ -426,7 +426,7 @@ packages:
dependency: transitive
description:
path: image_cropper_for_web
ref: "br_v9.1.0_ohos"
ref: "65c2c99891882ea59732959a672f3d5993a837bb"
resolved-ref: "65c2c99891882ea59732959a672f3d5993a837bb"
url: "https://gitcode.com/openharmony-sig/fluttertpc_image_cropper.git"
source: git
... ... @@ -435,7 +435,7 @@ packages:
dependency: transitive
description:
path: image_cropper_platform_interface
ref: "br_v9.1.0_ohos"
ref: "65c2c99891882ea59732959a672f3d5993a837bb"
resolved-ref: "65c2c99891882ea59732959a672f3d5993a837bb"
url: "https://gitcode.com/openharmony-sig/fluttertpc_image_cropper.git"
source: git
... ... @@ -517,10 +517,10 @@ packages:
dependency: "direct main"
description:
name: intl
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5"
url: "https://pub.dev"
source: hosted
version: "0.19.0"
version: "0.20.2"
io:
dependency: transitive
description:
... ... @@ -549,26 +549,26 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06"
sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de"
url: "https://pub.dev"
source: hosted
version: "10.0.7"
version: "11.0.2"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379"
sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1"
url: "https://pub.dev"
source: hosted
version: "3.0.8"
version: "3.0.10"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1"
url: "https://pub.dev"
source: hosted
version: "3.0.1"
version: "3.0.2"
lints:
dependency: transitive
description:
... ... @@ -597,10 +597,10 @@ packages:
dependency: transitive
description:
name: matcher
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
url: "https://pub.dev"
source: hosted
version: "0.12.16+1"
version: "0.12.17"
material_color_utilities:
dependency: transitive
description:
... ... @@ -613,10 +613,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
url: "https://pub.dev"
source: hosted
version: "1.15.0"
version: "1.17.0"
mime:
dependency: transitive
description:
... ... @@ -645,10 +645,10 @@ packages:
dependency: transitive
description:
name: path
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
url: "https://pub.dev"
source: hosted
version: "1.9.0"
version: "1.9.1"
path_provider:
dependency: transitive
description:
... ... @@ -966,18 +966,18 @@ packages:
dependency: transitive
description:
name: stack_trace
sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377"
sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1"
url: "https://pub.dev"
source: hosted
version: "1.12.0"
version: "1.12.1"
stream_channel:
dependency: transitive
description:
name: stream_channel
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d"
url: "https://pub.dev"
source: hosted
version: "2.1.2"
version: "2.1.4"
stream_transform:
dependency: transitive
description:
... ... @@ -1006,10 +1006,10 @@ packages:
dependency: "direct main"
description:
name: table_calendar
sha256: b2896b7c86adf3a4d9c911d860120fe3dbe03c85db43b22fd61f14ee78cdbb63
sha256: "0c0c6219878b363a2d5f40c7afb159d845f253d061dc3c822aa0d5fe0f721982"
url: "https://pub.dev"
source: hosted
version: "3.1.3"
version: "3.2.0"
term_glyph:
dependency: transitive
description:
... ... @@ -1022,10 +1022,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c"
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
url: "https://pub.dev"
source: hosted
version: "0.7.3"
version: "0.7.7"
timing:
dependency: transitive
description:
... ... @@ -1054,10 +1054,10 @@ packages:
dependency: transitive
description:
name: vector_math
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b
url: "https://pub.dev"
source: hosted
version: "2.1.4"
version: "2.2.0"
vm_service:
dependency: transitive
description:
... ... @@ -1111,8 +1111,8 @@ packages:
dependency: transitive
description:
path: "packages/webview_flutter/webview_flutter_android"
ref: "br_webview_flutter-v4.13.0_ohos"
resolved-ref: cd84e4ca392f666bc728c32c49fb328127058826
ref: de942e79c9057b32ad31106508bd87c0d60aef83
resolved-ref: de942e79c9057b32ad31106508bd87c0d60aef83
url: "https://gitcode.com/openharmony-tpc/flutter_packages.git"
source: git
version: "4.7.0"
... ... @@ -1120,8 +1120,8 @@ packages:
dependency: transitive
description:
path: "packages/webview_flutter/webview_flutter_ohos"
ref: "br_webview_flutter-v4.13.0_ohos"
resolved-ref: cd84e4ca392f666bc728c32c49fb328127058826
ref: de942e79c9057b32ad31106508bd87c0d60aef83
resolved-ref: de942e79c9057b32ad31106508bd87c0d60aef83
url: "https://gitcode.com/openharmony-tpc/flutter_packages.git"
source: git
version: "4.7.0"
... ... @@ -1129,8 +1129,8 @@ packages:
dependency: transitive
description:
path: "packages/webview_flutter/webview_flutter_platform_interface"
ref: "br_webview_flutter-v4.13.0_ohos"
resolved-ref: cd84e4ca392f666bc728c32c49fb328127058826
ref: de942e79c9057b32ad31106508bd87c0d60aef83
resolved-ref: de942e79c9057b32ad31106508bd87c0d60aef83
url: "https://gitcode.com/openharmony-tpc/flutter_packages.git"
source: git
version: "2.13.1"
... ... @@ -1138,8 +1138,8 @@ packages:
dependency: transitive
description:
path: "packages/webview_flutter/webview_flutter_wkwebview"
ref: "br_webview_flutter-v4.13.0_ohos"
resolved-ref: cd84e4ca392f666bc728c32c49fb328127058826
ref: de942e79c9057b32ad31106508bd87c0d60aef83
resolved-ref: de942e79c9057b32ad31106508bd87c0d60aef83
url: "https://gitcode.com/openharmony-tpc/flutter_packages.git"
source: git
version: "3.22.0"
... ... @@ -1160,5 +1160,5 @@ packages:
source: hosted
version: "3.1.3"
sdks:
dart: ">=3.6.2 <4.0.0"
dart: ">=3.8.0-0 <4.0.0"
flutter: ">=3.27.0"
... ...