Skip to content

Commit e9564ea

Browse files
committed
🎨 style(fonts): Added fonts and text styles to the app's TextTheme
1 parent 996a336 commit e9564ea

File tree

3 files changed

+23
-63
lines changed

3 files changed

+23
-63
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export 'assets.gen.dart';
2+
export 'fonts.gen.dart';

‎packages/ui_common/lib/src/theme/app_fonts.dart

Lines changed: 16 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -13,65 +13,22 @@ class AppFonts {
1313
/// The Anta font family
1414
static const String anta = 'packages/$package/Anta';
1515

16-
1716
/// App text theme
18-
static TextTheme textTheme = TextTheme(
19-
bodySmall: TextStyle(
20-
fontFamily: AppFonts.anta,
21-
fontSize: 12.sp,
22-
fontWeight: FontWeight.w400,
23-
color: AppColors.textColor,
24-
),
25-
bodyMedium: TextStyle(
26-
fontFamily: AppFonts.anta,
27-
fontSize: 14.sp,
28-
),
29-
bodyLarge: TextStyle(
30-
fontFamily: AppFonts.anta,
31-
fontWeight: FontWeight.w500,
32-
fontSize: 16.sp,
33-
),
34-
titleMedium: TextStyle(
35-
fontFamily: AppFonts.anta,
36-
fontSize: 20.sp,
37-
fontWeight: FontWeight.w600,
38-
),
39-
titleSmall: TextStyle(
40-
fontFamily: AppFonts.anta,
41-
fontSize: 18.sp,
42-
),
43-
titleLarge: TextStyle(
44-
fontFamily: AppFonts.anta,
45-
fontSize: 22.sp,
46-
letterSpacing: 1,
47-
color: AppColors.textColor,
48-
),
49-
headlineSmall: TextStyle(
50-
fontSize: 26.sp,
51-
fontFamily: AppFonts.anta,
52-
color: AppColors.textColor,
53-
),
54-
headlineMedium: TextStyle(
55-
fontSize: 34.sp,
56-
fontFamily: AppFonts.anta,
57-
color: AppColors.textColor,
58-
),
59-
headlineLarge: TextStyle(
60-
fontSize: 40.sp,
61-
fontFamily: AppFonts.anta,
62-
color: AppColors.primaryColor,
63-
),
64-
displayMedium: TextStyle(
65-
fontSize: 45.sp,
66-
fontFamily: AppFonts.anta,
67-
color: AppColors.textColor,
68-
),
69-
displayLarge: TextStyle(
70-
fontSize: 55.sp,
71-
fontFamily: AppFonts.anta,
72-
color: AppColors.primaryColor,
73-
),
74-
).apply(
75-
bodyColor: AppColors.textColor,
17+
static TextTheme textTheme = TextTheme(
18+
labelSmall: TextStyle(fontFamily: AppFonts.anta, fontSize: 11.sp),
19+
labelMedium: TextStyle(fontFamily: AppFonts.anta, fontSize: 12.sp),
20+
labelLarge: TextStyle(fontFamily: AppFonts.anta, fontSize: 14.sp),
21+
bodySmall: TextStyle(fontFamily: AppFonts.anta, fontSize: 12.sp),
22+
bodyMedium: TextStyle(fontFamily: AppFonts.anta, fontSize: 14.sp),
23+
bodyLarge: TextStyle(fontFamily: AppFonts.anta, fontSize: 16.sp),
24+
titleSmall: TextStyle(fontFamily: AppFonts.anta, fontSize: 14.sp),
25+
titleMedium: TextStyle(fontFamily: AppFonts.anta, fontSize: 16.sp),
26+
titleLarge: TextStyle(fontFamily: AppFonts.anta, fontSize: 22.sp),
27+
headlineSmall: TextStyle(fontFamily: AppFonts.anta, fontSize: 24.sp),
28+
headlineMedium: TextStyle(fontFamily: AppFonts.anta, fontSize: 28.sp),
29+
headlineLarge: TextStyle(fontFamily: AppFonts.anta, fontSize: 32.sp),
30+
displaySmall: TextStyle(fontFamily: AppFonts.anta, fontSize: 36.sp),
31+
displayMedium: TextStyle(fontFamily: AppFonts.anta, fontSize: 45.sp),
32+
displayLarge: TextStyle(fontFamily: AppFonts.anta, fontSize: 57.sp),
7633
);
7734
}

‎packages/ui_common/pubspec.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ flutter_gen:
2626
output: lib/src/assets/
2727
integrations:
2828
lottie: true
29+
fonts: false
2930
assets:
3031
outputs:
3132
package_parameter_enabled: true
@@ -36,7 +37,7 @@ flutter:
3637
- assets/images/
3738
- assets/lottie/
3839

39-
# fonts:
40-
# - family: Comic Neue
41-
# fonts:
42-
# - asset: assets/fonts/Comic-Neue.ttf
40+
fonts:
41+
- family: Anta
42+
fonts:
43+
- asset: assets/fonts/Anta-Regular.ttf

0 commit comments

Comments
 (0)