Sometimes the dimensions of your design needs relative. FractionallySizedBox item allows you to adjust the size of the child for a small fraction of the total available space.
Scaffold(
body: Center(
child: FractionallySizedBox(
widthFactor: 0.8,
heightFactor: 0.8,
child: Container(
color: Colors.red,
),
),
),
);
The above Container
width and height to the device 80%
.