initialize method

  1. @override
Future<void> initialize({
  1. required String sdkKey,
  2. required String sdkName,
  3. required String sdkVersion,
  4. HackleConfig? hackleConfig,
  5. HackleUser? user,
})
override

Implementation

@override
Future<void> initialize({
  required String sdkKey,
  required String sdkName,
  required String sdkVersion,
  HackleConfig? hackleConfig,
  HackleUser? user,
}) async {
  try {
    final Map<String, Object?> arguments = {
      Argument.sdkKey.value: sdkKey,
      Argument.hackleConfig.value: hackleConfig?.toMap(),
      Argument.wrapperName.value: sdkName,
      Argument.wrapperVersion.value: sdkVersion,
      Argument.user.value: user?.toMap(),
    };

    return methodChannel.invokeMethod(Method.initialize.value, arguments);
  } catch (e) {
    log("Failed to initialize", level: 3, error: e);
  }
}