From d09b5fe2005f78ae8d02e6608de6e35d3923f03e Mon Sep 17 00:00:00 2001 From: Joonas Kerttula Date: Thu, 31 Oct 2024 12:55:26 +0200 Subject: [PATCH] fix: call super.init for platform view after view is registered to avoid possible race conditions. --- ios/Classes/GoogleMapsNavigationView.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ios/Classes/GoogleMapsNavigationView.swift b/ios/Classes/GoogleMapsNavigationView.swift index 4762077..1c52431 100644 --- a/ios/Classes/GoogleMapsNavigationView.swift +++ b/ios/Classes/GoogleMapsNavigationView.swift @@ -71,15 +71,15 @@ class GoogleMapsNavigationView: NSObject, FlutterPlatformView, ViewSettledDelega _mapConfiguration.apply(to: mapViewOptions, withFrame: frame) _mapView = ViewStateAwareGMSMapView(options: mapViewOptions) _mapConfiguration.apply(to: _mapView) - - super.init() - _navigationUIEnabledPreference = navigationUIEnabledPreference - applyNavigationUIEnabledPreference() registry.registerView(viewId: viewId, view: self) _mapView.delegate = self _mapView.viewSettledDelegate = self + + super.init() + + applyNavigationUIEnabledPreference() } deinit {