initMapkit function

Future<void> initMapkit({
  1. required String apiKey,
  2. String? locale,
  3. String? userId,
  4. Map<String, String> options = const {},
})

Implementation

Future<void> initMapkit(
    {required String apiKey,
    String? locale,
    String? userId,
    Map<String, String> options = const {}}) async {
  if (_isInit()) return;

  initDartApi();
  await const MapkitMethodChannel('runtime')
      .invokeMethod('init', {'options': options});

  I18nManagerFactory.setLocale(locale);
  mapkit.setApiKey(apiKey);

  if (userId != null) {
    mapkit.setUserId(userId);
  }
}