VxSizedBoxExtension extension
A box with a specified size.
If given a child, this widget forces its child to have a specific width and/or height (assuming values are permitted by this widget's parent). If either the width or height is null, this widget will try to size itself to match the child's size in that dimension. If the child's size depends on the size of its parent, the height and width must be provided.
If not given a child, SizedBox will try to size itself as close to the
specified height and width as possible given the parent's constraints. If
height or width is null or unspecified, it will be treated as zero.
The SizedBox.expand constructor can be used to make a SizedBox that
sizes itself to fit the parent. It is equivalent to setting width and
height to double.infinity.
{@tool snippet}
This snippet makes the child widget (a Card with some Text) have the exact size 200x300, parental constraints permitting:
SizedBox(
width: 200.0,
height: 300.0,
child: const Card(child: Text('Hello World!')),
)
{@end-tool}
See also:
- ConstrainedBox, a more generic version of this class that takes arbitrary BoxConstraints instead of an explicit width and height.
- UnconstrainedBox, a container that tries to let its child draw without constraints.
- FractionallySizedBox, a widget that sizes its child to a fraction of the total available space.
- AspectRatio, a widget that attempts to fit within the parent's constraints while also sizing its child to match a given aspect ratio.
- FittedBox, which sizes and positions its child widget to fit the parent according to a given BoxFit discipline.
- The catalog of layout widgets.
- on
Methods
-
fractionalBox(
{Key? key, required double heightFactor, required double widthFactor, Alignment? alignment}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
Extension for FractionallySizedBox -
h(
double height) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
All available heights SizedBox widget with a specifiedheight -
h0(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 0%heightof the MediaQuery height -
h1(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 1%heightof the MediaQuery height -
h10(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 10%heightof the MediaQuery height -
h15(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 15%heightof the MediaQuery height -
h16(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 16%heightof the MediaQuery height -
h2(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 2%heightof the MediaQuery height -
h20(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 20%heightof the MediaQuery height -
h24(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 24%heightof the MediaQuery height -
h32(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 32%heightof the MediaQuery height -
h4(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 4%heightof the MediaQuery height -
h40(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 40%heightof the MediaQuery height -
h48(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 48%heightof the MediaQuery height -
h56(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 56%heightof the MediaQuery height -
h60(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 60%heightof the MediaQuery height -
h64(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 64%heightof the MediaQuery height -
h8(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 8%heightof the MediaQuery height -
hFourFifth(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with four-fifth or 80%heightof the MediaQuery height -
hFull(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with fullheightof the MediaQuery height -
hHalf(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with half or 50%heightof the MediaQuery height -
hOneForth(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with one-forth or 25%heightof the MediaQuery height -
hOneThird(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with one-third or 33.33%heightof the MediaQuery height -
hPCT(
{required BuildContext context, required double heightPCT}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with a specifiedheightpercentage -
hThreeForth(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with three-forth or 75%heightof the MediaQuery height -
hTwoThird(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with two-third or 66.67%heightof the MediaQuery height -
w(
double width, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
All available widths -
w0(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 0%widthof the MediaQuery width -
w1(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 1%widthof the MediaQuery width -
w10(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 10%widthof the MediaQuery width -
w15(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 15%widthof the MediaQuery width -
w16(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 16%widthof the MediaQuery width -
w2(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 2%widthof the MediaQuery width -
w20(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 20%widthof the MediaQuery width -
w24(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 24%widthof the MediaQuery width -
w32(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 32%widthof the MediaQuery width -
w4(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 4%widthof the MediaQuery width -
w40(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 40%widthof the MediaQuery width -
w48(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 48%widthof the MediaQuery width -
w56(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 56%widthof the MediaQuery width -
w60(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 60%widthof the MediaQuery width -
w64(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 64%widthof the MediaQuery width -
w8(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 8%widthof the MediaQuery width -
wFourFifth(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with four-fifth or 80%widthof the MediaQuery width -
wFull(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with fullwidthof the MediaQuery width -
wh(
double width, double height) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
All Size Width - Height -
wh0(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 0%width&heightof the MediaQuery width & height -
wh1(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 1%width&heightof the MediaQuery width & height -
wh10(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 10%width&heightof the MediaQuery width & height -
wh15(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 15%width&heightof the MediaQuery width & height -
wh16(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 16%width&heightof the MediaQuery width & height -
wh2(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 2%width&heightof the MediaQuery width & height -
wh20(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 20%width&heightof the MediaQuery width & height -
wh24(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 24%width&heightof the MediaQuery width & height -
wh32(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 32%width&heightof the MediaQuery width & height -
wh4(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 4%width&heightof the MediaQuery width & height -
wh40(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 40%width&heightof the MediaQuery width & height -
wh48(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 48%width&heightof the MediaQuery width & height -
wh56(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 56%width&heightof the MediaQuery width & height -
wh60(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 60%width&heightof the MediaQuery width & height -
wh64(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 64%width&heightof the MediaQuery width & height -
wh8(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with 8%width&heightof the MediaQuery width & height -
wHalf(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with half or 50%widthof the MediaQuery width -
whFourFifth(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with four-fifth or 80%width&heightof the MediaQuery width & height -
whFull(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with fullwidth&heightof the MediaQuery width & height -
whHalf(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with half or 50%width&heightof the MediaQuery width & height -
whOneForth(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with one-forth or 25%width&heightof the MediaQuery width & height -
whOneThird(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with one-third or 33.33%width&heightof the MediaQuery width & height -
whPCT(
{required BuildContext context, required double widthPCT, required double heightPCT}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with a specifiedwidth&heightpercentage -
whThreeForth(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with three-forth or 75%width&heightof the MediaQuery width & height -
whTwoThird(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with two-third or 66.67%width&heightof the MediaQuery width & height -
wOneForth(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with one-forth or 25%widthof the MediaQuery width -
wOneThird(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with one-third or 33.33%widthof the MediaQuery width -
wPCT(
{required BuildContext context, required double widthPCT}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with a specifiedwidthpercentage -
wThreeForth(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with three-forth or 75%widthof the MediaQuery width -
wTwoThird(
BuildContext context, {Key? key}) → Widget -
Available on Widget, provided by the VxSizedBoxExtension extension
SizedBox widget with two-third or 66.67%widthof the MediaQuery width