chore: remove google_fonts dependency and update typography to use system fonts

This commit is contained in:
cogwheel0
2025-08-28 10:12:59 +05:30
parent 7c4fb892b9
commit e265d35579
7 changed files with 72 additions and 90 deletions

View File

@@ -1092,7 +1092,7 @@ class _ChatPageState extends ConsumerState<ChatPage> {
.copyWith( .copyWith(
color: color:
context.conduitTheme.textPrimary, context.conduitTheme.textPrimary,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w600,
), ),
maxLines: 1, maxLines: 1,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
@@ -1220,7 +1220,7 @@ class _ChatPageState extends ConsumerState<ChatPage> {
.copyWith( .copyWith(
color: color:
context.conduitTheme.textPrimary, context.conduitTheme.textPrimary,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w600,
), ),
maxLines: 1, maxLines: 1,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,

View File

@@ -486,6 +486,13 @@ class _UserMessageBubbleState extends ConsumerState<UserMessageBubble>
color: context.conduitTheme.chatBubbleUserText, color: context.conduitTheme.chatBubbleUserText,
), ),
softWrap: true, softWrap: true,
textAlign: TextAlign.left,
textHeightBehavior: const TextHeightBehavior(
applyHeightToFirstAscent: false,
applyHeightToLastDescent: false,
leadingDistribution:
TextLeadingDistribution.even,
),
), ),
), ),
), ),

View File

@@ -1,6 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:flutter_animate/flutter_animate.dart'; import 'package:flutter_animate/flutter_animate.dart';
import 'theme_extensions.dart'; import 'theme_extensions.dart';
@@ -99,10 +98,9 @@ class AppTheme {
snackBarTheme: SnackBarThemeData( snackBarTheme: SnackBarThemeData(
behavior: SnackBarBehavior.floating, behavior: SnackBarBehavior.floating,
backgroundColor: neutral900.withValues(alpha: 0.92), backgroundColor: neutral900.withValues(alpha: 0.92),
contentTextStyle: GoogleFonts.inter( contentTextStyle: const TextStyle(
color: neutral50, color: neutral50,
fontSize: AppTypography.bodyMedium, ).copyWith(fontSize: AppTypography.bodyMedium),
),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(AppBorderRadius.snackbar), borderRadius: BorderRadius.circular(AppBorderRadius.snackbar),
), ),
@@ -132,7 +130,8 @@ class AppTheme {
vertical: Spacing.sm, vertical: Spacing.sm,
), ),
), ),
textTheme: GoogleFonts.interTextTheme(), // Use platform default system font text theme
textTheme: ThemeData.light().textTheme,
extensions: const [ConduitThemeExtension.auroraLight], extensions: const [ConduitThemeExtension.auroraLight],
); );
@@ -197,10 +196,9 @@ class AppTheme {
snackBarTheme: SnackBarThemeData( snackBarTheme: SnackBarThemeData(
behavior: SnackBarBehavior.floating, behavior: SnackBarBehavior.floating,
backgroundColor: neutral800.withValues(alpha: 0.92), backgroundColor: neutral800.withValues(alpha: 0.92),
contentTextStyle: GoogleFonts.inter( contentTextStyle: const TextStyle(
color: neutral50, color: neutral50,
fontSize: AppTypography.bodyMedium, ).copyWith(fontSize: AppTypography.bodyMedium),
),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(AppBorderRadius.snackbar), borderRadius: BorderRadius.circular(AppBorderRadius.snackbar),
), ),
@@ -230,7 +228,8 @@ class AppTheme {
vertical: Spacing.sm, vertical: Spacing.sm,
), ),
), ),
textTheme: GoogleFonts.interTextTheme(ThemeData.dark().textTheme), // Use platform default system font text theme
textTheme: ThemeData.dark().textTheme,
extensions: const [ConduitThemeExtension.dark], extensions: const [ConduitThemeExtension.dark],
); );

View File

@@ -1,5 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart'; // Using system fonts; no GoogleFonts dependency required
import 'app_theme.dart'; import 'app_theme.dart';
/// Extended theme data for consistent styling across the app /// Extended theme data for consistent styling across the app
@@ -1366,7 +1366,8 @@ class ConduitShadows {
/// Typography scale following Conduit design tokens - Enhanced for production /// Typography scale following Conduit design tokens - Enhanced for production
class AppTypography { class AppTypography {
static const String fontFamily = 'Inter'; // Primary UI font now uses the platform default system font
static const String fontFamily = '';
static const String monospaceFontFamily = 'SF Mono'; static const String monospaceFontFamily = 'SF Mono';
// Letter spacing values - Enhanced for better readability // Letter spacing values - Enhanced for better readability
@@ -1390,157 +1391,138 @@ class AppTypography {
static const double labelSmall = 12; static const double labelSmall = 12;
// Text styles following Conduit design - Enhanced for production // Text styles following Conduit design - Enhanced for production
static final TextStyle displayLargeStyle = GoogleFonts.inter( static final TextStyle displayLargeStyle = const TextStyle(
fontSize: displayLarge,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
letterSpacing: -0.8, letterSpacing: -0.8,
height: 1.1, height: 1.1,
); ).copyWith(fontSize: displayLarge);
static final TextStyle displayMediumStyle = GoogleFonts.inter( static final TextStyle displayMediumStyle = const TextStyle(
fontSize: displayMedium,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
letterSpacing: -0.6, letterSpacing: -0.6,
height: 1.2, height: 1.2,
); ).copyWith(fontSize: displayMedium);
static final TextStyle bodyLargeStyle = GoogleFonts.inter( static final TextStyle bodyLargeStyle = const TextStyle(
fontSize: bodyLarge,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
letterSpacing: 0, letterSpacing: 0,
height: 1.6, height: 1.6,
); ).copyWith(fontSize: bodyLarge);
static final TextStyle bodyMediumStyle = GoogleFonts.inter( static final TextStyle bodyMediumStyle = const TextStyle(
fontSize: bodyMedium,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
letterSpacing: 0, letterSpacing: 0,
height: 1.6, height: 1.6,
); ).copyWith(fontSize: bodyMedium);
static final TextStyle codeStyle = GoogleFonts.sourceCodePro( static final TextStyle codeStyle = const TextStyle(
fontSize: bodySmall,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
letterSpacing: 0, letterSpacing: 0,
height: 1.5, height: 1.5,
); fontFamily: monospaceFontFamily,
).copyWith(fontSize: bodySmall);
// Additional styled text getters for convenience - Enhanced // Additional styled text getters for convenience - Enhanced
static TextStyle get headlineLargeStyle => GoogleFonts.inter( static TextStyle get headlineLargeStyle => const TextStyle(
fontSize: headlineLarge,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
letterSpacing: -0.4, letterSpacing: -0.4,
height: 1.3, height: 1.3,
); ).copyWith(fontSize: headlineLarge);
static TextStyle get headlineMediumStyle => GoogleFonts.inter( static TextStyle get headlineMediumStyle => const TextStyle(
fontSize: headlineMedium,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.2, letterSpacing: -0.2,
height: 1.3, height: 1.3,
); ).copyWith(fontSize: headlineMedium);
static TextStyle get headlineSmallStyle => GoogleFonts.inter( static TextStyle get headlineSmallStyle => const TextStyle(
fontSize: headlineSmall,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: 0, letterSpacing: 0,
height: 1.4, height: 1.4,
); ).copyWith(fontSize: headlineSmall);
static TextStyle get bodySmallStyle => GoogleFonts.inter( static TextStyle get bodySmallStyle => const TextStyle(
fontSize: bodySmall,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
letterSpacing: 0, letterSpacing: 0,
height: 1.5, height: 1.5,
); ).copyWith(fontSize: bodySmall);
// Enhanced text styles for chat messages // Enhanced text styles for chat messages
static TextStyle get chatMessageStyle => GoogleFonts.inter( static TextStyle get chatMessageStyle => const TextStyle(
fontSize: bodyMedium,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
letterSpacing: 0.1, letterSpacing: 0.0,
height: 1.6, height: 1.4,
); ).copyWith(fontSize: bodyMedium);
static TextStyle get chatCodeStyle => GoogleFonts.sourceCodePro( static TextStyle get chatCodeStyle => const TextStyle(
fontSize: bodySmall,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
letterSpacing: 0, letterSpacing: 0,
height: 1.5, height: 1.5,
); fontFamily: monospaceFontFamily,
).copyWith(fontSize: bodySmall);
// Enhanced label styles // Enhanced label styles
static TextStyle get labelStyle => GoogleFonts.inter( static TextStyle get labelStyle => const TextStyle(
fontSize: labelMedium,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
letterSpacing: 0.2, letterSpacing: 0.2,
height: 1.4, height: 1.4,
); ).copyWith(fontSize: labelMedium);
// Enhanced caption styles // Enhanced caption styles
static TextStyle get captionStyle => GoogleFonts.inter( static TextStyle get captionStyle => const TextStyle(
fontSize: labelSmall,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
letterSpacing: 0.5, letterSpacing: 0.5,
height: 1.3, height: 1.3,
); ).copyWith(fontSize: labelSmall);
// Enhanced typography for better hierarchy // Enhanced typography for better hierarchy
static TextStyle get micro => GoogleFonts.inter( static TextStyle get micro => const TextStyle(
fontSize: 10,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
letterSpacing: 0.1, letterSpacing: 0.1,
height: 1.4, height: 1.4,
); ).copyWith(fontSize: 10);
static TextStyle get tiny => GoogleFonts.inter( static TextStyle get tiny => const TextStyle(
fontSize: 12,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
letterSpacing: 0.1, letterSpacing: 0.1,
height: 1.4, height: 1.4,
); ).copyWith(fontSize: 12);
static TextStyle get small => GoogleFonts.inter( static TextStyle get small => const TextStyle(
fontSize: 14,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
letterSpacing: 0, letterSpacing: 0,
height: 1.5, height: 1.5,
); ).copyWith(fontSize: 14);
static TextStyle get standard => GoogleFonts.inter( static TextStyle get standard => const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
letterSpacing: 0, letterSpacing: 0,
height: 1.6, height: 1.6,
); ).copyWith(fontSize: 16);
static TextStyle get large => GoogleFonts.inter( static TextStyle get large => const TextStyle(
fontSize: 18,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
letterSpacing: 0, letterSpacing: 0,
height: 1.6, height: 1.6,
); ).copyWith(fontSize: 18);
static TextStyle get extraLarge => GoogleFonts.inter( static TextStyle get extraLarge => const TextStyle(
fontSize: 20,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
letterSpacing: 0, letterSpacing: 0,
height: 1.5, height: 1.5,
); ).copyWith(fontSize: 20);
static TextStyle get huge => GoogleFonts.inter( static TextStyle get huge => const TextStyle(
fontSize: 24,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.2, letterSpacing: -0.2,
height: 1.3, height: 1.3,
); ).copyWith(fontSize: 24);
static TextStyle get massive => GoogleFonts.inter( static TextStyle get massive => const TextStyle(
fontSize: 32,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
letterSpacing: -0.4, letterSpacing: -0.4,
height: 1.2, height: 1.2,
); ).copyWith(fontSize: 32);
} }
/// Consistent icon sizes - Enhanced for production with better hierarchy /// Consistent icon sizes - Enhanced for production with better hierarchy

View File

@@ -113,11 +113,11 @@ class ConduitMarkdownConfig {
), ),
), ),
// Paragraph config // Paragraphs — improve readability and spacing on mobile
PConfig( PConfig(
textStyle: AppTypography.chatMessageStyle.copyWith( textStyle: AppTypography.chatMessageStyle.copyWith(
color: theme.textPrimary, color: theme.textPrimary,
height: 1.3, height: 1.45,
), ),
), ),
@@ -125,20 +125,23 @@ class ConduitMarkdownConfig {
H1Config( H1Config(
style: AppTypography.headlineLargeStyle.copyWith( style: AppTypography.headlineLargeStyle.copyWith(
color: theme.textPrimary, color: theme.textPrimary,
height: 1.25,
), ),
), ),
H2Config( H2Config(
style: AppTypography.headlineMediumStyle.copyWith( style: AppTypography.headlineMediumStyle.copyWith(
color: theme.textPrimary, color: theme.textPrimary,
height: 1.25,
), ),
), ),
H3Config( H3Config(
style: AppTypography.headlineSmallStyle.copyWith( style: AppTypography.headlineSmallStyle.copyWith(
color: theme.textPrimary, color: theme.textPrimary,
height: 1.3,
), ),
), ),
// Blockquote // Blockquote — keep default rendering for compatibility
BlockquoteConfig(), BlockquoteConfig(),
// Code inline // Code inline

View File

@@ -493,14 +493,6 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.3" version: "2.1.3"
google_fonts:
dependency: "direct main"
description:
name: google_fonts
sha256: b1ac0fe2832c9cc95e5e88b57d627c5e68c223b9657f4b96e1487aa9098c7b82
url: "https://pub.dev"
source: hosted
version: "6.2.1"
graphs: graphs:
dependency: transitive dependency: transitive
description: description:

View File

@@ -53,7 +53,6 @@ dependencies:
cupertino_icons: ^1.0.8 cupertino_icons: ^1.0.8
json_annotation: ^4.9.0 json_annotation: ^4.9.0
freezed_annotation: ^3.0.0 freezed_annotation: ^3.0.0
google_fonts: ^6.2.1
wakelock_plus: ^1.2.10 wakelock_plus: ^1.2.10
share_plus: ^11.1.0 share_plus: ^11.1.0