@@ -2,7 +2,6 @@ part of mapbox_gl_platform_interface;
22
33class MethodChannelMapboxGl extends MapboxGlPlatform {
44 late MethodChannel _channel;
5- static bool useHybridComposition = false ;
65
76 Future <dynamic > _handleMethodCall (MethodCall call) async {
87 switch (call.method) {
@@ -141,50 +140,39 @@ class MethodChannelMapboxGl extends MapboxGlPlatform {
141140 OnPlatformViewCreatedCallback onPlatformViewCreated,
142141 Set <Factory <OneSequenceGestureRecognizer >>? gestureRecognizers) {
143142 if (defaultTargetPlatform == TargetPlatform .android) {
144- if (useHybridComposition) {
145- return PlatformViewLink (
146- viewType: 'plugins.flutter.io/mapbox_gl' ,
147- surfaceFactory: (
148- BuildContext context,
149- PlatformViewController controller,
150- ) {
151- return AndroidViewSurface (
152- controller: controller as AndroidViewController ,
153- gestureRecognizers: gestureRecognizers ??
154- const < Factory <OneSequenceGestureRecognizer >> {},
155- hitTestBehavior: PlatformViewHitTestBehavior .opaque,
156- );
157- },
158- onCreatePlatformView: (PlatformViewCreationParams params) {
159- final SurfaceAndroidViewController controller =
160- PlatformViewsService .initSurfaceAndroidView (
161- id: params.id,
162- viewType: 'plugins.flutter.io/mapbox_gl' ,
163- layoutDirection: TextDirection .ltr,
164- creationParams: creationParams,
165- creationParamsCodec: const StandardMessageCodec (),
166- onFocus: () => params.onFocusChanged (true ),
167- );
168- controller.addOnPlatformViewCreatedListener (
169- params.onPlatformViewCreated,
170- );
171- controller.addOnPlatformViewCreatedListener (
172- onPlatformViewCreated,
173- );
174-
175- controller.create ();
176- return controller;
177- },
178- );
179- } else {
180- return AndroidView (
181- viewType: 'plugins.flutter.io/mapbox_gl' ,
182- onPlatformViewCreated: onPlatformViewCreated,
183- gestureRecognizers: gestureRecognizers,
184- creationParams: creationParams,
185- creationParamsCodec: const StandardMessageCodec (),
186- );
187- }
143+ return PlatformViewLink (
144+ viewType: 'plugins.flutter.io/mapbox_gl' ,
145+ surfaceFactory: (
146+ BuildContext context,
147+ PlatformViewController controller,
148+ ) {
149+ return AndroidViewSurface (
150+ controller: controller as AndroidViewController ,
151+ gestureRecognizers: gestureRecognizers ??
152+ const < Factory <OneSequenceGestureRecognizer >> {},
153+ hitTestBehavior: PlatformViewHitTestBehavior .opaque,
154+ );
155+ },
156+ onCreatePlatformView: (PlatformViewCreationParams params) {
157+ final ExpensiveAndroidViewController controller =
158+ PlatformViewsService .initExpensiveAndroidView (
159+ id: params.id,
160+ viewType: 'plugins.flutter.io/mapbox_gl' ,
161+ layoutDirection: TextDirection .ltr,
162+ creationParams: creationParams,
163+ creationParamsCodec: const StandardMessageCodec (),
164+ onFocus: () => params.onFocusChanged (true ),
165+ );
166+ controller.addOnPlatformViewCreatedListener (
167+ params.onPlatformViewCreated,
168+ );
169+ controller.addOnPlatformViewCreatedListener (
170+ onPlatformViewCreated,
171+ );
172+
173+ return controller;
174+ },
175+ );
188176 } else if (defaultTargetPlatform == TargetPlatform .iOS) {
189177 return UiKitView (
190178 viewType: 'plugins.flutter.io/mapbox_gl' ,
0 commit comments