mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 13:58:47 +00:00
I got carried away with Gemini and basically rewrote CI and the release process for the new LLM reality. This work was largely completed by Gemini. - Bump all SDK versions to the current beta (3.9.0-0) - Run `flutter channel beta` - Wrote `ci_script.dart` to replace the bash scripts - Converted repository to pub workspace #2499 - Added llm.md and release.md - Added redirect for deprecated Samples Index ## Pre-launch Checklist - [x] I read the [Flutter Style Guide] _recently_, and have followed its advice. - [x] I signed the [CLA]. - [x] I read the [Contributors Guide]. - [x] I have added sample code updates to the [changelog]. - [x] I updated/added relevant documentation (doc comments with `///`).
Platform Channel Samples
A sample app which demonstrates how to use MethodChannel, EventChannel, BasicMessageChannel and MessageCodec in Flutter.
Goals
- Demonstrate how to use
MethodChannelto invoke platform methods. - Demonstrate how to use
EventChannelto listen continuous value changes from the platform. - Demonstrate how to use
BasicMessageChannelandMessageCodecto send messages of different types across the platform.
The important bits
Method Channel demo
Demonstrates how to implement a MethodChannel to increment and decrement a
counter.
Event Channel demo
Demonstrates how to implement an EventChannel to listen to value changes from
the Accelerometer sensor from native side.
Platform Image demo
Demonstrates how to implement a BasicMessageChannel using
StandardMessageCodec to load an image from native asset.
Basic Message Channel demo
Demonstrates how to implement BasicMessageChannel using JSONMessageCodec,
BinaryCodec and StringCodec to send and receive data about pets.
Questions/issues
If you have a general question about Platform Channels in Flutter, the best places to go are:
If you run into an issue with the sample itself, please file an issue here.