channel property Null safety

MethodChannel? channel

Used to communicate with the native platform.

Accessible only for testing.

Implementation

// TODO(dit): Remove this getter, https://github.com/flutter/flutter/issues/55504.
@visibleForTesting
MethodChannel? get channel {
  if (GoogleMapsFlutterPlatform.instance is MethodChannelGoogleMapsFlutter) {
    return (GoogleMapsFlutterPlatform.instance
            as MethodChannelGoogleMapsFlutter)
        .channel(mapId);
  }
  return null;
}