getGiftEntity method

GiftEntityProtocol? getGiftEntity()

Implementation

GiftEntityProtocol? getGiftEntity() {
  GiftEntityProtocol? ret;
  do {
    if (body.type != BodyType.CUSTOM) break;
    if ((body as CustomBody).event != ChatRoomUIKitEvent.giftEvent) break;
    if ((body as CustomBody).params == null) break;
    if (!(body as CustomBody).params!.containsKey(ChatRoomUIKitEvent.gift)) {
      break;
    }
    String? jString = (body as CustomBody).params![ChatRoomUIKitEvent.gift];
    final map = json.decode(jString!);
    ret = ChatroomUIKitClient.instance.giftService.giftFromJson(map);
  } while (false);

  return ret;
}