Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing the screen dimensions in Flutter web app

I'm building a web app with Flutter, but I want to mimic an iPhone screen view. I know that resizing the window can sort of achieve this effect, but is there a way to wrap all the contents in a frame of a phone screen graphic, or change the dimensions of the MaterialApp so that it is contained within the screen dimensions of a phone and doesn't fill up the whole window?

like image 688
bhinton Avatar asked Mar 03 '23 06:03

bhinton


1 Answers

You can wrap MaterialApp in a SizedBox to restrict its size. Then you can use it anywhere you want just like a regular widget.

example

like image 82
Pegasis Avatar answered Mar 05 '23 05:03

Pegasis