alexlipa
alexlipa

Reputation: 1291

Flutter web font size debug vs release mode

When I run the exact same code in Flutter debug mode vs release mode I get that the fonts in release mode are smaller.

I use Roboto Google font from https://pub.dev/packages/google_fonts

Any idea what is happening or how to debug this?

Upvotes: 0

Views: 111

Answers (1)

raju av
raju av

Reputation: 1

Use media query as bellow:

@override Widget build(BuildContext context) { return MaterialApp( builder: (context, child) { final mediaQueryData = MediaQuery.of(context); final scale = mediaQueryData.textScaleFactor.clamp(1.01, 1.1); return MediaQuery( data: MediaQuery.of(context).copyWith(textScaleFactor: scale), child: child!); }); }

Upvotes: -1

Related Questions