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

fix numbers size #3

Merged
merged 2 commits into from
Jan 4, 2022
Merged

fix numbers size #3

merged 2 commits into from
Jan 4, 2022

Conversation

hadi-neon
Copy link
Contributor

The default size for numbers was 0 change it to currentValue

image
image

@mingsnx mingsnx merged commit c24f1f4 into mingsnx:master Jan 4, 2022
@mingsnx
Copy link
Owner

mingsnx commented Jan 5, 2022

Hello~
Yesterday, I got all the same Size on the Android emulator, so depressed -.-(emoji)

This is the result of testing the text size on iOS today
test code

Size _getTextSize(String text) {
  TextPainter painter = TextPainter(
    textDirection: TextDirection.ltr,
    text: TextSpan(
      text: text,
      style: TextStyle(fontSize: 25, fontWeight: FontWeight.w500),
    ),
    textScaleFactor: 1.0,
  );
  painter.layout();
  return painter.size;
}
for (var i = 0; i < 10; i++) {
  log("$i: ${_getTextSize(i.toString())}");
}

test result
This is the result of my test text size measurement on iOS got several different width
TjWa3d.png

running widget effect
TjW4uq.png

so, I remember why I used 0 as the Size of digit

_getTextSize(isNumber ? "0" : currentValue);

@hadi-neon
Copy link
Contributor Author

Hey,
I'm so sorry I did test all cases.
I did fix the error, you can check it here before merging
https://github.com/hadi-neon/animated_digit

@mingsnx
Copy link
Owner

mingsnx commented Jan 10, 2022

@mingsnx
Copy link
Owner

mingsnx commented Jan 10, 2022

Hi~
I added autoSize to meet this need

6789

@mingsnx
Copy link
Owner

mingsnx commented Jan 10, 2022

published 3.0.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 this pull request may close these issues.

None yet

2 participants