Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theme font #5

Closed
chrisvidal opened this issue Jul 9, 2021 · 1 comment
Closed

Theme font #5

chrisvidal opened this issue Jul 9, 2021 · 1 comment

Comments

@chrisvidal
Copy link

Really love the concept of this framework and I am testing it on a project. Thanks for the good stuff.

final TextStyle appThemeFont = GoogleFonts.montserrat();

How can I switch the google font to a TTF font available from my assets folder in the theme file?

@agordn52
Copy link
Contributor

Hi Chris,

Thanks for your initial feedback.

If you want to use a custom font in your project, you can use the TextStyle class like the below example.

// file: lib/config/app_theme.dart
...
TextStyle appThemeFont = TextStyle(fontFamily: "ZenTokyoZoo");

Just make sure that the "fontFamily" has been added to your pubspec.yaml file as per the flutter cookbook example. https://flutter.dev/docs/cookbook/design/fonts#2-declare-the-font-in-the-pubspec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants