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:

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


Using Native Code with Flutter
16.25 GEEK