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

Get Font Size #127

Open
yosus opened this issue Dec 9, 2022 · 4 comments
Open

Get Font Size #127

yosus opened this issue Dec 9, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@yosus
Copy link

yosus commented Dec 9, 2022

Would like a feature to get the font-size used after layout. This is so I can standardize the font-size in adjacent boxes (on same page)

GlobalKey  textKey = GlobalKey();
WidgetsBinding.instance!.addPostFrameCallback((timeStamp) {

   test.getActualFontSizeUsed();

});

// In build
Widget test =  AutoSizeText(
   'Trying to get Font Size',
   key: textKey,
);

@yosus yosus added the enhancement New feature or request label Dec 9, 2022
@Xazin
Copy link

Xazin commented Dec 10, 2022

I think this would be quite easy to add support for, but I wonder if it wouldn't be better to have this in a callback instead, as it is calculated on build.

The way you would use this to "standardize the font-size" is a bit questionable to me, although I do understand the sentiment.

I'm just a user so I don't have much to say, whether it's a method or a callback. I wouldn't mind implementing it though.

@hanskokx
Copy link

I also would like this ability. I have a SizedBox containing my text. If the text resizes, I want the SizedBox to resize in proportion to the text size. Right now, I have no ability to do that.

@raheel73
Copy link

raheel73 commented Sep 21, 2023

I would also like to determine the adjusted font size. This is because I'm converting an AutoSizeText widget into a PDF Text widget, and I need to specify the exact font size after resizing.

@raheel73
Copy link

I still want to get the resized font size

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

No branches or pull requests

4 participants