createConversationChannel method

dynamic createConversationChannel(
  1. List<String> userIds,
  2. dynamic callback(
    1. ChannelList? data,
    2. String? error
    )
)

Implementation

createConversationChannel(List<String> userIds,
    Function(ChannelList? data, String? error) callback) async {
  await channelRepoImp.createConversationChannel(userIds,
      (data, error) async {
    if (data != null) {
      log("createConversationChannel: success ${data}");

      callback(data, null);
    } else {
      log(error.toString());
      await AmityDialog()
          .showAlertErrorDialog(title: "Error!", message: error!);
      callback(null, error);
    }
  });
}