Home > front end >  How to Set Different fonts for different locales in Flutter
How to Set Different fonts for different locales in Flutter

Time:02-20

Is there any way to set different fonts for different locals? English font is the default for my app, but I need a different font for my Arabic locale.

CodePudding user response:

You can listen for device local changes and change the font-family respectively.

CodePudding user response:

Use Locale and Theme

This problem requires two things:

  • Getting the system locale
  • Providing a Theme with correct values depending on locale.

The locale can easily be retrieved by calling window.locale from dart:ui. There is an quite Default font Custom font

  • Related