Add the option for intrinsic height to FButton #475
lukasengel
started this conversation in
Ideas
Replies: 2 comments 2 replies
-
I get where you're coming from, but I'm on the fence about adding a |
Beta Was this translation helpful? Give feedback.
2 replies
-
We looked through this issue again and I think we'll be changing the default to be intrinsic, thanks for pointing this out! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey everyone,
Currently, an
FButton
extends to the maximum available width by default. In some situations, this might look out of place.For example, in my application's settings screen:
My current workaround is a custom widget based on
FButton.raw
to achieve something like this:I've drafted a solution, which gives the developer the option to override this behavior.
I've added the property
intrinsicWidth
to theContent
class inbutton_contents.dart
. Based on this flag, the row's main axis size is set to eitherMainAxisSize.min
orMainAxisSize.max
. Of course, it is set to false by default, in order not to break other parts of the code.The modified
button.dart
:Now, it can be used like so:
If you think this might be helpful, I'd really appreciate if you could take the time and implement something similar.
Otherwise, I can also create a pull request. :)
Thanks a lot for your efforts!
Best regards,
Lukas
Beta Was this translation helpful? Give feedback.
All reactions