flutter-flutter与原生通信的几种channel介绍

几种channel 之间的区别
BasicMessageChannel:
通过异步传递message与平台进行通信
/// A named channel for communicating with platform plugins using asynchronous
/// message passing.

EventChannel:
通过流的方式与平台进行通信
/// A named channel for communicating with platform plugins using event streams.

MethodChannel:
通过异步方法调用的方式与平台进行通信
/// A named channel for communicating with platform plugins using asynchronous
/// method calls.

OptionalMethodChannel:
继承于MethodChannel 忽略了平台
/// A [MethodChannel] that ignores missing platform plugins.
 

你可能感兴趣的:(Flutter)