AppsflyerSdk constructor

AppsflyerSdk(
  1. dynamic options
)

Returns the AppsflyerSdk instance, initialized with a custom options provided by the user

Implementation

factory AppsflyerSdk(options) {
  if (_instance == null) {
    MethodChannel methodChannel =
        const MethodChannel(AppsflyerConstants.AF_METHOD_CHANNEL);

    EventChannel eventChannel =
        EventChannel(AppsflyerConstants.AF_EVENTS_CHANNEL);

    //check if the option variable is AFOptions type or map type
    assert(options is AppsFlyerOptions || options is Map);
    if (options is AppsFlyerOptions) {
      _instance = AppsflyerSdk.private(methodChannel, eventChannel,
          afOptions: options);
    } else if (options is Map) {
      _instance = AppsflyerSdk.private(methodChannel, eventChannel,
          mapOptions: options);
    }
  }
  return _instance!;
}