getReaction method

Future<ReactionBody> getReaction(
  1. int fid,
  2. ReactionType reactionType,
  3. int? targetCastId,
  4. String? targetUrl,
)

Implementation

Future<ReactionBody> getReaction(
  int fid,
  ReactionType reactionType,
  int? targetCastId,
  String? targetUrl,
) async {
  ReactionRequest request = ReactionRequest();
  request.fid = $fixnum.Int64(fid);
  request.reactionType = reactionType;
  if (targetCastId != null) {
    CastId castId = CastId();
    castId.fid = $fixnum.Int64(targetCastId);
    request.targetCastId = castId;
  }
  if (targetUrl != null) {
    request.targetUrl = targetUrl;
  }

  Message response = await _hubService.hubClient.getReaction(request);

  return response.data.reactionBody;
}