flutter_packages_camera_fix:基于 Flutter 生态的 OpenHarmony 平台插件兼容适配项目

开发者可在 Flutter 应用中无缝集成常用插件,通过最小化业务改动获得完整的 OpenHarmony 原生能力支持。项目基于 Flutter 官方插件库扩展,新增对 OpenHarmony 平台的兼容适配,提供多种已适配插件及使用示例。【此简介由AI生成】

Branch1Tags0
FilesLast commitLast update
3 years ago
10 months ago
10 months ago
8 months ago
3 years ago
3 years ago
3 years ago
4 years ago
9 years ago
3 years ago
6 years ago
3 years ago
3 years ago
1 year ago
3 years ago
5 years ago
1 year ago
1 year ago
1 year ago
1 year ago
8 months ago
8 months ago
3 years ago
3 years ago
3 years ago

Warehouse introduction

This repository is an extension of the Flutter community’s official plugin library ([flutter/packages](vscode-file://vscode-app/e:/Microsoft VS Code/resources/app/out/vs/code/electron-browser/workbench/workbench.html)), adding compatibility and adaptation for the OpenHarmony platform. With this repository, developers can seamlessly integrate commonly used plugins into Flutter applications and gain full support for OpenHarmony native capabilities with minimal business changes.

Getting Started

Before using the plugins from this repository, please ensure that you have completed the OpenHarmony environment setup for the Flutter SDK.

  • Environment Setup

    Refer to the documentation in the flutter_flutter repository under the section “Environment Configuration”.

  • Example Reference

    Visit the flutter_samples repository to find integration demo examples.

How to reference these libraries

1. Use of tool library pigeon

  1. Introduce the pigeon library and add new configuration to dev_dependencies in pubspec.yaml:
dev_dependencies:
 pigeon:
   git:
     url: "https://gitcode.com/openharmony-tpc/flutter_packages.git"
     path: "packages/pigeons"
  1. Run flutter pub get in the project root directory;

  2. Run flutter pub run pigeon in the project root directory --input <dart communication model file path> --arkts_out <arkts platform method code output file path, example./ohos/entry/src/main/ets/xxx.ets>

The template code for communication between Flutter and the OpenHarmony platform will be generated;

  1. For calling examples, refer to packages/pigeon/example/app/ohos/entry/src/main/ets/plugins/MessagePlugin.ets

2. Use of plug-in library

Take path_provider as an example:

  1. In the referenced project, add new dependencies configuration in pubspec.yaml:
dependencies:
   path_provider:
     git:
       url: "https://gitcode.com/openharmony-tpc/flutter_packages.git"
       path: "packages/path_provider/path_provider"
  1. Run flutter pub get in the project root directory; (ohos/entry/oh-package.json5 will automatically add related plug-in har dependencies)

  2. Call the path_provider related API in the business code, and it will run normally on the OpenHarmony platform.

Example: Add the path_provider library dependency that supports the OpenHarmony platform to a Flutter-compatible OpenHarmony project;

Reference examples: https://gitcode.com/openharmony-tpc/flutter_samples/tree/master/ohos/pictures_provider_demo.

OpenHarmony platform has compatible with third-party libraries and packages.

No Initial Warehouse Name 3.7 Recommended Version 3.22 Recommended Version 3.27 Recommended Version 3.35 Recommended Version Warehouse Name Is Compatible
1 pigeon 14.0.0 21.2.0 25.3.2 26.1.5 pigeon Yes
2 file_selector 1.0.1 1.0.3 1.0.3 1.0.3 file_selector Yes
3 image_picker 1.0.4 1.1.2 1.1.2 1.2.1 image_picker Yes
4 animations 2.0.8 2.0.8 2.0.11 2.0.11 animations Yes
5 url_launcher 6.1.11 6.3.0 6.3.1 6.3.2 url_launcher Yes
6 shared_preferences 2.2.2 2.3.2 2.5.3 2.5.4 shared_preferences Yes
7 path_provider 2.1.1 2.1.4 2.1.5 2.1.5 path_provider Yes
8 local_auth 2.1.6 2.3.0 2.3.0 3.0.0 local_auth Yes
9 camera 0.10.5+5 0.11.0+2 0.11.1 0.11.3 camera Yes
10 video_player 2.7.2 2.9.2 2.10.0 2.10.1 video_player Yes
11 webview_flutter 4.4.2 4.8.0 4.13.0 4.13.0 webview_flutter Yes
12 webview_flutter-v4.4.4 4.4.4 - - - webview_flutter-v4.4.4 Yes
13 in_app_purchase 3.1.11 3.2.0 3.2.3 3.2.3 in_app_purchase Yes
14 css_colors 1.1.3 1.1.3 1.1.3 1.1.3 css_colors No
15 espresso 0.3.0+6 0.3.0+6 0.3.0+6 0.3.0+6 espresso No
16 extension_google_sign_in_as_googleapis_auth 2.0.11 2.0.11 2.0.11 2.0.11 extension_google_sign_in_as_googleapis_auth No
17 flutter_adaptive_scaffold 0.1.4 0.1.4 0.1.4 0.1.4 flutter_adaptive_scaffold No
18 flutter_image 4.1.9 4.1.9 4.1.9 4.1.9 flutter_image No
19 flutter_lints 2.0.3 2.0.3 2.0.3 2.0.3 flutter_lints No
20 flutter_markdown 0.6.15 0.6.15 0.6.15 0.6.15 flutter_markdown No
21 flutter_migrate 0.1.0 0.1.0 0.1.0 0.1.0 flutter_migrate No
22 flutter_plugin_android_lifecycle 2.0.17 2.0.17 2.0.17 2.0.17 flutter_plugin_android_lifecycle No
23 flutter_template_images 4.2.1 4.2.1 4.2.1 4.2.1 flutter_template_images No
24 go_router 12.1.1 12.1.1 12.1.1 12.1.1 go_router No
25 go_router_builder 2.3.4 2.3.4 2.3.4 2.3.4 go_router_builder No
26 google_identity_services_web 0.2.2 0.2.2 0.2.2 0.2.2 google_identity_services_web No
27 google_maps_flutter 2.3.0 2.3.0 2.3.0 2.3.0 google_maps_flutter No
28 google_sign_in 6.1.6 6.1.6 6.1.6 6.1.6 google_sign_in No
29 ios_platform_images 0.2.3 0.2.3 0.2.3 0.2.3 ios_platform_images No
30 metrics_center 1.0.12 1.0.12 1.0.12 1.0.12 metrics_center No
31 multicast_dns 0.3.2+4 0.3.2+4 0.3.2+4 0.3.2+4 multicast_dns No
32 palette_generator 0.3.3+3 0.3.3+3 0.3.3+3 0.3.3+3 palette_generator No
33 pointer_interceptor 0.9.3+5 0.9.3+5 0.9.3+5 0.9.3+5 pointer_interceptor No
34 rfw 1.0.9 1.0.9 1.0.9 1.0.9 rfw No
35 standard_message_codec 0.0.1+4 0.0.1+4 0.0.1+4 0.0.1+4 standard_message_codec No
36 two_dimensional_scrollables - - - - two_dimensional_scrollables No
37 web_benchmarks 0.1.0+8 0.1.0+8 0.1.0+8 0.1.0+8 web_benchmarks No
38 webview_flutter_platform_interface 2.6.0 2.6.0 2.6.0 2.6.0 webview_flutter_platform_interface No
39 xdg_directories 1.0.3 1.0.3 1.0.3 1.0.3 xdg_directories No

OpenHarmony platform has compatible third-party libraries

See

FAQ

1. Run flutter pub get displayed "File name too long" error

Open the Git Bash or cmd.exe(you need to have git as an environment variable) and execute the following command:

  git config --global core.longpaths true

Introduction

开发者可在 Flutter 应用中无缝集成常用插件,通过最小化业务改动获得完整的 OpenHarmony 原生能力支持。项目基于 Flutter 官方插件库扩展,新增对 OpenHarmony 平台的兼容适配,提供多种已适配插件及使用示例。【此简介由AI生成】

Customize your domain