getRoomLayout method

Future getRoomLayout({
  1. required String authToken,
  2. String? endPoint,
})

getRoomLayout is used to get the layout themes for the room set in the dashboard.

This returns an object of Future

Implementation

Future<dynamic> getRoomLayout(
    {required String authToken, String? endPoint}) async {
  var arguments = {"auth_token": authToken, "endpoint": endPoint};
  var result = await PlatformService.invokeMethod(
      PlatformMethod.getRoomLayout,
      arguments: arguments);

  //If the method is executed successfully we get the "success":"true"
  //Hence we pass the String directly
  //Else we parse it with HMSException
  if (result["success"]) {
    return result["data"];
  } else {
    return HMSException.fromMap(result["data"]["error"]);
  }
}