channel

setMethodCallHandler

call

FlutterMethodCall

result

FlutterResult

>

Void

in

switch

call

method

case

"bar"

result

"Hello,

\(

call

arguments

as!

String

default

result

FlutterMethodNotImplemented

Further examples of using platform channels, including examples for macOS, can
be found in the flutter/plugins
repository3. There are also thousands of plugins
already available for Flutter that cover many common
scenarios, ranging from Firebase to ads to device hardware like camera and
Bluetooth.

Foreign Function Interface