sendLikeMessage method

void sendLikeMessage()

Implementation

void sendLikeMessage() {
  debugPrint("LikeController sendLikeMessage");
  if (_currentLikeCount >= _maxLikeCount) {
    GiftStore().likeManager.sendLike();
    _currentLikeCount = 0;
    _lastSendLikeTime = DateTime.now().millisecondsSinceEpoch ~/ 1000;
  }

  int currentTime = DateTime.now().millisecondsSinceEpoch ~/ 1000;
  debugPrint("LikeController currentTime:{$currentTime}");
  if (currentTime - _lastSendLikeTime > _minDuration) {
    GiftStore().likeManager.sendLike();
    _currentLikeCount = 0;
    _lastSendLikeTime = DateTime.now().millisecondsSinceEpoch ~/ 1000;
  } else {
    _currentLikeCount += 1;
    showLikeAnimation();
  }
}