Line data Source code
1 : // Copyright 2023 The terCAD team. All rights reserved.
2 : // Use of this source code is governed by a CC BY-NC-ND 4.0 license that can be found in the LICENSE file.
3 :
4 : import 'package:app_finance/_configs/custom_color_scheme.dart';
5 : import 'package:flutter/foundation.dart';
6 : import 'package:flutter/material.dart';
7 : import 'package:google_fonts/google_fonts.dart';
8 :
9 : extension CustomTextTheme on TextTheme {
10 4 : double letterSpacingOrNone(double letterSpacing) => kIsWeb ? 0.0 : letterSpacing;
11 :
12 4 : TextTheme? withCustom(String paletteType, Brightness brightness) {
13 12 : final color = AppColors(paletteType, brightness).palette.secondary;
14 4 : return copyWith(
15 4 : titleLarge: GoogleFonts.abel(
16 : fontSize: 32,
17 : fontWeight: FontWeight.w400,
18 : color: color,
19 4 : letterSpacing: letterSpacingOrNone(1.2),
20 : ),
21 4 : titleMedium: GoogleFonts.abel(
22 : fontSize: 18,
23 : fontWeight: FontWeight.w400,
24 : color: color,
25 4 : letterSpacing: letterSpacingOrNone(1.2),
26 : ),
27 4 : titleSmall: GoogleFonts.abel(
28 : fontSize: 12,
29 : fontWeight: FontWeight.w400,
30 : color: color,
31 4 : letterSpacing: letterSpacingOrNone(1.2),
32 : ),
33 4 : headlineLarge: GoogleFonts.abel(
34 : fontSize: 32,
35 : fontWeight: FontWeight.w400,
36 : color: color,
37 4 : letterSpacing: letterSpacingOrNone(1.2),
38 : ),
39 4 : headlineMedium: GoogleFonts.abel(
40 : fontSize: 14,
41 : fontWeight: FontWeight.w600,
42 4 : letterSpacing: letterSpacingOrNone(1.2),
43 : ),
44 4 : headlineSmall: GoogleFonts.abel(
45 : fontSize: 12,
46 : fontWeight: FontWeight.w600,
47 : color: color,
48 4 : letterSpacing: letterSpacingOrNone(1.2),
49 : ),
50 4 : bodyLarge: GoogleFonts.abel(
51 : fontSize: 16,
52 : fontWeight: FontWeight.w600,
53 : color: color,
54 4 : letterSpacing: letterSpacingOrNone(1.2),
55 : ),
56 4 : bodyMedium: GoogleFonts.abel(
57 : fontSize: 14,
58 : fontWeight: FontWeight.w400,
59 4 : letterSpacing: letterSpacingOrNone(1.2),
60 : ),
61 4 : bodySmall: GoogleFonts.abel(
62 : fontSize: 10,
63 : fontWeight: FontWeight.w600,
64 : color: color,
65 4 : letterSpacing: letterSpacingOrNone(1.6),
66 : ),
67 4 : labelLarge: GoogleFonts.abel(
68 : fontSize: 12,
69 : fontWeight: FontWeight.w600,
70 4 : letterSpacing: letterSpacingOrNone(1.2),
71 : ),
72 4 : labelMedium: GoogleFonts.abel(
73 : fontSize: 10,
74 : fontWeight: FontWeight.w600,
75 : color: color,
76 4 : letterSpacing: letterSpacingOrNone(1.2),
77 : ),
78 4 : labelSmall: GoogleFonts.abel(
79 : fontSize: 8,
80 : fontWeight: FontWeight.w600,
81 : color: color,
82 4 : letterSpacing: letterSpacingOrNone(1.2),
83 : ),
84 : );
85 : }
86 :
87 4 : TextStyle get tooltipSmall => GoogleFonts.robotoCondensed(
88 : fontSize: 12,
89 : fontWeight: FontWeight.w400,
90 6 : color: titleLarge?.color?.withOpacity(0.4),
91 2 : letterSpacing: letterSpacingOrNone(0.5),
92 : );
93 :
94 4 : TextStyle get tooltipMedium => GoogleFonts.robotoCondensed(
95 : fontSize: 16,
96 : fontWeight: FontWeight.w400,
97 6 : color: titleLarge?.color?.withOpacity(0.4),
98 2 : letterSpacing: letterSpacingOrNone(0.5),
99 : );
100 :
101 6 : TextStyle get numberLarge => GoogleFonts.robotoCondensed(
102 : fontSize: 32,
103 : fontWeight: FontWeight.w400,
104 6 : color: titleLarge?.color,
105 3 : letterSpacing: letterSpacingOrNone(0.5),
106 : );
107 :
108 6 : TextStyle get numberMedium => GoogleFonts.robotoCondensed(
109 : fontSize: 16,
110 : fontWeight: FontWeight.w400,
111 6 : color: titleLarge?.color,
112 3 : letterSpacing: letterSpacingOrNone(0.5),
113 : );
114 :
115 2 : TextStyle get numberSmall => GoogleFonts.robotoCondensed(
116 : fontSize: 10,
117 : fontWeight: FontWeight.w400,
118 2 : color: titleLarge?.color,
119 1 : letterSpacing: letterSpacingOrNone(0.5),
120 : );
121 : }
|