Loading topic
pubspec.yaml and flutter pub add. You should be able to read short Kotlin and Swift snippets. You don't need to write native code yet. Later chapters set up Android Studio and Xcode and build a working plugin. Here we o5 min readflutter create, what the tool writes to disk, and how to check that the unmodified template builds. It assumes you can write Dart and build Flutter apps, have Android Studio and Xcode installed with a working Flutter toolchain, and can read basi6 min readinvokeMethod in Dart and result.success in native code. You should also be able4 min readbattery_info plugin project and know how a MethodChannel carries a call to native code and back. Here you write the Dart side: the class app developers call, and the boundary between their code and the channel.4 min readbattery_info plugin, declared its platforms in pubspec.yaml, and written the Dart BatteryInfo class that calls a MethodChannel named battery_info. You should be able to read basic Kotlin and know what an Android Context is. Here you wri5 min readpubspec.yaml plugin declarations, platform channels, and the Dart API. You should be able to read basic Swift. You also need Xcode installed and a Flutter toolchain that can build the example app for iOS.4 min readbattery_info plugin from the earlier chapters. That means a working MethodChannel named battery_info, a Kotlin onMethodCall, and a Swift handle method. It also assumes you are comfortable with try/catch in Dart, Kotlin and Swift. Here you will decide w4 min readbattery_info plugin and written its Dart, Kotlin and Swift code in the earlier chapters. You also need a working Flutter toolchain, an Android emulator or device, and an iOS simulator or device with Xcode set up.4 min readflutter test can check your Dart API on your computer, with no emulator, simulator 4 min readMethodChannel handler in Kotlin and in Swift. You should also know how result.success and result.error reply to Dart.4 min readMethodChannel answers one question with one reply. Some native data keeps changing, such as battery level, connectivity, or sensor readings, and polling it wastes work and misses changes. An EventChannel solves this by exposing a native event source as a Dart Stream. This chapter adds a batt4 min readFlutterPlugin and MethodCallHandler, as in the earlier Android chapter. You should also know what an Android Activity is and how startActivityForResult works.4 min readMethodChannel carries a method name and arguments to native code, and how the Kotlin and Swift plugin classes answer those calls. Here you replace the hand-written channel code with code generated by Pigeon.5 min readbattery_info plugin with a MethodChannel, Kotlin and Swift implementations, and pubspec.yaml platform entries. You should also be comfortable with Dart packages, pubspec.yaml dependencies, and running `flu4 min readbattery_info plugin from a working repository to a published package on pub.dev. It assumes you can already run the plugin from its example app on Android and iOS, and that its Dart tests pass. It also assumes you are comfortable with pubspec.yaml, Gradle files, and a Coco5 min read