init method

  1. @override
Future<void> init({
  1. required String apiKey,
  2. required String matchingKey,
  3. required String? bucketingKey,
  4. SplitConfiguration? sdkConfiguration,
})

Implementation

@override
Future<void> init(
    {required String apiKey,
    required String matchingKey,
    required String? bucketingKey,
    SplitConfiguration? sdkConfiguration}) {
  methodChannel.setMethodCallHandler((call) => handle(call));

  Map<String, Object?> arguments = {
    'apiKey': apiKey,
    'matchingKey': matchingKey,
    'sdkConfiguration': sdkConfiguration?.configurationMap ??
        SplitConfiguration().configurationMap,
    // If sdkConfiguration is null, create a new SplitConfiguration to apply default values
  };

  if (bucketingKey != null) {
    arguments.addAll({'bucketingKey': bucketingKey});
  }

  return methodChannel.invokeMethod('init', arguments);
}