Engineering / Flutter / Mobile

When Flutter needs native code.

How to decide what belongs in shared Flutter code and what needs native iOS or Android integration.

Flutter can share an application’s interface and logic across iOS and Android. Native code handles the parts that depend on each operating system. The decision is which parts of your product belong in each layer.

Decide what to share

If an app has similar user flows on iOS and Android, a shared interface and application logic give the team one place to maintain those parts of the product.

Bluetooth, audio, permissions, background execution, and hardware input need closer attention to each platform. Identify those requirements early. Decide what should behave consistently, what needs direct access to a platform API, and how the team will maintain the integration.

Check the platform beneath the API

A Flutter plugin exposes native capabilities to Dart code. Flutter’s platform channels are one way to connect the two.

A common API still depends on operating-system behavior. A Bluetooth connection must account for permissions, interruptions, and changes in application state. Audio playback must work with the platform’s other audio activity.

When choosing a package, check whether it supports the operations you need, documents its limits, and can be tested with your intended hardware. A platform support list alone does not answer those questions.

Test the hardest requirement first

Our open-source packages cover Bluetooth, gestures, and device input. Their code and documentation let developers inspect the API and its native implementation.

Use a small prototype to test the requirement most likely to affect the integration. For Bluetooth, test the complete connection flow with the actual device. For touch input, test the control people will use most often. Keep the prototype close to the product so platform constraints surface before the rest of the interface is built.

Keep platform integration separate

A clear separation between application logic and platform code makes both easier to maintain. Shared code defines the application’s behavior; native code and plugins connect it to the operating system.

Test the shared flows, then test each integration on the devices and operating-system versions your product supports.

See our open-source projects and mobile engineering expertise. For help choosing an approach or connecting an app to hardware, contact our team.

All news & insights