Loading topic
Intermediate · Mid: 17 chapters · 29 min read. States assumed prerequisites
Start readingFuture, and that you know the basic structure of a Flutter plugin. You should also be able to read simple Kotlin and Swift. The examples use a MethodChannel to send one request from Dart to native code and receive one response.Future and async/await, and build a Flutter app. It also assumes you understand that native Android and iOS code will implement the channel methods that this Dart API calls.pubspec.yaml entry.MethodChannel API from the previous chapter, and have a working Flutter and Xcode installation. This chapter implements the iOS half of a battery plugin. The Dart side calls getBatteryLevel on the channel named battery_info.BatteryInfo plugin’s getBatteryLevel method from the previous chapter.Future and async code, and have already created the BatteryInfo Dart API. The tests here do not require an Android device, an iPhone, or the native implementations.MethodChannel, and read basic Kotlin or Swift. You will learn how to expose a native event source as a Dart Stream.MethodChannel. You should also know that Android Activity objects represent screens and can be destroyed and recreated during configuration changes, such as screen rotation.MethodChannel, where Dart and native code agree on channel and method names manually.MethodChannel, and have basic Kotlin and Swift knowledge. It focuses on package structure and dependency flow rather than native method-channel implementation.