deleteChat function

void deleteChat({
  1. dynamic groupId,
  2. dynamic userId,
  3. dynamic context,
})

Implementation

void deleteChat({groupId, userId, context}) {
  var params = {
    "groupId": groupId,
    "userId": userId,
    "secretKey":AppStorages.secKey
  };
  socket.emit("delete-chat", params);
  socket.on("delete-chat-res", (data) {
    if (data['isSuccess']) {
      // Get.off(() => const ChatsListView());
      Navigator.pushReplacement(
          context,
          MaterialPageRoute(
              builder: (BuildContext context) =>  ChatsListView()));
    }
  });
}