'Disable high DPI scaling for flutter on desktop

Is it possible to disable the high dpi scaling for a flutter app? My layout works well, but when the scale factor is set to something very high the app becomes tiny.

Or is there atleast a way to take the scaling into account?



Solution 1:[1]

I am now using the responsive framework package. This solves the scaling problems for me when setting defaultScale: true. When adding breakpoints the behavior can be customized.

I am using it in my MaterialApp.OnGenerateRoute:

PageRouteBuilder switchScreen (Widget screen) =>
  PageRouteBuilder(
    pageBuilder: (_, __, ___) => ResponsiveWrapper.builder(
      screen,
      defaultScale: true,
      breakpoints: [
        const ResponsiveBreakpoint.resize(450, name: MOBILE),
        const ResponsiveBreakpoint.autoScale(800, name: TABLET),
        const ResponsiveBreakpoint.autoScale(1000, name: TABLET),
        const ResponsiveBreakpoint.resize(1200, name: DESKTOP),
        const ResponsiveBreakpoint.autoScale(2460, name: "4K"),
      ],
    ),
    settings: settings,
    transitionsBuilder: (_, a, __, c) =>
      FadeTransition(opacity: a, child: c)
  )
...

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 CaptainDario