Responding to hit testing and input gestures, and translating those into the
equivalent native input.

Creating an analog of the accessibility tree, and passing commands and
responses between the native and Flutter layers.

Inevitably, there is a certain amount of overhead associated with this
synchronization. In general, therefore, this approach is best suited for complex
controls like Google Maps where reimplementing in Flutter isn’t practical.

Typically, a Flutter app instantiates these widgets in a build() method based
on a platform test. As an example, from the
google_maps_flutter plugin:

if

defaultTargetPlatform

==

TargetPlatform

android

return

AndroidView

viewType:

'plugins.flutter.io/google_maps'

onPlatformViewCreated:

onPlatformViewCreated