ensureChannelInitialized method

  1. @visibleForTesting
MethodChannel ensureChannelInitialized(
  1. int mapId
)

Returns the channel for mapId, creating it if it doesn't already exist.

Implementation

@visibleForTesting
MethodChannel ensureChannelInitialized(int mapId) {
  MethodChannel? channel = _channels[mapId];
  if (channel == null) {
    channel = MethodChannel('plugins.flutter.io/google_maps_$mapId');
    channel.setMethodCallHandler(
        (MethodCall call) => _handleMethodCall(call, mapId));
    _channels[mapId] = channel;
  }
  return channel;
}