flutter_samples:基于 OpenHarmony 生态的 Flutter 开发示例项目

开发者可通过本项目快速了解 OpenHarmony Flutter 开发流程,参考示例实现细节进行实践与验证。项目提供 OpenHarmony 平台适配示例及配套文档,覆盖应用开发、平台能力接入与工程实践,包含音乐播放器、智慧农场等场景化案例。【此简介由AI生成】

Branch5Tags8
FilesLast commitLast update
add cpf-manager to developer Signed-off-by: HHHxm2 <huangxingming2@huawei.com> 1 month ago
Bump actions/checkout from 3.5.3 to 3.6.0 (#1993) 2 years ago
修改add_to_app的plugin用到的url相关配置及yaml配置 Signed-off-by: lx123546879 <511859501@qq.com> 4 months ago
init ohos in add_to_app/multiple_flutters Signed-off-by: hezhengyi <ssyzesb@qq.com> 2 years ago
Update for 3.13 stable (#1992) 2 years ago
新增animations的ohos适配 Signed-off-by: xiaolieask <760956257@qq.com> 9 months ago
将流水线门禁扫描错的oat报错屏蔽掉 Signed-off-by: qq_77777 <qishijie3@h-partners.com> 2 months ago
Bump uuid from 3.0.7 to 4.0.0 in /background_isolate_channels (#2001) 2 years ago
新增code_sharing ohos Signed-off-by: weixin_46147069 <501436674@qq.com> 9 months ago
将流水线门禁扫描错的oat报错屏蔽掉 Signed-off-by: qq_77777 <qishijie3@h-partners.com> 2 months ago
将流水线门禁扫描错的oat报错屏蔽掉 Signed-off-by: qq_77777 <qishijie3@h-partners.com> 2 months ago
添加deeplink_store_example的ohos平台 Signed-off-by: cjand <1747143535@qq.com> 9 months ago
Bump uuid from 3.0.7 to 4.0.0 in /desktop_photo_search/material (#2003) 2 years ago
异步编程方案剖析 Signed-off-by: SimpleLove520 <1960997571@qq.com> 1 year ago
[experimental/pedometer] Update jni and jnigen to 0.6 (#2006) 2 years ago
Update for 3.13 stable (#1992) 2 years ago
!182 fix:刪除冗余文件 Merge pull request !182 from asklie/master1 year ago
!182 fix:刪除冗余文件 Merge pull request !182 from asklie/master1 year ago
form_app add support for ohos Signed-off-by: liujiake <liujiake999@163.com> 9 months ago
Fix crashlytics in game_template (#1998) 2 years ago
Update for 3.13 stable (#1992) 2 years ago
添加infinite_list的ohos适配 Signed-off-by: qq_77777 <qishijie3@h-partners.com> 9 months ago
Update for 3.13 stable (#1992) 2 years ago
补充isolate鸿蒙端 Signed-off-by: gxzmf <zhongmingfeng@huawei.com> 11 months ago
新增jsonexample鸿蒙工程适配 Signed-off-by: gxzmf <zhongmingfeng@huawei.com> 7 months ago
更改依赖格式 Signed-off-by: lwx0221 <741744990@qq.com> 9 months ago
添加navigation_and_routing的ohos适配 Signed-off-by: qq_77777 <qishijie3@h-partners.com> 9 months ago
Update for 3.13 stable (#1992) 2 years ago
!359 merge new into master 基于软解码的OpenGL渲染demo Created-by: zhong_ning Commit-by: zhong_ning Merged-by: openharmony_ci Description: https://gitcode.com/openharmony-tpc/flutter_samples/issues/335 Register with TextureRegistry to obtain SurfaceTextureEntry, and use SurfaceId to render the video; When the player judges it as hard decoding, Texture can render normally; When the player determines that it is a soft solution (using open-source ffmpeg), it outputs the off screen data of Open GL and finds that the image cannot be successfully rendered (black screen with sound). There may be a problem with the demo, so a demo is provided ## Pre-launch Checklist - [ ] I read the [Flutter Style Guide] _recently_, and have followed its advice. - [ ] I signed the [CLA]. - [ ] I read the [Contributors Guide]. - [ ] I updated/added relevant documentation (doc comments with ///). - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-devrel channel on [Discord]. <!-- Links --> [Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo [CLA]: https://cla.developers.google.com/ [Discord]: https://github.com/flutter/flutter/wiki/Chat [Contributors Guide]: https://github.com/flutter/samples/blob/main/CONTRIBUTING.md See merge request: openharmony-tpc/flutter_samples!3592 days ago
Bump uuid from 3.0.7 to 4.0.0 in /place_tracker (#2002) Bumps [uuid](https://github.com/Daegalus/dart-uuid) from 3.0.7 to 4.0.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/Daegalus/dart-uuid/releases">uuid's releases</a>.</em></p> <blockquote> <h2>4.0.0</h2> <h2>What's Changed</h2> <ul> <li>Provide constants for RFC4122 namespaces in UuidValue by <a href="https://github.com/SpencerC"><code>@​SpencerC</code></a> in <a href="https://redirect.github.com/daegalus/dart-uuid/pull/85">daegalus/dart-uuid#85</a></li> <li>Fix classes to be properly const by <a href="https://github.com/daegalus"><code>@​daegalus</code></a> in <a href="https://redirect.github.com/daegalus/dart-uuid/pull/88">daegalus/dart-uuid#88</a></li> <li>Fix <a href="https://redirect.github.com/Daegalus/dart-uuid/issues/89">#89</a> v7: Uint64List not supported by dart2js. and v6: Uint64 accessor not supported by dart2js. by <a href="https://github.com/hambergerpls"><code>@​hambergerpls</code></a> in <a href="https://redirect.github.com/daegalus/dart-uuid/pull/90">daegalus/dart-uuid#90</a></li> <li>check the length of the Uint8list returned by the custom RNG by <a href="https://github.com/wph144"><code>@​wph144</code></a> in <a href="https://redirect.github.com/daegalus/dart-uuid/pull/91">daegalus/dart-uuid#91</a></li> <li>toBytes no longer validates by <a href="https://github.com/Erhannis"><code>@​Erhannis</code></a> in <a href="https://redirect.github.com/daegalus/dart-uuid/pull/92">daegalus/dart-uuid#92</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/SpencerC"><code>@​SpencerC</code></a> made their first contribution in <a href="https://redirect.github.com/daegalus/dart-uuid/pull/85">daegalus/dart-uuid#85</a></li> <li><a href="https://github.com/hambergerpls"><code>@​hambergerpls</code></a> made their first contribution in <a href="https://redirect.github.com/daegalus/dart-uuid/pull/90">daegalus/dart-uuid#90</a></li> <li><a href="https://github.com/wph144"><code>@​wph144</code></a> made their first contribution in <a href="https://redirect.github.com/daegalus/dart-uuid/pull/91">daegalus/dart-uuid#91</a></li> <li><a href="https://github.com/Erhannis"><code>@​Erhannis</code></a> made their first contribution in <a href="https://redirect.github.com/daegalus/dart-uuid/pull/92">daegalus/dart-uuid#92</a></li> </ul> <h2>All changes since v3.0.7</h2> <h3>v4.0.0</h3> <ul> <li>toBytes on UuidValue now does not validate by default, but has the option <code>validate</code> that can be set to true if you need validation when calling it. (Thanks <a href="https://github.com/Erhannis"><code>@​Erhannis</code></a>)</li> </ul> <h3>v4.0.0-beta3-1</h3> <ul> <li>Ensure that any custom RNG implementation produces Uint8Lists of length 16. (Thanks <a href="https://github.com/wph144"><code>@​wph144</code></a>)</li> </ul> <h3>v4.0.0-beta3</h3> <ul> <li><strong>[BREAKING CHANGE]</strong> Replacing UuidUtil rng functions with RNG classes. <ul> <li>UuidUtil.mathRNG() is replaced with MathRNG().generate().</li> <li>UuidUtil.cryptoRNG() is replaced with CryptoRNG().generate().</li> <li>Custom crypto implementations just need to implement the <code>RNG</code> abstract class.</li> <li>namedArgs and positionalArgs have been removed from GlobalOptions</li> <li>You may use LegacyRNG() if you need to use the old function style RNG.</li> </ul> </li> <li>Fix a bug with the usage of Uint64List in Dart2js by not using it. (Thanks <a href="https://github.com/hambergerpls"><code>@​hambergerpls</code></a>)</li> </ul> <h3>v4.0.0-beta2</h3> <ul> <li><strong>[BREAKING CHANGE]</strong> The <code>Uuid</code> class now takes a <code>GlobalOptions</code> class instead of a <code>Map&lt;String, dynamic&gt;</code>.</li> <li>Added options classes to eventually replace the Map parameter.</li> <li><strong>[BREAKING CHANGE]</strong> Since v6,v7,v8 are new for 4.0, I have made it so they only take the new options class.</li> <li>Reworked the constructors, and moved state out of the classes. Const is now supported properly again</li> <li>Switched tests to use const Uuid to catch regressions.</li> <li>Set the <code>options</code> parameter in v1, v4, and v5 to deprecated.</li> <li><strong>[BREAKING CHANGE]</strong> Make UuidValue properly const also <ul> <li>Can no longer run validation on the const variant.</li> <li>Added UuidValue.withValidation() to handle this usecase, it can't be const.</li> <li>If you need const and validation. Create the UuidValue with the UUID, then call the <code>validate()</code> function on it.</li> </ul> </li> </ul> <h3>v4.0.0-beta1-1</h3> <ul> <li>Mostly cleanup, linting, updating depedencies, etc.</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/daegalus/dart-uuid/blob/main/CHANGELOG.md">uuid's changelog</a>.</em></p> <blockquote> <p>v4.0.0</p> <ul> <li>toBytes on UuidValue now does not validate by default, but has the option <code>validate</code> that can be set to true if you need validation when calling it. (Thanks <a href="https://github.com/Erhannis"><code>@​Erhannis</code></a>)</li> </ul> <p>v4.0.0-beta3-1</p> <ul> <li>Ensure that any custom RNG implementation produces Uint8Lists of length 16. (Thanks <a href="https://github.com/wph44"><code>@​wph44</code></a>)</li> </ul> <p>v4.0.0-beta3</p> <ul> <li><strong>[BREAKING CHANGE]</strong> Replacing UuidUtil rng functions with RNG classes. <ul> <li>UuidUtil.mathRNG() is replaced with MathRNG().generate().</li> <li>UuidUtil.cryptoRNG() is replaced with CryptoRNG().generate().</li> <li>Custom crypto implementations just need to implement the <code>RNG</code> abstract class.</li> <li>namedArgs and positionalArgs have been removed from GlobalOptions</li> <li>You may use LegacyRNG() if you need to use the old function style RNG.</li> </ul> </li> <li>Fix a bug with the usage of Uint64List in Dart2js by not using it. (Thanks <a href="https://github.com/hambergerpls"><code>@​hambergerpls</code></a>)</li> </ul> <p>v4.0.0-beta2</p> <ul> <li><strong>[BREAKING CHANGE]</strong> The <code>Uuid</code> class now takes a <code>GlobalOptions</code> class instead of a <code>Map&lt;String, dynamic&gt;</code>.</li> <li>Added options classes to eventually replace the Map parameter.</li> <li><strong>[BREAKING CHANGE]</strong> Since v6,v7,v8 are new for 4.0, I have made it so they only take the new options class.</li> <li>Reworked the constructors, and moved state out of the classes. Const is now supported properly again</li> <li>Switched tests to use const Uuid to catch regressions.</li> <li>Set the <code>options</code> parameter in v1, v4, and v5 to deprecated.</li> <li><strong>[BREAKING CHANGE]</strong> Make UuidValue properly const also <ul> <li>Can no longer run validation on the const variant.</li> <li>Added UuidValue.withValidation() to handle this usecase, it can't be const.</li> <li>If you need const and validation. Create the UuidValue with the UUID, then call the <code>validate()</code> function on it.</li> </ul> </li> </ul> <p>v4.0.0-beta1-1</p> <ul> <li>Mostly cleanup, linting, updating depedencies, etc.</li> </ul> <p>v4.0.0-beta1</p> <ul> <li>Break up versions into individual objects that can be used standalone.</li> <li>No more colliding global states between versions</li> <li>Added UUID v6, v7, v8 from the new RFC.</li> <li>Add <code>time</code>, <code>version</code>, and <code>variant</code> functions to UuidValue</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/daegalus/dart-uuid/commit/e67b968010d9677dc5d470c020b151f4d0f78cb1"><code>e67b968</code></a> Fix SDK constraints</li> <li><a href="https://github.com/daegalus/dart-uuid/commit/13da889a557436e1ce4b5609676a9242af8dc32c"><code>13da889</code></a> Update docs</li> <li><a href="https://github.com/daegalus/dart-uuid/commit/8b0ada22b8e0c499ea3907722077ddfae83d39f3"><code>8b0ada2</code></a> Prep for 4.0.0 release</li> <li><a href="https://github.com/daegalus/dart-uuid/commit/3416381ba2cdd3f9844ecfcf2193a73e7d9038ab"><code>3416381</code></a> Added validate option to toBytes. Also ran dart format, because of git CI fail.</li> <li><a href="https://github.com/daegalus/dart-uuid/commit/8a49c149510ea58cf08dda72b371ffba93403e92"><code>8a49c14</code></a> Revert &quot;Made fromByteList and fromList match&quot; - turns out it wasn't</li> <li><a href="https://github.com/daegalus/dart-uuid/commit/c2dd58401429c576509668a3ff55ca2fbe7b58bd"><code>c2dd584</code></a> Made fromByteList and fromList match</li> <li><a href="https://github.com/daegalus/dart-uuid/commit/14cb91c44d544b4ec2b47a892fb5cab54db559d1"><code>14cb91c</code></a> toBytes no longer validates</li> <li><a href="https://github.com/daegalus/dart-uuid/commit/54ccdce893b09bb29f8ec6a6609a438183a5060d"><code>54ccdce</code></a> Cleanup and regenerate docs</li> <li><a href="https://github.com/daegalus/dart-uuid/commit/06e425a21dfb702607bab706eaff367853b89eed"><code>06e425a</code></a> Cleanup and version bump</li> <li><a href="https://github.com/daegalus/dart-uuid/commit/ca2bf53b329ba76934203e528f2cffe095f8df78"><code>ca2bf53</code></a> check the length of the Uint8list returned by the custom RNG</li> <li>Additional commits viewable in <a href="https://github.com/Daegalus/dart-uuid/compare/3.0.7...4.0.0">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=uuid&package-manager=pub&previous-version=3.0.7&new-version=4.0.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - @dependabot rebase will rebase this PR - @dependabot recreate will recreate this PR, overwriting any edits that have been made to it - @dependabot merge will merge this PR after your CI passes on it - @dependabot squash and merge will squash and merge this PR after your CI passes on it - @dependabot cancel merge will cancel a previously requested merge and block automerging - @dependabot reopen will reopen this PR if it is closed - @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency - @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Parker Lougheed <parlough@gmail.com>2 years ago
增加platform的example,列表数据删除后刷新页面 Signed-off-by: lx123546879 <511859501@qq.com> 9 months ago
将prop换成objectlink Signed-off-by: xiaolieask <760956257@qq.com> 4 months ago
提交platform_design的ohos适配 Signed-off-by: xiaolieask <760956257@qq.com> 9 months ago
Update for 3.13 stable (#1992) 2 years ago
添加provider_counter的ohos平台 Signed-off-by: cjand <1747143535@qq.com> 9 months ago
新增provider_counter Signed-off-by: lwx0221 <741744990@qq.com> 9 months ago
simple_shader add support for ohos Signed-off-by: liujiake <liujiake999@163.com> 9 months ago
新增somplistic_calculator的ohos适配 Signed-off-by: xiaolieask <760956257@qq.com> 9 months ago
simplistic_editor增加剪切板权限 Signed-off-by: weixin_46147069 <501436674@qq.com> 9 months ago
Update for 3.13 stable (#1992) 2 years ago
Update for 3.13 stable (#1992) 2 years ago
Update for 3.13 stable (#1992) 2 years ago
Update for 3.13 stable (#1992) 2 years ago
补充COMMITTERS和README.OpenSource,删除安全漏洞代码 Signed-off-by: huangxiaoyao <976125628@qq.com> 1 year ago
Add a .gitattributes file (#929) Automatically convert EOL to line feed to make Windows development of codelabs easier. Inspiration from https://github.com/flutter/flutter/blob/master/.gitattributes4 years ago
增加listence Signed-off-by: asklie <760956257@qq.com> 1 year ago
Add game_template (#1180) Adds a template / sample for games built in Flutter, with all the bells and whistles, like ads, in-app purchases, audio, main menu, settings, and so on. Co-authored-by: Parker Lougheed Co-authored-by: Shams Zakhour3 years ago
把flutter_samples仓库地址从openharmony-sig改为openharmony-tpc Signed-off-by: liujiake <liujiake999@163.com> 11 months ago
Cleanup a few repo docs (#1987) The MAINTENANCE.md file in particular hasn't been updated in 3 years.2 years ago
Adding Rally App to Flutter Samples (#135) 6 years ago
将流水线门禁扫描错的oat报错屏蔽掉 Signed-off-by: qq_77777 <qishijie3@h-partners.com> 2 months ago
Initial commit 7 years ago
修改OAT文件 Signed-off-by: huangxiaoyao <976125628@qq.com> 1 year ago
!356 merge master into master 新增 Impeller & Skia 渲染引擎切换指南 Created-by: wwyang09 Commit-by: wenwenyang Merged-by: openharmony_ci Description: 新增 Impeller & Skia 渲染引擎切换指南 See merge request: openharmony-tpc/flutter_samples!3563 days ago
!357 merge master into master chore: 仓库迁移公告 Created-by: xiedrsz Commit-by: 谢代荣 Merged-by: openharmony_ci Description: chore: 仓库迁移公告 See merge request: openharmony-tpc/flutter_samples!3573 days ago

Flutter Samples

仓库迁移公告:本仓库已从 openharmony-tpc 迁移至 CPF-Flutter 组织,新地址为 CPF-Flutter/flutter_samples。旧仓库将不再维护,请及时更新 Git 远程地址及依赖引用。详细迁移说明请查看 迁移公告

介绍

本仓库基于 Flutter 官方 samples 进行拓展,提供 OpenHarmony 平台适配示例及配套文档,覆盖应用开发、平台能力接入与工程实践。开发者可通过本仓库快速了解 OpenHarmony Flutter 开发流程,并参考示例实现细节进行实践与验证。

文档

框架介绍

架构介绍

环境搭建

功能开发

调试调测

性能调优

三方库接入

场景化案例

示例代码

FAQ

附录

示例

新增OpenHarmony平台示例:

仓库名 依赖路径 描述
flutter_music_player flutter_music_player 本示例展示了一个音乐播放器模型,具有自动播放、拖拽进度条等功能
flutter_smart_agriculture flutter_smart_agriculture 智慧农场
async_test ohos/async_test 异步调用demo
channel_demo ohos/channel_demo 通道测试demo,可查看EventChannel/MethodChannel/BasicMessageChannel方法的返回值
clock_test ohos/clock_test 计时器demo,可计时,查看历史计时记录和一些详细数据
dio_test ohos/dio_test 测试demo合集
event_bus_test ohos/event_bus_test 事件驱动demo
flutter_page_sample1 ohos/flutter_page_sample1 route路由页面跳转demo
flutter_page_sample2 ohos/flutter_page_sample2 FlutterEntry的使用示例
multiple_flutters_ohos add_to_app/multiple_flutters/multiple_flutters_ohos FlutterEngineGroup多引擎使用示例,可监听生命周期
flutter_svg_test ohos/flutter_svg_test svg图片demo
http_parser_test ohos/http_parser_test http解析demo
http_test ohos/http_test http网页请求 demo
logging_test ohos/logging_test 日志记录 demo
path_drawing_test ohos/path_drawing_test 路径绘制demo
pictures_provider_demo ohos/pictures_provider_demo 获取图片demo
platform_test ohos/platform_test 平台调用demo
platformchannel_demo ohos/platformchannel_demo 平台多项功能接口测试demo
rxdart_test ohos/rxdart_test rxdart demo,提供了一系列用于处理异步事件和数据流的工具
string_scanner_test ohos/string_scanner_test 字符扫描demo
testcamera ohos/testcamera 相机调用demo
testchat ohos/testchat 聊天场景demo
testpicture ohos/testpicture 图片展示demo
tuple_test ohos/tuple_test tuple demo,测试元组类型生产的参数
uuid_test ohos/uuid_test uuid demo
vector_math_test ohos/vector_math_test 向量匹配demo
localtion_demo ohos/localtion_demo 获取定位demo

快速开始

# 1. 克隆仓库
git clone https://gitcode.com/openharmony-tpc/flutter_samples.git

# 2. 进入示例目录
cd flutter_samples/ohos/animation_demo

# 3. 运行
flutter run

问题交流

Introduction

开发者可通过本项目快速了解 OpenHarmony Flutter 开发流程,参考示例实现细节进行实践与验证。项目提供 OpenHarmony 平台适配示例及配套文档,覆盖应用开发、平台能力接入与工程实践,包含音乐播放器、智慧农场等场景化案例。【此简介由AI生成】

Customize my domain

Downloads

0

Total downloads (including clone, pull, ZIP & release downloads), updated by T+1.

Languages

Dart71.52%
ArkTS7%
C6.33%
C++5.5%
CMake4.13%