Skip to content

Can't change fontFamily using copyWith() #172

Closed Answered by rydmike
GitGud31 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @GitGud31,

Thanks for your question. It is a good one and fontFamily can indeed be confusing. Let me try to explain why.

The observation and analyzer is of course correct, and even expected. There is no fontFamily property in your lightFlexTheme since it is a ThemeData object.

The line:

final lightFlexTheme = FlexThemeData.light(..);

Returns a ThemeData object and ThemeData object does not have a property fontFamily. This is a feature of Flutter SDK, not FlexColorScheme.

This can feel confusing, since the ThemeData() factory has a fontFamily parameter (and for convenience, so does FlexThemeData or actually the FlexColorScheme class it uses), but the produced ThemeData object does not h…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@GitGud31
Comment options

Answer selected by GitGud31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question This issue is a usage question and will be moved to the Discussions section. works as expected Reported issue is not a bug, everything works as expected and designed
2 participants
Converted from issue

This discussion was converted from issue #171 on July 17, 2023 11:57.