MENU

Fun & Interesting

Using Native Code with Flutter

Andy Julow 34,462 4 years ago
Video Not Working? Fix It Now

Flutter developers have many plugins available for interacting with device hardware, but sometimes it is necessary to implement native code in your application. In this video we will implement platform specific code for accessing the barometric pressure sensor of an IOS or Android device using Kotlin and Swift, relaying the data back to our Flutter UI. Github Repo: https://github.com/nhandrew/platformcode This project is based on a plugin I wrote for capturing environmental sensor data. The syntax for a plugin is slightly different than implementing directly in the device, but the repo for that is also available at: https://github.com/nhandrew/environment_sensors The Android implementation uses the Environment Sensors API, the documentation for which is available at https://developer.android.com/guide/topics/sensors/sensors_environment The IOS implementation uses the CMAltimeter API, the documentation for which is available at https://developer.apple.com/documentation/coremotion/cmaltimeter Social Media: Twitter: @andyjulow

Comment