You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
samples/platform_channels
Kevin Moore a858f4701e
Bump deps and min SDKs, move web apps to new bootstrapping logic (#2292)
1 month ago
..
android Update Samples for 3.16 (#2085) 8 months ago
assets [platform_channels] adds Platform Image demo (#475) 4 years ago
ios Update Samples for 3.16 (#2085) 8 months ago
lib Fixed ThemeData in the Flutter Samples unnecessarily includes useMaterial3 = true (Issue #2214) (#2217) 3 months ago
test [platform_channels] Bump go_router to 10.1.0 (#1999) 10 months ago
.gitignore Initial Commit for PlaformChannel Sample App (#453) 4 years ago
.metadata Fixup for failing Beta CI (#2092) 8 months ago
README.md Typo fix in README.md (#776) 3 years ago
analysis_options.yaml Create `analysis_defaults` package (#1654) 1 year ago
codelab_rebuild.yaml Update `platform_channels` (#2013) 10 months ago
pubspec.yaml Bump deps and min SDKs, move web apps to new bootstrapping logic (#2292) 1 month ago

README.md

Platform Channel Samples

A sample app which demonstrates how to use MethodChannel, EventChannel, BasicMessageChannel and MessageCodec in Flutter.

Goals

  • Demonstrate how to use MethodChannel to invoke platform methods.
  • Demonstrate how to use EventChannel to listen continuous value changes from the platform.
  • Demonstrate how to use BasicMessageChannel and MessageCodec to 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.