0

I am developing for an app for mobile devices and android tv(48 inches TV). I adjust fontSize, widget sizes using MediaQuery. Is there any better way to do these things?

static double width(BuildContext context) => MediaQuery.of(context).size.width;

height: height * 1 / 32,

textSize: height * 1 / 32

Line > Container widget

CustomLine(
              width: width * (1 / 8),
              height: height * (1 / 512),
              color: Palette.white,
            ),
BIS Tech
  • 17,000
  • 12
  • 99
  • 148

2 Answers2

0

It depends if you want the size with or without the safe Area :

https://stackoverflow.com/a/57237870/12937274

You can also try that:

 import 'dart:ui';

window.physicalSize;
0

I have never developed anything for such a screen, but I have used the auto_size_text package in the past to easily size text automatically based on available space, and it works really well. With this package, you don't need to handle the sizings explicitly for every Text.

Another way of doing it could be to use the LayoutBuilder class to get the available space around your Text widget, and handle the proper sizing yourself.

drogel
  • 2,567
  • 2
  • 13
  • 22