Commit d1f4b2029bcc1ac672fc076358c3763936798bda

Authored by 权海
1 parent 0c65f42b

feat(ci):本地运行首次

Showing 53 changed files with 107 additions and 1606 deletions
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Flutter",
"type": "dart",
"request": "launch",
"program": "lib/main.dart",
"flutterMode": "profile"
},
]
}
\ No newline at end of file
... ...
... ... @@ -59,7 +59,7 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/webview_flutter_wkwebview/darwin"
SPEC CHECKSUMS:
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
fluttertoast: 2c67e14dce98bbdb200df9e1acf610d7a6264ea1
image_cropper: c4326ea50132b1e1564499e5d32a84f01fb03537
image_picker_ios: 7fe1ff8e34c1790d6fff70a32484959f563a928a
... ...
... ... @@ -62,8 +62,7 @@ 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;
... ... @@ -71,8 +70,7 @@ 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.
... ... @@ -84,8 +82,7 @@ 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,
... ... @@ -528,8 +525,7 @@ abstract class AppLocalizations {
///
/// In zh, this message translates to:
/// **'你们现在可以查看彼此的 HRV、压力与睡眠变化,并在对方疲惫时及时送上关心。'**
String
get youCanNowViewEachOtherSHrvStressLevelsAndSleepPatternsAndReachOutToCheckInWhenTheOtherPersonSeemsTired;
String get youCanNowViewEachOtherSHrvStressLevelsAndSleepPatternsAndReachOutToCheckInWhenTheOtherPersonSeemsTired;
/// No description provided for @bindPartnerTitle.
///
... ... @@ -1450,8 +1446,7 @@ abstract class AppLocalizations {
String get todayFaqWatchFaceBlackScreenDescription;
}
class _AppLocalizationsDelegate
extends LocalizationsDelegate<AppLocalizations> {
class _AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations> {
const _AppLocalizationsDelegate();
@override
... ... @@ -1460,25 +1455,25 @@ class _AppLocalizationsDelegate
}
@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
... ... @@ -69,12 +67,10 @@ 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?';
... ... @@ -86,19 +82,16 @@ 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';
... ... @@ -107,8 +100,7 @@ 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';
... ... @@ -117,8 +109,7 @@ 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';
... ... @@ -142,8 +133,7 @@ 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';
... ... @@ -158,8 +148,7 @@ 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!';
... ... @@ -168,19 +157,16 @@ 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';
... ... @@ -198,30 +184,25 @@ 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';
... ... @@ -236,16 +217,13 @@ 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';
... ... @@ -284,8 +262,7 @@ 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';
... ... @@ -335,15 +312,13 @@ 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';
... ... @@ -355,12 +330,10 @@ 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';
... ...
// ignore: unused_import
import 'package:intl/intl.dart' as intl;
import 'app_localizations.dart';
// ignore_for_file: type=lint
... ... @@ -72,8 +70,7 @@ 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 => '请问以下哪些描述,经常发生在你身上?';
... ... @@ -163,8 +160,7 @@ 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 => '展开说说';
... ... @@ -188,12 +184,10 @@ 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 => '开启通知';
... ... @@ -202,8 +196,7 @@ class AppLocalizationsZh extends AppLocalizations {
String get onboardingNotificationSubtitle => '及时了解身体每一次异动';
@override
String get onboardingNotificationBody =>
'AppleWatch数据更新后会及时提醒你,帮助你及时行动,改善压力状态';
String get onboardingNotificationBody => 'AppleWatch数据更新后会及时提醒你,帮助你及时行动,改善压力状态';
@override
String get onboardingMemberTitle => '获得年度会员优惠';
... ... @@ -227,9 +220,7 @@ class AppLocalizationsZh extends AppLocalizations {
String get healthCompanionIsNowAvailable => '健康陪伴已开启';
@override
String
get youCanNowViewEachOtherSHrvStressLevelsAndSleepPatternsAndReachOutToCheckInWhenTheOtherPersonSeemsTired =>
'你们现在可以查看彼此的 HRV、压力与睡眠变化,并在对方疲惫时及时送上关心。';
String get youCanNowViewEachOtherSHrvStressLevelsAndSleepPatternsAndReachOutToCheckInWhenTheOtherPersonSeemsTired => '你们现在可以查看彼此的 HRV、压力与睡眠变化,并在对方疲惫时及时送上关心。';
@override
String get bindPartnerTitle => '添加亲密联系人\n多一个人关注你的健康';
... ... @@ -342,8 +333,7 @@ class AppLocalizationsZh extends AppLocalizations {
String get todayHealthDataAuthTitle => '无法获取心率健康数据';
@override
String get todayHealthDataAuthDescription =>
'DoubleFeel 需要授权访问你的健康数据,才能提供压力提醒、实时压力统计和健康建议;否则应用功能可能无法正常使用。请放心,你的健康数据仅存储在本地,不会上传到任何服务器。';
String get todayHealthDataAuthDescription => 'DoubleFeel 需要授权访问你的健康数据,才能提供压力提醒、实时压力统计和健康建议;否则应用功能可能无法正常使用。请放心,你的健康数据仅存储在本地,不会上传到任何服务器。';
@override
String get todayHealthDataAuthAction => '授权访问健康数据';
... ...
[
{
"analyzerMode":"BEFORE_RELEASE_CHECK_MODE",
"autoCompile":true,
"autoTest":true,
"cardId":200,
"cardName":"自动上架体验规范体检",
"coldStartCount":0,
"default":true,
"projectType":"app",
"replayTask":false,
"replayTime":60,
"ruleCodeList":[
"0132",
"0133",
"0134",
"0135",
"0601",
"0604",
"0602",
"0502",
"0512",
"0515"
],
"singleOperateDuration":20,
"testDuration":30
}
]
\ No newline at end of file
[
{
"analyzerMode":"BEFORE_RELEASE_CHECK_MODE",
"autoCompile":true,
"autoTest":true,
"cardId":300,
"cardName":"自动上架体验规范体检",
"coldStartCount":0,
"default":true,
"projectType":"service",
"replayTask":false,
"replayTime":60,
"ruleCodeList":[
"0132",
"0133",
"0134",
"0135",
"0601",
"0604",
"0602",
"0502",
"0512",
"0515"
],
"singleOperateDuration":20,
"testDuration":30
}
]
\ No newline at end of file
/node_modules
/oh_modules
/local.properties
/.idea
**/build
/.hvigor
.cxx
/.clangd
/.clang-format
/.clang-tidy
**/.test
**/BuildProfile.ets
**/oh-package-lock.json5
/package.json
/package-lock.json
**/src/main/resources/rawfile/flutter_assets/
**/libs/**/libapp.so
**/libs/**/libflutter.so
**/libs/**/libvmservice_snapshot.so
{
"app": {
"bundleName": "com.doublefeel.hmapp",
"vendor": "example",
"versionCode": 1000000,
"versionName": "1.0.0",
"icon": "$media:app_icon",
"label": "$string:app_name"
}
}
{
"string": [
{
"name": "app_name",
"value": "doublefeel_flutter"
}
]
}
{
"app": {
"signingConfigs": [
{
"name": "default",
"type": "HarmonyOS",
"material": {
"certpath": "/Users/changshouda/.ohos/config/default_ohos_vKsCARV5xViLtjn_9PuLQcrOe5rSSbAnDdfHVUvSJBw=.cer",
"keyAlias": "debugKey",
"keyPassword": "0000001B8633917FD6E13B94AB277BE5B9EFD374ABE0BE813C34FD491ADCB0D102C8354C832AFD650EDE57",
"profile": "/Users/changshouda/.ohos/config/default_ohos_vKsCARV5xViLtjn_9PuLQcrOe5rSSbAnDdfHVUvSJBw=.p7b",
"signAlg": "SHA256withECDSA",
"storeFile": "/Users/changshouda/.ohos/config/default_ohos_vKsCARV5xViLtjn_9PuLQcrOe5rSSbAnDdfHVUvSJBw=.p12",
"storePassword": "0000001BB1E97D57837DF0C573416B83B451B9C8E4A48A80E73F66A4BCFEA797C54672EFB1A8D3E06AFAF1"
}
}
],
"products": [
{
"name": "default",
"signingConfig": "default",
"targetSdkVersion": "6.0.0(20)",
"compatibleSdkVersion": "6.0.0(20)",
"runtimeOS": "HarmonyOS"
}
],
"buildModeSet": [
{
"name": "debug"
},
{
"name": "profile"
},
{
"name": "release"
}
]
},
"modules": [
{
"name": "entry",
"srcPath": "./entry",
"targets": [
{
"name": "default",
"applyToProducts": [
"default"
]
}
]
}
]
}
\ No newline at end of file
/node_modules
/oh_modules
/.preview
/build
/.cxx
/.test
GeneratedPluginRegistrant.ets
\ No newline at end of file
{
"apiType": 'stageMode',
"buildOption": {
},
"targets": [
{
"name": "default",
"runtimeOS": "HarmonyOS"
},
{
"name": "ohosTest",
}
]
}
\ No newline at end of file
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
import { hapTasks } from '@ohos/hvigor-ohos-plugin';
export default {
system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
plugins: [] /* Custom plugin to extend the functionality of Hvigor. */
}
{
"name": "entry",
"version": "1.0.0",
"description": "Please describe the basic information.",
"main": "",
"author": "",
"license": "",
"dependencies": {},
}
import { FlutterAbility, FlutterEngine } from '@ohos/flutter_ohos';
import { GeneratedPluginRegistrant } from '../plugins/GeneratedPluginRegistrant';
import { NativePigeonRegistrar } from '../native/NativePigeonRegistrar';
export default class EntryAbility extends FlutterAbility {
configureFlutterEngine(flutterEngine: FlutterEngine) {
super.configureFlutterEngine(flutterEngine)
GeneratedPluginRegistrant.registerWith(flutterEngine)
NativePigeonRegistrar.register(flutterEngine.getDartExecutor()!.getBinaryMessenger()!)
}
}
import { AlipayHostApi, AliPayResultCode } from '../pigeon/AlipayApi';
/**
* Alipay host implementation for HarmonyOS.
*
* Currently a stub – replace with the real Alipay HarmonyOS SDK call
* once the SDK is available.
*/
export class AlipayHostApiImpl extends AlipayHostApi {
launchAliPay(_prepayData: string): AliPayResultCode {
// TODO: call Alipay HarmonyOS SDK
return AliPayResultCode.UNSUPPORTED;
}
}
import { HealthKitHostApi, HealthUploadResult } from '../pigeon/HealthKitApi';
/**
* HealthKit host implementation for HarmonyOS.
*
* Currently a stub – replace with HarmonyOS @kit.HealthKit ArkTS API calls
* once integration is ready.
*/
export class HealthKitHostApiImpl extends HealthKitHostApi {
checkHealthAppAuthorization(): boolean {
// TODO: call HarmonyOS Health Kit authorization check API
return false;
}
getHealthServerAuthUrl(): string {
// TODO: build OAuth URL for HarmonyOS Health Kit server authorization
return '';
}
requestHealthClientAuthorization(): boolean {
// TODO: launch HarmonyOS Health Kit client authorization UI
return false;
}
cancelHealthAppAuthorization(): boolean {
// TODO: call HarmonyOS Health Kit cancel authorization API
return false;
}
performHealthUpload(): HealthUploadResult {
// TODO: read health data via HarmonyOS @kit.HealthKit and upload to server
return new HealthUploadResult(false, false, 'Native bridge pending on HarmonyOS');
}
}
import { HealthKitHostApi } from '../pigeon/HealthKitApi';
import { WearEngineHostApi } from '../pigeon/WearEngineApi';
import { AlipayHostApi } from '../pigeon/AlipayApi';
import { BinaryMessenger } from '@ohos/flutter_ohos/src/main/ets/plugin/common/BinaryMessenger';
import { AlipayHostApiImpl } from './AlipayHostApiImpl';
import { HealthKitHostApiImpl } from './HealthKitHostApiImpl';
import { WearEngineHostApiImpl } from './WearEngineHostApiImpl';
/** Registers all Pigeon host-API implementations with the Flutter binary messenger. */
export class NativePigeonRegistrar {
static register(binaryMessenger: BinaryMessenger): void {
HealthKitHostApi.setup(binaryMessenger, new HealthKitHostApiImpl());
WearEngineHostApi.setup(binaryMessenger, new WearEngineHostApiImpl());
AlipayHostApi.setup(binaryMessenger, new AlipayHostApiImpl());
}
}
import { WearEngineHostApi, WearDeviceInfo } from '../pigeon/WearEngineApi';
/**
* WearEngine host implementation for HarmonyOS.
*
* Currently a stub – replace with HarmonyOS distributed communication /
* BLE / HiWear ArkTS API calls once integration is ready.
*/
export class WearEngineHostApiImpl extends WearEngineHostApi {
hasAvailableDevices(): boolean {
// TODO: call HarmonyOS device discovery API
return false;
}
checkConnectedDevice(): WearDeviceInfo {
// TODO: query connected wearable via HarmonyOS distributed bus
return new WearDeviceInfo();
}
registerMessageReceiver(): boolean {
// TODO: register P2P message listener on HarmonyOS
return false;
}
sendTextMessage(_message: string): boolean {
// TODO: send P2P text message to watch via HarmonyOS
return false;
}
sendWatchSyncPayload(jsonPayload: string): boolean {
return this.sendTextMessage(jsonPayload);
}
}
import common from '@ohos.app.ability.common';
import { FlutterPage } from '@ohos/flutter_ohos'
let storage = LocalStorage.getShared()
const EVENT_BACK_PRESS = 'EVENT_BACK_PRESS'
@Entry(storage)
@Component
struct Index {
private context = getContext(this) as common.UIAbilityContext
@LocalStorageLink('viewId') viewId: string = "";
build() {
Column() {
FlutterPage({ viewId: this.viewId })
}
}
onBackPress(): boolean {
this.context.eventHub.emit(EVENT_BACK_PRESS)
return true
}
}
\ No newline at end of file
/*
* // Copyright 2013 The Flutter Authors. All rights reserved.
*/
import StandardMessageCodec from '@ohos/flutter_ohos/src/main/ets/plugin/common/StandardMessageCodec';
import BasicMessageChannel, { Reply } from '@ohos/flutter_ohos/src/main/ets/plugin/common/BasicMessageChannel';
import { BinaryMessenger,TaskQueue } from '@ohos/flutter_ohos/src/main/ets/plugin/common/BinaryMessenger';
import MessageCodec from '@ohos/flutter_ohos/src/main/ets/plugin/common/MessageCodec';
import { ByteBuffer } from '@ohos/flutter_ohos/src/main/ets/util/ByteBuffer';
/** Error class for passing custom error details to Flutter via a thrown PlatformException. */
export class FlutterError implements Error {
/** The error code. */
public code: string;
/** The error name. */
public name: string;
/** The error message. */
public message: string;
/** The error stack. */
public stack?: string;
constructor(code: string, name: string, message: string, stack?: string)
{
this.code = code;
this.name = name;
this.message = message;
this.stack = stack;
}
}
function wrapError(error: Error): Array<Object> {
let errorList: Array<Object> = new Array<Object>(3);
if (error instanceof FlutterError) {
let err: FlutterError = error as FlutterError;
errorList[0] = err.code;
errorList[1] = err.name;
errorList[2] = err.message;
} else {
errorList[0] = error.toString();
errorList[1] = error.name;
errorList[2] = "Cause: " + error.message + ", Stacktrace: " + error.stack;
}
return errorList;
}
/*
* Alipay payment result codes.
*
* Generated enum from Pigeon that represents data sent in messages.
*/
export enum AliPayResultCode {
SUCCESS,
CANCEL,
ERROR,
UNSUPPORTED
}
/*
* Alipay payment result codes.
*
* Generated enum Companion class from Pigeon that represents data sent
in messages.Do not delete otherwise enum type data transfer will be failed
*/
export class AliPayResultCodeEnum {
index: string|null = null;
constructor(index: string){
this.index = index;
}
}
export class PigeonCodec extends StandardMessageCodec {
static readonly INSTANCE: PigeonCodec = new PigeonCodec();
getByte(n: number): number {
let byteArray = new Uint8Array(1);
byteArray[0] = n;
return byteArray[0] as number;
}
private constructor() {
super();
}
readValueOfType(type: number, buffer: ByteBuffer): ESObject {
switch (type) {
case this.getByte(129): {
let value: Object= super.readValue(buffer);
return value == null ? null : AliPayResultCode[value as number];
}
default:
return super.readValueOfType(type, buffer);
}
}
writeValue(stream: ByteBuffer , value: ESObject): ESObject{
if (value instanceof AliPayResultCodeEnum) {
stream.writeUint8(this.getByte(129));
this.writeValue(stream, value == null ? null : AliPayResultCode[value.index as string]);
} else {
super.writeValue(stream, value);
}
}
}
/* Generated abstract class from Pigeon that represents a handler of messages from Flutter.*/
export abstract class AlipayHostApi {
abstract launchAliPay(prepayData: string ): AliPayResultCode;
/** The codec used by AlipayHostApi. */
static getCodec(): MessageCodec<Object>{
return PigeonCodec.INSTANCE;
}
/*Sets up an instance of `AlipayHostApi` to handle messages through the `binaryMessenger`.*/
static setup(binaryMessenger: BinaryMessenger, api: AlipayHostApi | null): void {
{
let channel: BasicMessageChannel<Object> =
new BasicMessageChannel(
binaryMessenger, "dev.flutter.pigeon.doublefeel_flutter.AlipayHostApi.launchAliPay", AlipayHostApi.getCodec());
if (api != null) {
channel.setMessageHandler({
onMessage(message: Object ,reply: Reply<Object> ) {
let args: Array<Object> = message as Array<Object>;
let res: Array<Object> = [];
try {
let output: AliPayResultCodeEnum = new AliPayResultCodeEnum(api!.launchAliPay(args[0] as AliPayResultCode).toString());
res.push(output);
}
catch (error) {
let wrappedError: Array<Object> = wrapError(error);
res = wrappedError;
}
reply.reply(res);
} });
} else {
channel.setMessageHandler(null);
}
}
}
}
/*
* // Copyright 2013 The Flutter Authors. All rights reserved.
*/
import StandardMessageCodec from '@ohos/flutter_ohos/src/main/ets/plugin/common/StandardMessageCodec';
import BasicMessageChannel, { Reply } from '@ohos/flutter_ohos/src/main/ets/plugin/common/BasicMessageChannel';
import { BinaryMessenger,TaskQueue } from '@ohos/flutter_ohos/src/main/ets/plugin/common/BinaryMessenger';
import MessageCodec from '@ohos/flutter_ohos/src/main/ets/plugin/common/MessageCodec';
import { ByteBuffer } from '@ohos/flutter_ohos/src/main/ets/util/ByteBuffer';
/** Error class for passing custom error details to Flutter via a thrown PlatformException. */
export class FlutterError implements Error {
/** The error code. */
public code: string;
/** The error name. */
public name: string;
/** The error message. */
public message: string;
/** The error stack. */
public stack?: string;
constructor(code: string, name: string, message: string, stack?: string)
{
this.code = code;
this.name = name;
this.message = message;
this.stack = stack;
}
}
function wrapError(error: Error): Array<Object> {
let errorList: Array<Object> = new Array<Object>(3);
if (error instanceof FlutterError) {
let err: FlutterError = error as FlutterError;
errorList[0] = err.code;
errorList[1] = err.name;
errorList[2] = err.message;
} else {
errorList[0] = error.toString();
errorList[1] = error.name;
errorList[2] = "Cause: " + error.message + ", Stacktrace: " + error.stack;
}
return errorList;
}
/* Generated class from Pigeon that represents data sent in messages.*/
export class HealthUploadResult {
private commonUploadSuccess?: boolean;
public setCommonUploadSuccess(commonUploadSuccess:boolean):void {
this.commonUploadSuccess = commonUploadSuccess;
}
getCommonUploadSuccess(): boolean | undefined{
return this.commonUploadSuccess;
}
private sleepUploadSuccess?: boolean;
public setSleepUploadSuccess(sleepUploadSuccess:boolean):void {
this.sleepUploadSuccess = sleepUploadSuccess;
}
getSleepUploadSuccess(): boolean | undefined{
return this.sleepUploadSuccess;
}
private errorMessage?: string;
public setErrorMessage(errorMessage:string):void {
this.errorMessage = errorMessage;
}
getErrorMessage(): string | undefined{
return this.errorMessage;
}
constructor(commonUploadSuccess?: boolean, sleepUploadSuccess?: boolean, errorMessage?: string) {
this.commonUploadSuccess = commonUploadSuccess;
this.sleepUploadSuccess = sleepUploadSuccess;
this.errorMessage = errorMessage;
}
toList(): Object[] {
let arr: Object[] = new Array();
if(this.commonUploadSuccess !==undefined){
arr.push(this.commonUploadSuccess);
}
if(this.sleepUploadSuccess !==undefined){
arr.push(this.sleepUploadSuccess);
}
if(this.errorMessage !==undefined){
arr.push(this.errorMessage);
}
return arr;
}
static fromList(arr: Object[]): HealthUploadResult {
let pigeonResult: HealthUploadResult = new HealthUploadResult();
let commonUploadSuccess: Object = arr[0];
pigeonResult.setCommonUploadSuccess(commonUploadSuccess as boolean);
let sleepUploadSuccess: Object = arr[1];
pigeonResult.setSleepUploadSuccess(sleepUploadSuccess as boolean);
let errorMessage: Object = arr[2];
pigeonResult.setErrorMessage(errorMessage as string);
return pigeonResult;
}
}
export class PigeonCodec extends StandardMessageCodec {
static readonly INSTANCE: PigeonCodec = new PigeonCodec();
getByte(n: number): number {
let byteArray = new Uint8Array(1);
byteArray[0] = n;
return byteArray[0] as number;
}
private constructor() {
super();
}
readValueOfType(type: number, buffer: ByteBuffer): ESObject {
switch (type) {
case this.getByte(129):
return HealthUploadResult.fromList(super.readValue(buffer) as Object[]);
default:
return super.readValueOfType(type, buffer);
}
}
writeValue(stream: ByteBuffer , value: ESObject): ESObject{
if (value instanceof HealthUploadResult) {
stream.writeUint8(this.getByte(129));
this.writeValue(stream, (value as HealthUploadResult).toList());
} else {
super.writeValue(stream, value);
}
}
}
/* Generated abstract class from Pigeon that represents a handler of messages from Flutter.*/
export abstract class HealthKitHostApi {
abstract checkHealthAppAuthorization(): boolean;
abstract getHealthServerAuthUrl(): string;
/* Opens Huawei Health client authorization UI. Returns whether user granted.*/
abstract requestHealthClientAuthorization(): boolean;
abstract cancelHealthAppAuthorization(): boolean;
/* Runs native health read and server upload pipeline.*/
abstract performHealthUpload(): HealthUploadResult;
/** The codec used by HealthKitHostApi. */
static getCodec(): MessageCodec<Object>{
return PigeonCodec.INSTANCE;
}
/*Sets up an instance of `HealthKitHostApi` to handle messages through the `binaryMessenger`.*/
static setup(binaryMessenger: BinaryMessenger, api: HealthKitHostApi | null): void {
{
let channel: BasicMessageChannel<Object> =
new BasicMessageChannel(
binaryMessenger, "dev.flutter.pigeon.doublefeel_flutter.HealthKitHostApi.checkHealthAppAuthorization", HealthKitHostApi.getCodec());
if (api != null) {
channel.setMessageHandler({
onMessage(message: Object ,reply: Reply<Object> ) {
let res: Array<Object> = [];
try {
let output: boolean = api!.checkHealthAppAuthorization();
res.push(output);
}
catch (error) {
let wrappedError: Array<Object> = wrapError(error);
res = wrappedError;
}
reply.reply(res);
} });
} else {
channel.setMessageHandler(null);
}
}
{
let channel: BasicMessageChannel<Object> =
new BasicMessageChannel(
binaryMessenger, "dev.flutter.pigeon.doublefeel_flutter.HealthKitHostApi.getHealthServerAuthUrl", HealthKitHostApi.getCodec());
if (api != null) {
channel.setMessageHandler({
onMessage(message: Object ,reply: Reply<Object> ) {
let res: Array<Object> = [];
try {
let output: string = api!.getHealthServerAuthUrl();
res.push(output);
}
catch (error) {
let wrappedError: Array<Object> = wrapError(error);
res = wrappedError;
}
reply.reply(res);
} });
} else {
channel.setMessageHandler(null);
}
}
{
let channel: BasicMessageChannel<Object> =
new BasicMessageChannel(
binaryMessenger, "dev.flutter.pigeon.doublefeel_flutter.HealthKitHostApi.requestHealthClientAuthorization", HealthKitHostApi.getCodec());
if (api != null) {
channel.setMessageHandler({
onMessage(message: Object ,reply: Reply<Object> ) {
let res: Array<Object> = [];
try {
let output: boolean = api!.requestHealthClientAuthorization();
res.push(output);
}
catch (error) {
let wrappedError: Array<Object> = wrapError(error);
res = wrappedError;
}
reply.reply(res);
} });
} else {
channel.setMessageHandler(null);
}
}
{
let channel: BasicMessageChannel<Object> =
new BasicMessageChannel(
binaryMessenger, "dev.flutter.pigeon.doublefeel_flutter.HealthKitHostApi.cancelHealthAppAuthorization", HealthKitHostApi.getCodec());
if (api != null) {
channel.setMessageHandler({
onMessage(message: Object ,reply: Reply<Object> ) {
let res: Array<Object> = [];
try {
let output: boolean = api!.cancelHealthAppAuthorization();
res.push(output);
}
catch (error) {
let wrappedError: Array<Object> = wrapError(error);
res = wrappedError;
}
reply.reply(res);
} });
} else {
channel.setMessageHandler(null);
}
}
{
let channel: BasicMessageChannel<Object> =
new BasicMessageChannel(
binaryMessenger, "dev.flutter.pigeon.doublefeel_flutter.HealthKitHostApi.performHealthUpload", HealthKitHostApi.getCodec());
if (api != null) {
channel.setMessageHandler({
onMessage(message: Object ,reply: Reply<Object> ) {
let res: Array<Object> = [];
try {
let output: HealthUploadResult = api!.performHealthUpload();
res.push(output);
}
catch (error) {
let wrappedError: Array<Object> = wrapError(error);
res = wrappedError;
}
reply.reply(res);
} });
} else {
channel.setMessageHandler(null);
}
}
}
}
/*
* // Copyright 2013 The Flutter Authors. All rights reserved.
*/
import StandardMessageCodec from '@ohos/flutter_ohos/src/main/ets/plugin/common/StandardMessageCodec';
import BasicMessageChannel, { Reply } from '@ohos/flutter_ohos/src/main/ets/plugin/common/BasicMessageChannel';
import { BinaryMessenger,TaskQueue } from '@ohos/flutter_ohos/src/main/ets/plugin/common/BinaryMessenger';
import MessageCodec from '@ohos/flutter_ohos/src/main/ets/plugin/common/MessageCodec';
import { ByteBuffer } from '@ohos/flutter_ohos/src/main/ets/util/ByteBuffer';
/** Error class for passing custom error details to Flutter via a thrown PlatformException. */
export class FlutterError implements Error {
/** The error code. */
public code: string;
/** The error name. */
public name: string;
/** The error message. */
public message: string;
/** The error stack. */
public stack?: string;
constructor(code: string, name: string, message: string, stack?: string)
{
this.code = code;
this.name = name;
this.message = message;
this.stack = stack;
}
}
function wrapError(error: Error): Array<Object> {
let errorList: Array<Object> = new Array<Object>(3);
if (error instanceof FlutterError) {
let err: FlutterError = error as FlutterError;
errorList[0] = err.code;
errorList[1] = err.name;
errorList[2] = err.message;
} else {
errorList[0] = error.toString();
errorList[1] = error.name;
errorList[2] = "Cause: " + error.message + ", Stacktrace: " + error.stack;
}
return errorList;
}
/* Generated class from Pigeon that represents data sent in messages.*/
export class WearDeviceInfo {
private deviceId?: string;
public setDeviceId(deviceId:string):void {
this.deviceId = deviceId;
}
getDeviceId(): string | undefined{
return this.deviceId;
}
private deviceName?: string;
public setDeviceName(deviceName:string):void {
this.deviceName = deviceName;
}
getDeviceName(): string | undefined{
return this.deviceName;
}
private isConnected?: boolean;
public setIsConnected(isConnected:boolean):void {
this.isConnected = isConnected;
}
getIsConnected(): boolean | undefined{
return this.isConnected;
}
constructor(deviceId?: string, deviceName?: string, isConnected?: boolean) {
this.deviceId = deviceId;
this.deviceName = deviceName;
this.isConnected = isConnected;
}
toList(): Object[] {
let arr: Object[] = new Array();
if(this.deviceId !==undefined){
arr.push(this.deviceId);
}
if(this.deviceName !==undefined){
arr.push(this.deviceName);
}
if(this.isConnected !==undefined){
arr.push(this.isConnected);
}
return arr;
}
static fromList(arr: Object[]): WearDeviceInfo {
let pigeonResult: WearDeviceInfo = new WearDeviceInfo();
let deviceId: Object = arr[0];
pigeonResult.setDeviceId(deviceId as string);
let deviceName: Object = arr[1];
pigeonResult.setDeviceName(deviceName as string);
let isConnected: Object = arr[2];
pigeonResult.setIsConnected(isConnected as boolean);
return pigeonResult;
}
}
export class PigeonCodec extends StandardMessageCodec {
static readonly INSTANCE: PigeonCodec = new PigeonCodec();
getByte(n: number): number {
let byteArray = new Uint8Array(1);
byteArray[0] = n;
return byteArray[0] as number;
}
private constructor() {
super();
}
readValueOfType(type: number, buffer: ByteBuffer): ESObject {
switch (type) {
case this.getByte(129):
return WearDeviceInfo.fromList(super.readValue(buffer) as Object[]);
default:
return super.readValueOfType(type, buffer);
}
}
writeValue(stream: ByteBuffer , value: ESObject): ESObject{
if (value instanceof WearDeviceInfo) {
stream.writeUint8(this.getByte(129));
this.writeValue(stream, (value as WearDeviceInfo).toList());
} else {
super.writeValue(stream, value);
}
}
}
/* Generated abstract class from Pigeon that represents a handler of messages from Flutter.*/
export abstract class WearEngineHostApi {
abstract hasAvailableDevices(): boolean;
abstract checkConnectedDevice(): WearDeviceInfo;
abstract registerMessageReceiver(): boolean;
abstract sendTextMessage(message: string ): boolean;
abstract sendWatchSyncPayload(jsonPayload: string ): boolean;
/** The codec used by WearEngineHostApi. */
static getCodec(): MessageCodec<Object>{
return PigeonCodec.INSTANCE;
}
/*Sets up an instance of `WearEngineHostApi` to handle messages through the `binaryMessenger`.*/
static setup(binaryMessenger: BinaryMessenger, api: WearEngineHostApi | null): void {
{
let channel: BasicMessageChannel<Object> =
new BasicMessageChannel(
binaryMessenger, "dev.flutter.pigeon.doublefeel_flutter.WearEngineHostApi.hasAvailableDevices", WearEngineHostApi.getCodec());
if (api != null) {
channel.setMessageHandler({
onMessage(message: Object ,reply: Reply<Object> ) {
let res: Array<Object> = [];
try {
let output: boolean = api!.hasAvailableDevices();
res.push(output);
}
catch (error) {
let wrappedError: Array<Object> = wrapError(error);
res = wrappedError;
}
reply.reply(res);
} });
} else {
channel.setMessageHandler(null);
}
}
{
let channel: BasicMessageChannel<Object> =
new BasicMessageChannel(
binaryMessenger, "dev.flutter.pigeon.doublefeel_flutter.WearEngineHostApi.checkConnectedDevice", WearEngineHostApi.getCodec());
if (api != null) {
channel.setMessageHandler({
onMessage(message: Object ,reply: Reply<Object> ) {
let res: Array<Object> = [];
try {
let output: WearDeviceInfo = api!.checkConnectedDevice();
res.push(output);
}
catch (error) {
let wrappedError: Array<Object> = wrapError(error);
res = wrappedError;
}
reply.reply(res);
} });
} else {
channel.setMessageHandler(null);
}
}
{
let channel: BasicMessageChannel<Object> =
new BasicMessageChannel(
binaryMessenger, "dev.flutter.pigeon.doublefeel_flutter.WearEngineHostApi.registerMessageReceiver", WearEngineHostApi.getCodec());
if (api != null) {
channel.setMessageHandler({
onMessage(message: Object ,reply: Reply<Object> ) {
let res: Array<Object> = [];
try {
let output: boolean = api!.registerMessageReceiver();
res.push(output);
}
catch (error) {
let wrappedError: Array<Object> = wrapError(error);
res = wrappedError;
}
reply.reply(res);
} });
} else {
channel.setMessageHandler(null);
}
}
{
let channel: BasicMessageChannel<Object> =
new BasicMessageChannel(
binaryMessenger, "dev.flutter.pigeon.doublefeel_flutter.WearEngineHostApi.sendTextMessage", WearEngineHostApi.getCodec());
if (api != null) {
channel.setMessageHandler({
onMessage(message: Object ,reply: Reply<Object> ) {
let args: Array<Object> = message as Array<Object>;
let res: Array<Object> = [];
try {
let output: boolean = api!.sendTextMessage(args[0] as string);
res.push(output);
}
catch (error) {
let wrappedError: Array<Object> = wrapError(error);
res = wrappedError;
}
reply.reply(res);
} });
} else {
channel.setMessageHandler(null);
}
}
{
let channel: BasicMessageChannel<Object> =
new BasicMessageChannel(
binaryMessenger, "dev.flutter.pigeon.doublefeel_flutter.WearEngineHostApi.sendWatchSyncPayload", WearEngineHostApi.getCodec());
if (api != null) {
channel.setMessageHandler({
onMessage(message: Object ,reply: Reply<Object> ) {
let args: Array<Object> = message as Array<Object>;
let res: Array<Object> = [];
try {
let output: boolean = api!.sendWatchSyncPayload(args[0] as string);
res.push(output);
}
catch (error) {
let wrappedError: Array<Object> = wrapError(error);
res = wrappedError;
}
reply.reply(res);
} });
} else {
channel.setMessageHandler(null);
}
}
}
}
{
"module": {
"name": "entry",
"type": "entry",
"description": "$string:module_desc",
"mainElement": "EntryAbility",
"deviceTypes": [
"phone"
],
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:main_pages",
"abilities": [
{
"name": "EntryAbility",
"srcEntry": "./ets/entryability/EntryAbility.ets",
"description": "$string:EntryAbility_desc",
"icon": "$media:icon",
"label": "$string:EntryAbility_label",
"startWindowIcon": "$media:icon",
"startWindowBackground": "$color:start_window_background",
"exported": true,
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
]
}
],
"requestPermissions": [
{"name" : "ohos.permission.INTERNET"},
]
}
}
\ No newline at end of file
{
"color": [
{
"name": "start_window_background",
"value": "#FFFFFF"
}
]
}
\ No newline at end of file
{
"string": [
{
"name": "module_desc",
"value": "module description"
},
{
"name": "EntryAbility_desc",
"value": "description"
},
{
"name": "EntryAbility_label",
"value": "doublefeel_flutter"
}
]
}
\ No newline at end of file
{
"string": [
{
"name": "enable_impeller",
"value": "true"
}
]
}
\ No newline at end of file
{
"SWITCH": 1,
"TRANSLATE": [
{
"serial_number": 1,
"min": 800,
"max": -1,
"preferred_fps": 90
},
{
"serial_number": 2,
"min": 77,
"max": 800,
"preferred_fps": 120
},
{
"serial_number": 3,
"min": 46,
"max": 77,
"preferred_fps": 90
},
{
"serial_number": 4,
"min": 10,
"max": 46,
"preferred_fps": 72
},
{
"serial_number": 5,
"min": 0,
"max": 10,
"preferred_fps": 60
}
],
"SCALE": [],
"ROTATION": []
}
\ No newline at end of file
{
"string": [
{
"name": "module_desc",
"value": "module description"
},
{
"name": "EntryAbility_desc",
"value": "description"
},
{
"name": "EntryAbility_label",
"value": "doublefeel_flutter"
}
]
}
\ No newline at end of file
{
"string": [
{
"name": "enable_impeller",
"value": "true"
}
]
}
\ No newline at end of file
{
"SWITCH": 1,
"TRANSLATE": [
{
"serial_number": 1,
"min": 800,
"max": -1,
"preferred_fps": 90
},
{
"serial_number": 2,
"min": 77,
"max": 800,
"preferred_fps": 120
},
{
"serial_number": 3,
"min": 46,
"max": 77,
"preferred_fps": 90
},
{
"serial_number": 4,
"min": 10,
"max": 46,
"preferred_fps": 72
},
{
"serial_number": 5,
"min": 0,
"max": 10,
"preferred_fps": 60
}
],
"SCALE": [],
"ROTATION": []
}
\ No newline at end of file
{
"string": [
{
"name": "module_desc",
"value": "模块描述"
},
{
"name": "EntryAbility_desc",
"value": "description"
},
{
"name": "EntryAbility_label",
"value": "doublefeel_flutter"
}
]
}
\ No newline at end of file
import hilog from '@ohos.hilog';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
export default function abilityTest() {
describe('ActsAbilityTest', function () {
// Defines a test suite. Two parameters are supported: test suite name and test suite function.
beforeAll(function () {
// Presets an action, which is performed only once before all test cases of the test suite start.
// This API supports only one parameter: preset action function.
})
beforeEach(function () {
// Presets an action, which is performed before each unit test case starts.
// The number of execution times is the same as the number of test cases defined by **it**.
// This API supports only one parameter: preset action function.
})
afterEach(function () {
// Presets a clear action, which is performed after each unit test case ends.
// The number of execution times is the same as the number of test cases defined by **it**.
// This API supports only one parameter: clear action function.
})
afterAll(function () {
// Presets a clear action, which is performed after all test cases of the test suite end.
// This API supports only one parameter: clear action function.
})
it('assertContain',0, function () {
// Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
hilog.info(0x0000, 'testTag', '%{public}s', 'it begin');
let a = 'abc'
let b = 'b'
// Defines a variety of assertion methods, which are used to declare expected boolean conditions.
expect(a).assertContain(b)
expect(a).assertEqual(a)
})
})
}
\ No newline at end of file
import abilityTest from './Ability.test'
export default function testsuite() {
abilityTest()
}
\ No newline at end of file
import UIAbility from '@ohos.app.ability.UIAbility';
import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry';
import hilog from '@ohos.hilog';
import { Hypium } from '@ohos/hypium';
import testsuite from '../test/List.test';
import window from '@ohos.window';
export default class TestAbility extends UIAbility {
onCreate(want, launchParam) {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate');
hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? '');
hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:'+ JSON.stringify(launchParam) ?? '');
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!');
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
onDestroy() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy');
}
onWindowStageCreate(windowStage: window.WindowStage) {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate');
windowStage.loadContent('testability/pages/Index', (err, data) => {
if (err.code) {
hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? '');
return;
}
hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s',
JSON.stringify(data) ?? '');
});
}
onWindowStageDestroy() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy');
}
onForeground() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground');
}
onBackground() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground');
}
}
\ No newline at end of file
import hilog from '@ohos.hilog';
@Entry
@Component
struct Index {
aboutToAppear() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility index aboutToAppear');
}
@State message: string = 'Hello World'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('35%')
.height('5%')
.onClick(()=>{
})
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
import hilog from '@ohos.hilog';
import TestRunner from '@ohos.application.testRunner';
import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry';
var abilityDelegator = undefined
var abilityDelegatorArguments = undefined
async function onAbilityCreateCallback() {
hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback');
}
async function addAbilityMonitorCallback(err: any) {
hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? '');
}
export default class OpenHarmonyTestRunner implements TestRunner {
constructor() {
}
onPrepare() {
hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare ');
}
async onRun() {
hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run');
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility'
let lMonitor = {
abilityName: testAbilityName,
onAbilityCreate: onAbilityCreateCallback,
};
abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback)
var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName
var debug = abilityDelegatorArguments.parameters['-D']
if (debug == 'true')
{
cmd += ' -D'
}
hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd);
abilityDelegator.executeShellCommand(cmd,
(err: any, d: any) => {
hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? '');
hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? '');
hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? '');
})
hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end');
}
}
\ No newline at end of file
{
"module": {
"name": "entry_test",
"type": "feature",
"description": "$string:module_test_desc",
"mainElement": "TestAbility",
"deviceTypes": [
"phone"
],
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:test_pages",
"abilities": [
{
"name": "TestAbility",
"srcEntry": "./ets/testability/TestAbility.ets",
"description": "$string:TestAbility_desc",
"icon": "$media:icon",
"label": "$string:TestAbility_label",
"exported": true,
"startWindowIcon": "$media:icon",
"startWindowBackground": "$color:start_window_background",
"skills": [
{
"actions": [
"action.system.home"
],
"entities": [
"entity.system.home"
]
}
]
}
]
}
}
{
"color": [
{
"name": "start_window_background",
"value": "#FFFFFF"
}
]
}
\ No newline at end of file
{
"string": [
{
"name": "module_test_desc",
"value": "test ability description"
},
{
"name": "TestAbility_desc",
"value": "the test ability"
},
{
"name": "TestAbility_label",
"value": "test label"
}
]
}
\ No newline at end of file
{
"modelVersion": "5.0.0",
"dependencies": {
}
}
\ No newline at end of file
import path from 'path'
import { injectNativeModules } from 'flutter-hvigor-plugin';
injectNativeModules(__dirname, path.dirname(__dirname))
\ No newline at end of file
import path from 'path'
import { appTasks } from '@ohos/hvigor-ohos-plugin';
import { flutterHvigorPlugin } from 'flutter-hvigor-plugin';
export default {
system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
plugins:[flutterHvigorPlugin(path.dirname(__dirname))] /* Custom plugin to extend the functionality of Hvigor. */
}
\ No newline at end of file
{
"modelVersion": "5.0.0",
"name": "doublefeel_flutter",
"version": "1.0.0",
"description": "Please describe the basic information.",
"main": "",
"author": "",
"license": "",
"dependencies": {},
"devDependencies": {
"@ohos/hypium": "1.0.6"
}
}
... ... @@ -133,10 +133,10 @@ packages:
dependency: transitive
description:
name: characters
sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
url: "https://pub.dev"
source: hosted
version: "1.4.0"
version: "1.3.0"
checked_yaml:
dependency: transitive
description:
... ... @@ -149,10 +149,10 @@ packages:
dependency: transitive
description:
name: clock
sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
url: "https://pub.dev"
source: hosted
version: "1.1.2"
version: "1.1.1"
code_builder:
dependency: transitive
description:
... ... @@ -165,10 +165,10 @@ packages:
dependency: transitive
description:
name: collection
sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf
url: "https://pub.dev"
source: hosted
version: "1.19.1"
version: "1.19.0"
convert:
dependency: transitive
description:
... ... @@ -237,10 +237,10 @@ packages:
dependency: transitive
description:
name: fake_async
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
url: "https://pub.dev"
source: hosted
version: "1.3.3"
version: "1.3.1"
ffi:
dependency: transitive
description:
... ... @@ -426,7 +426,7 @@ packages:
dependency: transitive
description:
path: image_cropper_for_web
ref: "65c2c99891882ea59732959a672f3d5993a837bb"
ref: "br_v9.1.0_ohos"
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: "65c2c99891882ea59732959a672f3d5993a837bb"
ref: "br_v9.1.0_ohos"
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: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5"
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
url: "https://pub.dev"
source: hosted
version: "0.20.2"
version: "0.19.0"
io:
dependency: transitive
description:
... ... @@ -549,26 +549,26 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de"
sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06"
url: "https://pub.dev"
source: hosted
version: "11.0.2"
version: "10.0.7"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1"
sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379"
url: "https://pub.dev"
source: hosted
version: "3.0.10"
version: "3.0.8"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1"
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
url: "https://pub.dev"
source: hosted
version: "3.0.2"
version: "3.0.1"
lints:
dependency: transitive
description:
... ... @@ -597,10 +597,10 @@ packages:
dependency: transitive
description:
name: matcher
sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
url: "https://pub.dev"
source: hosted
version: "0.12.17"
version: "0.12.16+1"
material_color_utilities:
dependency: transitive
description:
... ... @@ -613,10 +613,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
url: "https://pub.dev"
source: hosted
version: "1.17.0"
version: "1.15.0"
mime:
dependency: transitive
description:
... ... @@ -645,10 +645,10 @@ packages:
dependency: transitive
description:
name: path
sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
url: "https://pub.dev"
source: hosted
version: "1.9.1"
version: "1.9.0"
path_provider:
dependency: transitive
description:
... ... @@ -966,18 +966,18 @@ packages:
dependency: transitive
description:
name: stack_trace
sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1"
sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377"
url: "https://pub.dev"
source: hosted
version: "1.12.1"
version: "1.12.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d"
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
url: "https://pub.dev"
source: hosted
version: "2.1.4"
version: "2.1.2"
stream_transform:
dependency: transitive
description:
... ... @@ -1006,10 +1006,10 @@ packages:
dependency: "direct main"
description:
name: table_calendar
sha256: "0c0c6219878b363a2d5f40c7afb159d845f253d061dc3c822aa0d5fe0f721982"
sha256: b2896b7c86adf3a4d9c911d860120fe3dbe03c85db43b22fd61f14ee78cdbb63
url: "https://pub.dev"
source: hosted
version: "3.2.0"
version: "3.1.3"
term_glyph:
dependency: transitive
description:
... ... @@ -1022,10 +1022,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c"
url: "https://pub.dev"
source: hosted
version: "0.7.7"
version: "0.7.3"
timing:
dependency: transitive
description:
... ... @@ -1054,10 +1054,10 @@ packages:
dependency: transitive
description:
name: vector_math
sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
url: "https://pub.dev"
source: hosted
version: "2.2.0"
version: "2.1.4"
vm_service:
dependency: transitive
description:
... ... @@ -1111,8 +1111,8 @@ packages:
dependency: transitive
description:
path: "packages/webview_flutter/webview_flutter_android"
ref: de942e79c9057b32ad31106508bd87c0d60aef83
resolved-ref: de942e79c9057b32ad31106508bd87c0d60aef83
ref: "br_webview_flutter-v4.13.0_ohos"
resolved-ref: "8d70938aa190eb7d7cd4d66f0d16fddb3c2d03ba"
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: de942e79c9057b32ad31106508bd87c0d60aef83
resolved-ref: de942e79c9057b32ad31106508bd87c0d60aef83
ref: "br_webview_flutter-v4.13.0_ohos"
resolved-ref: "8d70938aa190eb7d7cd4d66f0d16fddb3c2d03ba"
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: de942e79c9057b32ad31106508bd87c0d60aef83
resolved-ref: de942e79c9057b32ad31106508bd87c0d60aef83
ref: "br_webview_flutter-v4.13.0_ohos"
resolved-ref: "8d70938aa190eb7d7cd4d66f0d16fddb3c2d03ba"
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: de942e79c9057b32ad31106508bd87c0d60aef83
resolved-ref: de942e79c9057b32ad31106508bd87c0d60aef83
ref: "br_webview_flutter-v4.13.0_ohos"
resolved-ref: "8d70938aa190eb7d7cd4d66f0d16fddb3c2d03ba"
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.8.0-0 <4.0.0"
dart: ">=3.6.2 <4.0.0"
flutter: ">=3.27.0"
... ...
... ... @@ -42,7 +42,7 @@ dependencies:
url: https://gitcode.com/openharmony-sig/flutter_permission_handler.git
path: permission_handler_ohos
ref: br_permission_handler_v11.3.1_ohos
intl: ^0.20.2
intl: ^0.19.0
flutter_localizations:
sdk: flutter
table_calendar: ^3.1.3
... ...