disconnect method

Future<void> disconnect({
  1. bool tryLogout = false,
})

disconnect will close the browser instance and set values to null

Implementation

Future<void> disconnect({
  bool tryLogout = false,
}) async {
  try {
    if (tryLogout) await logout();
    await wpClient.dispose();
  } catch (e) {
    WhatsappLogger.log(e);
  }
}