@@ -121,32 +121,28 @@ TextTheme _customizeTextTheme(
121
121
// Corrected return type to match GoogleFonts functions (positional optional)
122
122
TextTheme Function ([TextTheme ? ]) _getGoogleFontTextTheme (String ? fontFamily) {
123
123
print ('[_getGoogleFontTextTheme] Received fontFamily: $fontFamily ' );
124
- // Map font family names (as used in AppBloc mapping) to GoogleFonts functions
125
- if (fontFamily == GoogleFonts .roboto ().fontFamily) {
126
- print ('[_getGoogleFontTextTheme] Returning GoogleFonts.robotoTextTheme' );
127
- return GoogleFonts .robotoTextTheme;
124
+ switch (fontFamily) {
125
+ case 'Roboto' :
126
+ print ('[_getGoogleFontTextTheme] Returning GoogleFonts.robotoTextTheme' );
127
+ return GoogleFonts .robotoTextTheme;
128
+ case 'OpenSans' :
129
+ print ('[_getGoogleFontTextTheme] Returning GoogleFonts.openSansTextTheme' );
130
+ return GoogleFonts .openSansTextTheme;
131
+ case 'Lato' :
132
+ print ('[_getGoogleFontTextTheme] Returning GoogleFonts.latoTextTheme' );
133
+ return GoogleFonts .latoTextTheme;
134
+ case 'Montserrat' :
135
+ print ('[_getGoogleFontTextTheme] Returning GoogleFonts.montserratTextTheme' );
136
+ return GoogleFonts .montserratTextTheme;
137
+ case 'Merriweather' :
138
+ print ('[_getGoogleFontTextTheme] Returning GoogleFonts.merriweatherTextTheme' );
139
+ return GoogleFonts .merriweatherTextTheme;
140
+ case 'SystemDefault' :
141
+ case null :
142
+ default :
143
+ print ('[_getGoogleFontTextTheme] Defaulting to GoogleFonts.notoSansTextTheme for input: $fontFamily ' );
144
+ return GoogleFonts .notoSansTextTheme;
128
145
}
129
- if (fontFamily == GoogleFonts .openSans ().fontFamily) {
130
- print ('[_getGoogleFontTextTheme] Returning GoogleFonts.openSansTextTheme' );
131
- return GoogleFonts .openSansTextTheme;
132
- }
133
- if (fontFamily == GoogleFonts .lato ().fontFamily) {
134
- print ('[_getGoogleFontTextTheme] Returning GoogleFonts.latoTextTheme' );
135
- return GoogleFonts .latoTextTheme;
136
- }
137
- if (fontFamily == GoogleFonts .montserrat ().fontFamily) {
138
- print ('[_getGoogleFontTextTheme] Returning GoogleFonts.montserratTextTheme' );
139
- return GoogleFonts .montserratTextTheme;
140
- }
141
- if (fontFamily == GoogleFonts .merriweather ().fontFamily) {
142
- print ('[_getGoogleFontTextTheme] Returning GoogleFonts.merriweatherTextTheme' );
143
- return GoogleFonts .merriweatherTextTheme;
144
- }
145
- // Add mappings for other AppFontType values if needed
146
-
147
- // Default fallback if fontFamily is null or not recognized
148
- print ('[_getGoogleFontTextTheme] Defaulting to GoogleFonts.notoSansTextTheme' );
149
- return GoogleFonts .notoSansTextTheme;
150
146
}
151
147
152
148
/// Defines the application's light theme using FlexColorScheme.
0 commit comments