Flutter - how get default system font?

1.1k views Asked by At

I using custom font for my Flutter app:

return MaterialApp (
      theme: ThemeData(
        fontFamily: "MyFont" 
      ) 
   )

but in one place of application I need to use "system font". this is especially important for iOS (Sf Pro). If I understand correctly, this is the system font for iOS. But how can I use "system font" if I already use "custom font" at application level?

I tried:

final fontFamily = DefaultTextStyle.of(context).style!.fontFamily;

But this code return "MyFont".

also I tried importing from apple site. but there is only one big SF-Pro.ttf(8Mb) file inside the image. Not - SFPro-Regular.ttf, SFPro-SemiBold.ttf ... Flutter does not support .otf files.

How to solve this problem? any advice I will be grateful

0

There are 0 answers