skip to content

Native Interop

Crossing from Dart into the host platform: channels, Pigeon codegen, dart:ffi, federated plugins, platform views and add-to-app. Interviewers ask because every app meets an API Flutter does not wrap.

part ofFlutteroverview, primer and where to startread it →
on this pageshow

explore

questions

page 2 of 2

Since Flutter 3.44 turned Swift Package Manager on by default, what must a Flutter plugin ship for iOS and macOS, and what happens to plugins with only a podspec?

level: seniorimportance: should knowfreq 30%

basics

~20 s

A plugin should ship a Swift package (Package.swift with a Sources folder under ios, macos or darwin) and keep its podspec. Apps fall back to CocoaPods for plugins lacking Swift Package Manager support, which keeps them working but mixes two dependency managers.

open as a page

In Flutter, what does flutter create --template=package_ffi set up, and how do its build hook and ffigen config deliver a C library to the app?

level: middleimportance: nice to knowfreq 15%

basics

~20 s

package_ffi creates a package with C sources, a hook/build.dart that compiles them into a code asset with native_toolchain_c, and an ffigen.yaml that generates @Native bindings resolved against that asset, with no Gradle, CMake or podspec files.

open as a page

In Flutter add-to-app, how does FlutterEngineGroup reduce the memory and startup cost of several Flutter screens, and what stays separate between its engines?

level: seniorimportance: nice to knowfreq 17%

basics

~20 s

Engines spawned from one FlutterEngineGroup share reusable resources — GPU context, font metrics and the isolate group snapshot — so each extra instance costs about 180 kB and starts faster. Each engine still runs its own isolate with separate Dart state.

open as a page

In Pigeon for Flutter, how does an @EventChannelApi definition stream scanned barcodes from Kotlin or Swift to Dart, and what does it generate?

level: seniorimportance: nice to knowfreq 12%

basics

~20 s

An @EventChannelApi abstract class declares methods whose return type is the streamed element; Pigeon generates a Dart function returning Stream of that type and, on Kotlin and Swift, a stream-handler base class with onListen, a typed PigeonEventSink, and a register function.

open as a page

In Flutter on iOS, how does a UiKitView platform view compose with Flutter content, and which composition limits should you expect?

level: seniorimportance: nice to knowfreq 16%

basics

~20 s

On iOS, Flutter uses only hybrid composition: the native UIView is added to the view hierarchy and Flutter content is layered around it. ShaderMask and ColorFiltered do not apply to the native view, and BackdropFilter works only with limitations.

open as a page

Your Flutter app must read a Bluetooth thermometer on Android, iOS and web: how do you decide between adopting an existing plugin, extending it, or writing your own federated plugin?

level: principalimportance: nice to knowfreq 18%

basics

~20 s

Adopt when an existing plugin covers every target platform with active maintenance; fill a single missing platform with your own implementing package rather than a fork; write your own federated plugin only when a vendor SDK, protocol or roadmap no public plugin can serve forces it.

open as a page

showing 31–36 of 36