Sizing elements to percentage of screen width/height
Is there a simple (non-LayoutBuilder) way to size an element relative to screen size (width/height)? For example: how do I set the width of a CardView to be 65% of the screen width. It can't be done inside the build method (obviously) so it would have to be deferred until post build. Is there a preferred place to put logic like this?
FractionallySizedBox may also be useful. You can also read the screen width directly out of MediaQuery.of(context), and create a sized box based on that, if you really want to size as a fraction of the screen regardless of what the layout is.
You could build a Column/Row with Flexible or Expanded children that have flex values that add up to the percentages you want. You may also find the AspectRatio widget useful.
Unable to install Flutter on my windows machine
PageView with horizontal, non-filled children
How to navigate between flutter screen to native(android/ios) screens
Creating raw image from Widget or Canvas
The equivalent of wrap_content and match_parent in flutter?
Is there an AdMob or other ad service SDK for Flutter apps
How can I access the contents of a StatefulWidget's State during a unit test?
How can I tightly wrap a Column of widgets inside a Card?
What's the reason for “async” in testWidgets methods?
How can I inherit a StatefulWidget's State?
Why is this icon being clipped?
IconButton calling setState during onPressed shows no ripple effect
How can I test a TextPainter?
Passing command line arguments to a flutter app
How can I save to local storage using Flutter?
Life cycle in flutter