init static method

dynamic init(
  1. dynamic optionsOrConfiguration, {
  2. Client? httpClient,
  3. Set<String> firstPartyHosts = const <String>{},
  4. bool autoInstrumentation = false,
  5. bool captureAppLifecycle = false,
  6. bool installErrorHooks = false,
  7. bool captureFlutterErrors = true,
  8. bool capturePlatformDispatcherErrors = true,
  9. bool preserveExistingHandlers = true,
  10. FractalUpAppRunner? appRunner,
})

Implementation

static dynamic init(
  dynamic optionsOrConfiguration, {
  http.Client? httpClient,
  Set<String> firstPartyHosts = const <String>{},
  bool autoInstrumentation = false,
  bool captureAppLifecycle = false,
  bool installErrorHooks = false,
  bool captureFlutterErrors = true,
  bool capturePlatformDispatcherErrors = true,
  bool preserveExistingHandlers = true,
  FractalUpAppRunner? appRunner,
}) {
  if (optionsOrConfiguration is Function) {
    return _FractalUpBootstrap.init(
      (options) => Function.apply(
        optionsOrConfiguration,
        <Object?>[options],
      ),
      appRunner: appRunner,
    );
  }
  if (optionsOrConfiguration is! FractalupRadarOptions) {
    throw ArgumentError.value(
      optionsOrConfiguration,
      'optionsOrConfiguration',
      'must be FractalupRadarOptions or an options callback',
    );
  }

  return configure(
    optionsOrConfiguration,
    httpClient: httpClient,
    firstPartyHosts: firstPartyHosts,
    captureAppLifecycle: captureAppLifecycle || autoInstrumentation,
    installErrorHooks: installErrorHooks || autoInstrumentation,
    captureFlutterErrors: captureFlutterErrors || autoInstrumentation,
    capturePlatformDispatcherErrors:
        capturePlatformDispatcherErrors || autoInstrumentation,
    preserveExistingHandlers: preserveExistingHandlers,
  );
}