initializeClient static method

void initializeClient({
  1. required String key,
})

This needs to be called before any other functions or class in this package.

Implementation

static void initializeClient({required String key}) {
  try {
    BotnoiClient client = BotnoiClient(key: key);
    GetIt.I.registerSingleton<BotnoiClient>(client);
  } catch (e) {
    GetIt.I<BotnoiClient>().key = key;
  }
  BotnoiChatbot.setErrorCallback((error) {
    throw error;
  });
}