Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CountUp bug and accompanying fix code! #61

Closed
clayzx opened this issue Mar 24, 2024 · 2 comments · Fixed by #62
Closed

CountUp bug and accompanying fix code! #61

clayzx opened this issue Mar 24, 2024 · 2 comments · Fixed by #62

Comments

@clayzx
Copy link

clayzx commented Mar 24, 2024

When set to countUp mode, there is an issue with carryover resulting in three-digit numbers, for example, 19 would become 110 in the next frame.

Fix code, raw_digit_item.dart file:

int minMax(int value) {
    if (widget.countUp) {
      if (value == maxDigit && !currentAndNextIsSame) {
        return 0;
      }

      if (currentAndNextIsSame) {
        return value;
      }

      return value + 1;
    }

    if (value == 0 && !currentAndNextIsSame) {
      return maxDigit;
    }

    if (currentAndNextIsSame) {
      return value;
    }

    return max(value - 1, 0);
  }

hope this can be merged into the main branch in the next release.

@farhanfadila1717
Copy link
Owner

thanks @clayzx for filling this issue, sure, i'll added your code next release.

@farhanfadila1717
Copy link
Owner

Already released on pubdev v1.6.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants