From bfda68222d21cc5723c1f7971aacef8b5deb7b30 Mon Sep 17 00:00:00 2001 From: zhoujiaying Date: Thu, 16 Nov 2023 15:17:33 +0800 Subject: [PATCH 1/2] =?UTF-8?q?webview=5Fflutter=20=E5=BC=80=E5=8F=91?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0dynamicView=E7=B1=BB=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/ets/view/DynamicView/DynamicUtils.ets | 13 +++++++++++++ .../ets/view/DynamicView/dynamicViewJson.ets | 16 ++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 shell/platform/ohos/flutter_embedding/flutter/src/main/ets/view/DynamicView/DynamicUtils.ets diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/view/DynamicView/DynamicUtils.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/view/DynamicView/DynamicUtils.ets new file mode 100644 index 0000000000..ef6bb647fb --- /dev/null +++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/view/DynamicView/DynamicUtils.ets @@ -0,0 +1,13 @@ +import { DVModelParameters } from './dynamicView'; + +export class DynamicUtils { + static getParams(params: DVModelParameters, element: string): string | ESObject { + let params2 = params as Record; + return params2[element]; + } + + static setParams(params: DVModelParameters, key: string, element: ESObject): void { + let params2 = params as Record; + params2[key] = element; + } +} diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/view/DynamicView/dynamicViewJson.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/view/DynamicView/dynamicViewJson.ets index 40b05299e8..fc0a1e01cc 100644 --- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/view/DynamicView/dynamicViewJson.ets +++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/view/DynamicView/dynamicViewJson.ets @@ -66,3 +66,19 @@ export function createDVModelFromJson(json: Object): DVModel { jsonObject["build"] ); } + +export class DVModelJson { + compType: string + children: Array + attributes: ESObject + events: ESObject + build: ESObject + + constructor(compType: string, children: Array, attributes: ESObject, events: ESObject, build?: ESObject) { + this.compType = compType + this.children = children + this.attributes = attributes + this.events = events; + this.build = build; + } +} \ No newline at end of file -- Gitee From 89801da0c87484a45ab4c93f921d3daf98180f04 Mon Sep 17 00:00:00 2001 From: zhoujiaying Date: Thu, 16 Nov 2023 15:17:33 +0800 Subject: [PATCH 2/2] =?UTF-8?q?webview=5Fflutter=20=E5=BC=80=E5=8F=91?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0dynamicView=E7=B1=BB=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhoujiaying --- .../main/ets/view/DynamicView/DynamicUtils.ets | 13 +++++++++++++ .../ets/view/DynamicView/dynamicViewJson.ets | 16 ++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 shell/platform/ohos/flutter_embedding/flutter/src/main/ets/view/DynamicView/DynamicUtils.ets diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/view/DynamicView/DynamicUtils.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/view/DynamicView/DynamicUtils.ets new file mode 100644 index 0000000000..ef6bb647fb --- /dev/null +++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/view/DynamicView/DynamicUtils.ets @@ -0,0 +1,13 @@ +import { DVModelParameters } from './dynamicView'; + +export class DynamicUtils { + static getParams(params: DVModelParameters, element: string): string | ESObject { + let params2 = params as Record; + return params2[element]; + } + + static setParams(params: DVModelParameters, key: string, element: ESObject): void { + let params2 = params as Record; + params2[key] = element; + } +} diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/view/DynamicView/dynamicViewJson.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/view/DynamicView/dynamicViewJson.ets index 40b05299e8..fc0a1e01cc 100644 --- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/view/DynamicView/dynamicViewJson.ets +++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/view/DynamicView/dynamicViewJson.ets @@ -66,3 +66,19 @@ export function createDVModelFromJson(json: Object): DVModel { jsonObject["build"] ); } + +export class DVModelJson { + compType: string + children: Array + attributes: ESObject + events: ESObject + build: ESObject + + constructor(compType: string, children: Array, attributes: ESObject, events: ESObject, build?: ESObject) { + this.compType = compType + this.children = children + this.attributes = attributes + this.events = events; + this.build = build; + } +} \ No newline at end of file -- Gitee