Flutter iOS. Fonts looks different in debug simulator and release device

1,024

There is an option to scale Text in iOS settings (Settings -> General -> Accessibility -> Larger Text). This default OS solution, but if you want to block this inside your app you can do following

MaterialApp(
      builder: (context, child) {
        return MediaQuery(
          child: child,
          data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0),
        );
      },
)
Share:
1,024
Dima Portenko
Author by

Dima Portenko

Open-minded software developer :) My YouTube channel - https://www.youtube.com/channel/UCReKeeIMZywvQoaZPZKzQbQ/

Updated on December 08, 2022

Comments

  • Dima Portenko
    Dima Portenko over 1 year

    I've just noticed that Fonts looks different on the iOS simulator in debug mode and iOS device in release mode. It is kind of confusing. Any ideas why does it happen?

    enter image description here enter image description here

    • canister_exister
      canister_exister over 5 years
      Are using iPhone 7 device as same as simulator?
    • Dima Portenko
      Dima Portenko over 5 years
      @canister_exister yep, I’m using IPhone 7.
    • TonyMkenu
      TonyMkenu over 5 years
      check the "Text Size" - maybe is Larger Text, etc... :)
  • Dpedrinha
    Dpedrinha over 4 years
    Man apparently I have a lot of elder users with increased text size and if this solution of yours work I'll be so happy because I'm getting tons of complains about too big texts.
  • Coronon
    Coronon over 3 years
    Thank you so much for this hint. You just saved me a lot of headache.