We have a phone application and wish to release to tablets as well, but we want to limit the app on tablet to look like on a biggest phone. Just width would be fine.
Is there an option to limit the screen size for the entire app? Also, when I call MediaQuery size.width is that dpi or pixels or what?
It seems to me that I would have to go to everyscreen and put them in a container with max width but I was interested in other options.
This is all for Flutter.
If you want to limit your app to fixed max width, you could simply wrap the material app inside container with fixed max width.
Example
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Center(
child: Container(
constraints: const BoxConstraints(maxWidth: 700),
child: MaterialApp(
title: "Fixed width app"
),
),
);
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With