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

Auto scale height to minimum. Why cant i use constrainedBox with a maxheight? #305

Open
Jesse-Abruzzo opened this issue Oct 1, 2024 · 3 comments

Comments

@Jesse-Abruzzo
Copy link

Is there a way to use fittedbox with this widget? I have it wrapped in a constraintedbox with a max height. but if its smaller that that max height, i see this leftover blank unused space. i want to use fittedbox to auto scale it smaller to fit the min height. gives me an error when i try it.

@Jesse-Abruzzo Jesse-Abruzzo changed the title Auto scale height to minimum, like fittedbox Auto scale height to minimum. Why cant i use constrainedBox with a maxheight? Oct 1, 2024
@Jesse-Abruzzo
Copy link
Author

Just commenting to correct my description. i really just want to use constrainedBox not fittedbox. if i set a max height of the box, why doesnt it minimize the size if its smaller than the max height?

@plchekspend
Copy link

Hi @Jesse-Abruzzo I guess you have to use layout builder and use it's builder's constraints property like this,

SizedBox(
  height: constraints.maxHeight,
  child: PaginatedDataTable2(),
)

I guess it'll work out for you, because it's working perfectly for me..

@fedpinx
Copy link

fedpinx commented Oct 9, 2024

@Jesse-Abruzzo were you able to make it work? I'm in the same situation, reading their README.md they say there MUST be a constrained parent, so I'm starting to think it is impossible, at least for the paginated data table. I would also like to make the table shrink to the amount of rows, also, it does know each row height and the heading height.

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

No branches or pull requests

3 participants