init static method

Future<VWO?> init(
  1. VWOInitOptions options
)

Initializes the VWO SDK.

This method should be called before any other VWO methods.

options The initialization options for the VWO SDK.

Returns a Future that resolves to a VWO instance if successful, or null if an error occurs.

Implementation

static Future<VWO?> init(VWOInitOptions options) async {
  try {
    var sdkPlugin = await MethodChannelVwoFmeFlutterSdk.init(options);
    var fmeSdk = VWO();
    fmeSdk._fmePlugin = sdkPlugin;
    return fmeSdk;
  } catch (e) {
    if (e is PlatformException) {
      logMessage("VWO: Error: ${e.message ?? ""}");
    } else {
      logMessage("VWO: Error: $e");
    }
    return null;
  }
}