initialize method

Future<void> initialize()

Implementation

Future<void> initialize() async {
  _session.startInitializing();
  try {
    final CrossmintWalletProviderDependencies resolved =
        await _resolveDependencies();
    _client = resolved.client;
    _walletController = resolved.walletController;
    _authRouter = resolved.authCallbackRouter;
    _otp.attachController(_walletController?.otp);
    _session.attachDependencies(
      client: resolved.client,
      walletController: resolved.walletController,
      autoLoadWallet: _config.autoLoadWallet,
    );
    notifyListeners();
  } catch (error) {
    _client = null;
    _walletController = null;
    _authRouter = null;
    _otp.attachController(null);
    _session.failInitialization(error);
    notifyListeners();
  }
}