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
Brett Morgan a481c264cd
Remove git:// url, update deps, fix `destop_photo_search` (#1052)
3 years ago
..
android Update platform_channels Android files (#1022) 3 years ago
assets
ios
lib Remove unneeded types (#949) 3 years ago
test Enforce `use_key_in_widget_constructors` and `file_names` lints (#913) 3 years ago
.gitignore
.metadata
README.md
analysis_options.yaml Centralize analysis options (#957) 3 years ago
pubspec.lock Remove git:// url, update deps, fix `destop_photo_search` (#1052) 3 years ago
pubspec.yaml

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.