A flutter project following 'Writing custom platform-specific code'
See https://docs.flutter.dev/development/platform-integration/platform-channels?tab=android-channel-kotlin-tab for online documentation (retrived 2022.11.17 12.56)
Also check the file platform-channels.md for an offline copy of the above page
Just as in the documentation this demo obtains the battery level.
The implementation progress is as shown below:
| HOST OS | PLATFORM | STATUS |
|---|---|---|
| Android | Kotlin | ✔️ |
| Android | Java | - |
| Windows | C++ | ✔️ |
| iOS | Objective-C | - |
| iOS | Swift | - |
✔️ >> implemented
- >> Not implementedNote: Using 'platform' to refer to the native implementing technology/language
[√] Flutter (Channel stable, 3.0.2, on Microsoft Windows [Version 10.0.22000.1219], locale en-US)
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.2.6)
[√] Android Studio (version 2021.2)
Some functionality could be available through API calls on the host plaform but not yet on flutter. Using this method you can consume the API on the host machine and then simply call the implementation from flutter
The documentation outlines the following ways to achieve this
- MethodChannel
- Pigeon
This demo utilises MethodChannel
A few resources to get you started if this is your first Flutter project:
For help getting started with Flutter development, view the online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.