diff --git a/packages/flutter_tools/templates/app_shared/ohos.tmpl/entry/src/main/ets/entryability/EntryAbility.ets.tmpl b/packages/flutter_tools/templates/app_shared/ohos.tmpl/entry/src/main/ets/entryability/EntryAbility.ets.tmpl index e409e57ec4b40b6d3eb073b38bf909f268f4628e..e4b95b43797af4425182bcd15654061d26c8baf6 100644 --- a/packages/flutter_tools/templates/app_shared/ohos.tmpl/entry/src/main/ets/entryability/EntryAbility.ets.tmpl +++ b/packages/flutter_tools/templates/app_shared/ohos.tmpl/entry/src/main/ets/entryability/EntryAbility.ets.tmpl @@ -17,10 +17,11 @@ import { FlutterAbility } from '@ohos/flutter_ohos' import { FlutterPlugin } from '@ohos/flutter_ohos/src/main/ets/embedding/engine/plugins/FlutterPlugin'; import { GeneratedPluginRegistrant } from '../plugins/GeneratedPluginRegistrant'; import List from '@ohos.util.List'; +import FlutterEngine from '@ohos/flutter_ohos/src/main/ets/embedding/engine/FlutterEngine'; export default class EntryAbility extends FlutterAbility { - onFlutterEngineReady(): void { - super.onFlutterEngineReady() + configureFlutterEngine(flutterEngine: FlutterEngine) { + super.configureFlutterEngine(flutterEngine) let plugins = GeneratedPluginRegistrant.getPlugins() as List; plugins.forEach((plugin) => { this.addPlugin(plugin); diff --git a/packages/flutter_tools/templates/app_shared/ohos.tmpl/entry/src/main/ets/pages/Index.ets.tmpl b/packages/flutter_tools/templates/app_shared/ohos.tmpl/entry/src/main/ets/pages/Index.ets.tmpl index b53a20c437e96d195487b281e5e95402ea6cb97d..73ddd67b96ccfc8bc85f30d2106dabab46876527 100644 --- a/packages/flutter_tools/templates/app_shared/ohos.tmpl/entry/src/main/ets/pages/Index.ets.tmpl +++ b/packages/flutter_tools/templates/app_shared/ohos.tmpl/entry/src/main/ets/pages/Index.ets.tmpl @@ -13,24 +13,18 @@ * limitations under the License. */ -import common from '@ohos.app.ability.common'; import { FlutterPage } from '@ohos/flutter_ohos' -const EVENT_BACK_PRESS = 'EVENT_BACK_PRESS' +let storage = LocalStorage.getShared() -@Entry +@Entry(storage) @Component struct Index { - private context = getContext(this) as common.UIAbilityContext + @LocalStorageLink('viewId') viewId: string = ""; build() { Column() { - FlutterPage() + FlutterPage({ viewId: this.viewId }) } } - - onBackPress(): boolean { - this.context.eventHub.emit(EVENT_BACK_PRESS) - return true - } } \ No newline at end of file diff --git a/packages/flutter_tools/templates/app_shared/ohos.tmpl/har/har_product.tmpl/flutter_embedding.har.debug.10 b/packages/flutter_tools/templates/app_shared/ohos.tmpl/har/har_product.tmpl/flutter_embedding.har.debug.10 index ac5e1554a6e710afb934359d92b39390f3460522..1959e07f1073b346362884aa240cde6ea950ce93 100644 Binary files a/packages/flutter_tools/templates/app_shared/ohos.tmpl/har/har_product.tmpl/flutter_embedding.har.debug.10 and b/packages/flutter_tools/templates/app_shared/ohos.tmpl/har/har_product.tmpl/flutter_embedding.har.debug.10 differ diff --git a/packages/flutter_tools/templates/app_shared/ohos.tmpl/har/har_product.tmpl/flutter_embedding.har.debug.11 b/packages/flutter_tools/templates/app_shared/ohos.tmpl/har/har_product.tmpl/flutter_embedding.har.debug.11 index e3cbc8cc13d7485a0a7b57e05fa4543e3b5da7f9..8e10a36108e42367364a9d5b4fe01a83223247ab 100644 Binary files a/packages/flutter_tools/templates/app_shared/ohos.tmpl/har/har_product.tmpl/flutter_embedding.har.debug.11 and b/packages/flutter_tools/templates/app_shared/ohos.tmpl/har/har_product.tmpl/flutter_embedding.har.debug.11 differ diff --git a/packages/flutter_tools/templates/app_shared/ohos.tmpl/har/har_product.tmpl/flutter_embedding.har.profile.10 b/packages/flutter_tools/templates/app_shared/ohos.tmpl/har/har_product.tmpl/flutter_embedding.har.profile.10 index 90a11f4150de34147fb47832db4e1f7237d1cf1d..a35f5f0b7ea8550b43031a2334527344b5aed33c 100644 Binary files a/packages/flutter_tools/templates/app_shared/ohos.tmpl/har/har_product.tmpl/flutter_embedding.har.profile.10 and b/packages/flutter_tools/templates/app_shared/ohos.tmpl/har/har_product.tmpl/flutter_embedding.har.profile.10 differ diff --git a/packages/flutter_tools/templates/app_shared/ohos.tmpl/har/har_product.tmpl/flutter_embedding.har.profile.11 b/packages/flutter_tools/templates/app_shared/ohos.tmpl/har/har_product.tmpl/flutter_embedding.har.profile.11 index fde8b22348afaeec4ecba3fec542b501a4026286..b618d098195286d31d7dd0d981bc44b78580889c 100644 Binary files a/packages/flutter_tools/templates/app_shared/ohos.tmpl/har/har_product.tmpl/flutter_embedding.har.profile.11 and b/packages/flutter_tools/templates/app_shared/ohos.tmpl/har/har_product.tmpl/flutter_embedding.har.profile.11 differ diff --git a/packages/flutter_tools/templates/app_shared/ohos.tmpl/har/har_product.tmpl/flutter_embedding.har.release.10 b/packages/flutter_tools/templates/app_shared/ohos.tmpl/har/har_product.tmpl/flutter_embedding.har.release.10 index 4179a8a5075cdbe2fa33cdd3b7b0dd2450bf3c79..97e6971d7fde7406bdd509aaaf0fd0b8c266cd37 100644 Binary files a/packages/flutter_tools/templates/app_shared/ohos.tmpl/har/har_product.tmpl/flutter_embedding.har.release.10 and b/packages/flutter_tools/templates/app_shared/ohos.tmpl/har/har_product.tmpl/flutter_embedding.har.release.10 differ diff --git a/packages/flutter_tools/templates/app_shared/ohos.tmpl/har/har_product.tmpl/flutter_embedding.har.release.11 b/packages/flutter_tools/templates/app_shared/ohos.tmpl/har/har_product.tmpl/flutter_embedding.har.release.11 index 6b40ace030c992c358f86597e1c19179e705e642..573f82fcafed65789c34d2fc3c8526a58fb56b6d 100644 Binary files a/packages/flutter_tools/templates/app_shared/ohos.tmpl/har/har_product.tmpl/flutter_embedding.har.release.11 and b/packages/flutter_tools/templates/app_shared/ohos.tmpl/har/har_product.tmpl/flutter_embedding.har.release.11 differ diff --git a/packages/flutter_tools/templates/app_shared/ohos.tmpl/har/har_product.tmpl/libflutter.so.debug.10 b/packages/flutter_tools/templates/app_shared/ohos.tmpl/har/har_product.tmpl/libflutter.so.debug.10 index ef1523ad83ccb44b1a47e4b4f56c9e1395625007..6f933e0af0236a116809b5dd888111ab4f682f60 100755 Binary files a/packages/flutter_tools/templates/app_shared/ohos.tmpl/har/har_product.tmpl/libflutter.so.debug.10 and b/packages/flutter_tools/templates/app_shared/ohos.tmpl/har/har_product.tmpl/libflutter.so.debug.10 differ diff --git a/packages/flutter_tools/templates/app_shared/ohos.tmpl/har/har_product.tmpl/libflutter.so.profile.10 b/packages/flutter_tools/templates/app_shared/ohos.tmpl/har/har_product.tmpl/libflutter.so.profile.10 index ba59cbe52449dee4a6ef0822b7c70b3f79d9da60..c901ff33222fa75edbc4b163ce3be3ae7974a00c 100755 Binary files a/packages/flutter_tools/templates/app_shared/ohos.tmpl/har/har_product.tmpl/libflutter.so.profile.10 and b/packages/flutter_tools/templates/app_shared/ohos.tmpl/har/har_product.tmpl/libflutter.so.profile.10 differ diff --git a/packages/flutter_tools/templates/app_shared/ohos.tmpl/har/har_product.tmpl/libflutter.so.release.10 b/packages/flutter_tools/templates/app_shared/ohos.tmpl/har/har_product.tmpl/libflutter.so.release.10 index 620212999c7dc83e4f1875defcea6cc2ef36c880..1f3ae3b1be8e9323e7f3608f0bfd1bc1ff65c0d7 100755 Binary files a/packages/flutter_tools/templates/app_shared/ohos.tmpl/har/har_product.tmpl/libflutter.so.release.10 and b/packages/flutter_tools/templates/app_shared/ohos.tmpl/har/har_product.tmpl/libflutter.so.release.10 differ