LCOV - code coverage report
Current view: top level - lib/_configs - custom_text_theme.dart (source / functions) Hit Total Coverage
Test: lcov.info Lines: 43 43 100.0 %
Date: 2024-10-04 11:12:13 Functions: 0 0 -

          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           1 :   double letterSpacingOrNone(double letterSpacing) => kIsWeb ? 0.0 : letterSpacing;
      11             : 
      12           1 :   TextTheme? withCustom(String paletteType, Brightness brightness) {
      13           3 :     final color = AppColors(paletteType, brightness).palette.secondary;
      14           1 :     return copyWith(
      15           1 :       titleLarge: GoogleFonts.abel(
      16             :         fontSize: 32,
      17             :         fontWeight: FontWeight.w400,
      18             :         color: color,
      19           1 :         letterSpacing: letterSpacingOrNone(1.2),
      20             :       ),
      21           1 :       titleMedium: GoogleFonts.abel(
      22             :         fontSize: 18,
      23             :         fontWeight: FontWeight.w400,
      24             :         color: color,
      25           1 :         letterSpacing: letterSpacingOrNone(1.2),
      26             :       ),
      27           1 :       titleSmall: GoogleFonts.abel(
      28             :         fontSize: 12,
      29             :         fontWeight: FontWeight.w400,
      30             :         color: color,
      31           1 :         letterSpacing: letterSpacingOrNone(1.2),
      32             :       ),
      33           1 :       headlineLarge: GoogleFonts.abel(
      34             :         fontSize: 32,
      35             :         fontWeight: FontWeight.w400,
      36             :         color: color,
      37           1 :         letterSpacing: letterSpacingOrNone(1.2),
      38             :       ),
      39           1 :       headlineMedium: GoogleFonts.abel(
      40             :         fontSize: 14,
      41             :         fontWeight: FontWeight.w600,
      42           1 :         letterSpacing: letterSpacingOrNone(1.2),
      43             :       ),
      44           1 :       headlineSmall: GoogleFonts.abel(
      45             :         fontSize: 12,
      46             :         fontWeight: FontWeight.w600,
      47             :         color: color,
      48           1 :         letterSpacing: letterSpacingOrNone(1.2),
      49             :       ),
      50           1 :       bodyLarge: GoogleFonts.abel(
      51             :         fontSize: 16,
      52             :         fontWeight: FontWeight.w600,
      53             :         color: color,
      54           1 :         letterSpacing: letterSpacingOrNone(1.2),
      55             :       ),
      56           1 :       bodyMedium: GoogleFonts.abel(
      57             :         fontSize: 14,
      58             :         fontWeight: FontWeight.w400,
      59           1 :         letterSpacing: letterSpacingOrNone(1.2),
      60             :       ),
      61           1 :       bodySmall: GoogleFonts.abel(
      62             :         fontSize: 10,
      63             :         fontWeight: FontWeight.w600,
      64             :         color: color,
      65           1 :         letterSpacing: letterSpacingOrNone(1.6),
      66             :       ),
      67           1 :       labelLarge: GoogleFonts.abel(
      68             :         fontSize: 12,
      69             :         fontWeight: FontWeight.w600,
      70           1 :         letterSpacing: letterSpacingOrNone(1.2),
      71             :       ),
      72           1 :       labelMedium: GoogleFonts.abel(
      73             :         fontSize: 10,
      74             :         fontWeight: FontWeight.w600,
      75             :         color: color,
      76           1 :         letterSpacing: letterSpacingOrNone(1.2),
      77             :       ),
      78           1 :       labelSmall: GoogleFonts.abel(
      79             :         fontSize: 8,
      80             :         fontWeight: FontWeight.w600,
      81             :         color: color,
      82           1 :         letterSpacing: letterSpacingOrNone(1.2),
      83             :       ),
      84             :     );
      85             :   }
      86             : 
      87           2 :   TextStyle get tooltipSmall => GoogleFonts.robotoCondensed(
      88             :         fontSize: 12,
      89             :         fontWeight: FontWeight.w400,
      90           3 :         color: titleLarge?.color?.withOpacity(0.4),
      91           1 :         letterSpacing: letterSpacingOrNone(0.5),
      92             :       );
      93             : 
      94           2 :   TextStyle get tooltipMedium => GoogleFonts.robotoCondensed(
      95             :         fontSize: 16,
      96             :         fontWeight: FontWeight.w400,
      97           3 :         color: titleLarge?.color?.withOpacity(0.4),
      98           1 :         letterSpacing: letterSpacingOrNone(0.5),
      99             :       );
     100             : 
     101           2 :   TextStyle get numberLarge => GoogleFonts.robotoCondensed(
     102             :         fontSize: 32,
     103             :         fontWeight: FontWeight.w400,
     104           2 :         color: titleLarge?.color,
     105           1 :         letterSpacing: letterSpacingOrNone(0.5),
     106             :       );
     107             : 
     108           2 :   TextStyle get numberMedium => GoogleFonts.robotoCondensed(
     109             :         fontSize: 16,
     110             :         fontWeight: FontWeight.w400,
     111           2 :         color: titleLarge?.color,
     112           1 :         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             : }

Generated by: LCOV version 1.14