# flutter_shared_preferences **Repository Path**: scenario-samples/flutter_shared_preferences ## Basic Information - **Project Name**: flutter_shared_preferences - **Description**: 【鸿蒙 Harmony Next 示例 代码】该Demo使用了三方库shared_preference, 介绍了入如何实现在ArkTS侧读取Dart侧设置的首选项值及注意事项。Demo 还使用了PlatformView实现同层渲染,方便展示效果 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-04-27 - **Last Updated**: 2025-08-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Flutter使用shared_preference ChangeLog:2025-04-18 ## 介绍: 该Demo使用了三方库shared_preference, 介绍了入如何实现在ArkTS侧读取Dart侧设置的首选项值及注意事项。Demo 还使用了PlatformView实现同层渲染,方便展示效果 ## 约束与限制: - IDE:DevEco Studio 5.0.4 Release - Flutter:3.22.0 ## 效果预览: ![demo.gif](Screenshots/demo.gif) ## 工程目录: ``` ohos/entry/src/main/ets/ |---entryability | |---EntryAbility.ets // 继承FlutterAbility |---pages | |---Index.ets // 自动生成,加载Flutter首页 | platformview | |---ButtonComponent.ets // 原生组件内容 | |---CustomFactory.ets // 原生组件工厂类 | |---CustomPlugin.ets // Flutter插件加载 | |---CustomView.ets // 原生组件渲染桥接 |---plugins | |---GeneratedPluginRegistrant.ets // 自动生成,加载Flutter插件 |---pages | |---index.ets // 工程入口页面 lib/ |---CustomOhosView.dart // Flutter侧引入原生组件同层渲染 |---main.dart // Flutter首页 ```