# flutter_samples **Repository Path**: lihansz/flutter_samples ## Basic Information - **Project Name**: flutter_samples - **Description**: 暂无描述 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: https://gitee.com/openharmony-sig/flutter_samples - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 59 - **Created**: 2025-02-25 - **Last Updated**: 2025-02-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## Repository Description This repository is extended from the [samples](https://github.com/flutter/samples/) repository of the commit ID d010d3fae62e2bec36614c9b17e9a86e78a65575 in the upstream Flutter community. The sample codes of OpenHarmony are added to this repository. ## Added Sample Codes | Repository Name| Dependency Path| Description| | ----- | ------ | ------------------------------------------- | | [flutter_music_player](https://gitee.com/openharmony-sig/flutter_samples/tree/master/flutter_music_player) | flutter_music_player | Music player with features such as automatic playback and progress bar dragging.| | [flutter_smart_agriculture](https://gitee.com/openharmony-sig/flutter_samples/tree/master/flutter_smart_agriculture) | flutter_smart_agriculture | Smart agriculture.| | [async_test](https://gitee.com/openharmony-sig/flutter_samples/tree/master/ohos/async_test) | ohos/async_test | Asynchronous callback demo.| | [channel_demo](https://gitee.com/openharmony-sig/flutter_samples/tree/master/ohos/channel_demo) | ohos/channel_demo | Channel test demo, used to view the return values of the **EventChannel**, **MethodChannel**, and **BasicMessageChannel** methods.| | [clock_test](https://gitee.com/openharmony-sig/flutter_samples/tree/master/ohos/clock_test) | ohos/clock_test | Timer demo, used to time and view timing records and detailed data.| | [dio_test](https://gitee.com/openharmony-sig/flutter_samples/tree/master/ohos/dio_test) | ohos/dio_test | Test demo set.| | [event_bus_test](https://gitee.com/openharmony-sig/flutter_samples/tree/master/ohos/event_bus_test) | ohos/event_bus_test | Event-driven demo.| | [flutter_page_sample1](https://gitee.com/openharmony-sig/flutter_samples/tree/master/ohos/flutter_page_sample1) | ohos/flutter_page_sample1 | Page redirection demo.| | [flutter_page_sample2](https://gitee.com/openharmony-sig/flutter_samples/tree/master/ohos/flutter_page_sample2) | ohos/flutter_page_sample2 | **FlutterEntry** usage sample.| | [multiple_flutters_ohos](https://gitee.com/openharmony-sig/flutter_samples/tree/master/add_to_app/multiple_flutters) | add_to_app/multiple_flutters/multiple_flutters_ohos | **FlutterEngineGroup** usage sample.| | [flutter_svg_test](https://gitee.com/openharmony-sig/flutter_samples/tree/master/ohos/flutter_svg_test)| ohos/flutter_svg_test | SVG image demo.| | [http_parser_test](https://gitee.com/openharmony-sig/flutter_samples/tree/master/ohos/http_parser_test) | ohos/http_parser_test | HTTP parsing demo.| | [http_test](https://gitee.com/openharmony-sig/flutter_samples/tree/master/ohos/http_test) | ohos/http_test | HTTP web page request demo.| | [logging_test](https://gitee.com/openharmony-sig/flutter_samples/tree/master/ohos/logging_test) | ohos/logging_test | Logging demo.| | [path_drawing_test](https://gitee.com/openharmony-sig/flutter_samples/tree/master/ohos/path_drawing_test) | ohos/path_drawing_test | Path drawing demo.| | [pictures_provider_demo](https://gitee.com/openharmony-sig/flutter_samples/tree/master/ohos/pictures_provider_demo) | ohos/pictures_provider_demo | Image obtaining demo.| | [platform_test](https://gitee.com/openharmony-sig/flutter_samples/tree/master/ohos/platform_test) | ohos/platform_test | Platform call demo.| | [platformchannel_demo](https://gitee.com/openharmony-sig/flutter_samples/tree/master/ohos/platformchannel_demo) | ohos/platformchannel_demo | API test demo for multiple platform features.| | [rxdart_test](https://gitee.com/openharmony-sig/flutter_samples/tree/master/ohos/rxdart_test) | ohos/rxdart_test | RxDart demo, used to process asynchronous events and data streams.| | [string_scanner_test](https://gitee.com/openharmony-sig/flutter_samples/tree/master/ohos/string_scanner_test) | ohos/string_scanner_test | String scanning demo.| | [testcamera](https://gitee.com/openharmony-sig/flutter_samples/tree/master/ohos/testcamera) | ohos/testcamera | Camera call demo.| | [testchat](https://gitee.com/openharmony-sig/flutter_samples/tree/master/ohos/testchat) | ohos/testchat | Chat scenario demo.| | [testpicture](https://gitee.com/openharmony-sig/flutter_samples/tree/master/ohos/testpicture) | ohos/testpicture | Image display demo.| | [tuple_test](https://gitee.com/openharmony-sig/flutter_samples/tree/master/ohos/tuple_test) | ohos/tuple_test | Tuple demo, used to test parameters generated by the tuple.| | [uuid_test](https://gitee.com/openharmony-sig/flutter_samples/tree/master/ohos/uuid_test) | ohos/uuid_test | UUID demo.| | [vector_math_test](https://gitee.com/openharmony-sig/flutter_samples/tree/master/ohos/vector_math_test) | ohos/vector_math_test | Vector matching demo.| ## How to Run a Sample Code 1. Build the Flutter engine that is compatible with OpenHarmony. For details, see https://gitee.com/openharmony-sig/flutter_engine/blob/master/README_EN.md. 2. Download the Flutter SDK that is compatible with OpenHarmony and configure the environment. For details, see https://gitee.com/openharmony-sig/flutter_flutter/blob/master/README_EN.md. 3. Go to the sample directory, for example, **flutter_music_player**, and run `flutter run --local-engine=`. ## FAQs ### How do I use Dart code to determine whether the current platform is ohos? ```dart import 'package:flutter/foundation.dart'; bool isOhos() { return defaultTargetPlatform == TargetPlatform.ohos; } ```