mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Handing a UIView refererence directly to the engine makes it challenging for plugin authors to retain a controller for that UIView (e.g the controller that talks over the platform channel) for as long as the embedded view is needed. We instead make the factory return a FlutterPlatformView which is a wrapper around the UIView that the engine retains as long as the platform view instance is needed. This allows plugin authors to keep their control logic in the FlutterPlatformView and know that the engine is responsible for retaining the reference.