-
Book Overview & Buying
-
Table Of Contents
Flutter for Beginners - Fourth Edition
By :
Many plugins will work with the different underlying platforms to use OS functionality. This dependency changes the way your project is built and run because there is native code within your project that interfaces with the underlying platform. Let’s look at how that interfacing works.
Flutter does not directly interface with the native platform it is running on; this is what makes Flutter platform-agnostic and able to run on so many different platforms. Therefore, to access lower-level APIs such as GPS location or the camera, the communication between the client (Flutter) and the host (native) application occurs through platform channels. The MethodChannel class is responsible for sending messages (method invocations) to the platform side. On the platform side, MethodChannel on Android (API) and FlutterMethodChannel on iOS (API) allow you to receive method calls and send a result back. The structure of this relationship is shown in the following...