initLoanConnect function

dynamic initLoanConnect({
  1. ParamsLoanConnect? params,
  2. RequestAuthToken? auth,
  3. ThemePair? theme,
  4. String? token,
  5. dynamic events(
    1. EventHandlerLoanConnect
    )?,
  6. bool enableLog = true,
})

Implementation

initLoanConnect({
  ParamsLoanConnect? params,
  RequestAuthToken? auth,
  ThemePair? theme,
  String? token,
  Function(EventHandlerLoanConnect)? events,
  bool enableLog = true,
}) async {
  _primary(params, enableLog, auth, token).whenComplete(() async {

    theme == null
        ? info('No theme was provided. Applying defaults.')
        : put<IServiceTheme>(() => ServiceTheme.fromJson(theme));

    events?.call(put(() => EventHandlerLoanConnect()));

    if (params?.skipToServicerID != null) {
      final servicer = await get<IUseCaseAllServicers>()
          .getServicer(params!.skipToServicerID!)
          .onError((err, stack) => errorWithStack(err ?? 'null', stack));
      replace<Servicer>(() => servicer);
    }
  });
}