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

View File

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

View File

@@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
// Using system fonts; no GoogleFonts dependency required
import 'app_theme.dart';
/// Extended theme data for consistent styling across the app
@@ -1366,7 +1366,8 @@ class ConduitShadows {
/// Typography scale following Conduit design tokens - Enhanced for production
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';
// Letter spacing values - Enhanced for better readability
@@ -1390,157 +1391,138 @@ class AppTypography {
static const double labelSmall = 12;
// Text styles following Conduit design - Enhanced for production
static final TextStyle displayLargeStyle = GoogleFonts.inter(
fontSize: displayLarge,
static final TextStyle displayLargeStyle = const TextStyle(
fontWeight: FontWeight.w700,
letterSpacing: -0.8,
height: 1.1,
);
).copyWith(fontSize: displayLarge);
static final TextStyle displayMediumStyle = GoogleFonts.inter(
fontSize: displayMedium,
static final TextStyle displayMediumStyle = const TextStyle(
fontWeight: FontWeight.w700,
letterSpacing: -0.6,
height: 1.2,
);
).copyWith(fontSize: displayMedium);
static final TextStyle bodyLargeStyle = GoogleFonts.inter(
fontSize: bodyLarge,
static final TextStyle bodyLargeStyle = const TextStyle(
fontWeight: FontWeight.w400,
letterSpacing: 0,
height: 1.6,
);
).copyWith(fontSize: bodyLarge);
static final TextStyle bodyMediumStyle = GoogleFonts.inter(
fontSize: bodyMedium,
static final TextStyle bodyMediumStyle = const TextStyle(
fontWeight: FontWeight.w400,
letterSpacing: 0,
height: 1.6,
);
).copyWith(fontSize: bodyMedium);
static final TextStyle codeStyle = GoogleFonts.sourceCodePro(
fontSize: bodySmall,
static final TextStyle codeStyle = const TextStyle(
fontWeight: FontWeight.w400,
letterSpacing: 0,
height: 1.5,
);
fontFamily: monospaceFontFamily,
).copyWith(fontSize: bodySmall);
// Additional styled text getters for convenience - Enhanced
static TextStyle get headlineLargeStyle => GoogleFonts.inter(
fontSize: headlineLarge,
static TextStyle get headlineLargeStyle => const TextStyle(
fontWeight: FontWeight.w700,
letterSpacing: -0.4,
height: 1.3,
);
).copyWith(fontSize: headlineLarge);
static TextStyle get headlineMediumStyle => GoogleFonts.inter(
fontSize: headlineMedium,
static TextStyle get headlineMediumStyle => const TextStyle(
fontWeight: FontWeight.w600,
letterSpacing: -0.2,
height: 1.3,
);
).copyWith(fontSize: headlineMedium);
static TextStyle get headlineSmallStyle => GoogleFonts.inter(
fontSize: headlineSmall,
static TextStyle get headlineSmallStyle => const TextStyle(
fontWeight: FontWeight.w600,
letterSpacing: 0,
height: 1.4,
);
).copyWith(fontSize: headlineSmall);
static TextStyle get bodySmallStyle => GoogleFonts.inter(
fontSize: bodySmall,
static TextStyle get bodySmallStyle => const TextStyle(
fontWeight: FontWeight.w400,
letterSpacing: 0,
height: 1.5,
);
).copyWith(fontSize: bodySmall);
// Enhanced text styles for chat messages
static TextStyle get chatMessageStyle => GoogleFonts.inter(
fontSize: bodyMedium,
static TextStyle get chatMessageStyle => const TextStyle(
fontWeight: FontWeight.w400,
letterSpacing: 0.1,
height: 1.6,
);
letterSpacing: 0.0,
height: 1.4,
).copyWith(fontSize: bodyMedium);
static TextStyle get chatCodeStyle => GoogleFonts.sourceCodePro(
fontSize: bodySmall,
static TextStyle get chatCodeStyle => const TextStyle(
fontWeight: FontWeight.w400,
letterSpacing: 0,
height: 1.5,
);
fontFamily: monospaceFontFamily,
).copyWith(fontSize: bodySmall);
// Enhanced label styles
static TextStyle get labelStyle => GoogleFonts.inter(
fontSize: labelMedium,
static TextStyle get labelStyle => const TextStyle(
fontWeight: FontWeight.w500,
letterSpacing: 0.2,
height: 1.4,
);
).copyWith(fontSize: labelMedium);
// Enhanced caption styles
static TextStyle get captionStyle => GoogleFonts.inter(
fontSize: labelSmall,
static TextStyle get captionStyle => const TextStyle(
fontWeight: FontWeight.w500,
letterSpacing: 0.5,
height: 1.3,
);
).copyWith(fontSize: labelSmall);
// Enhanced typography for better hierarchy
static TextStyle get micro => GoogleFonts.inter(
fontSize: 10,
static TextStyle get micro => const TextStyle(
fontWeight: FontWeight.w400,
letterSpacing: 0.1,
height: 1.4,
);
).copyWith(fontSize: 10);
static TextStyle get tiny => GoogleFonts.inter(
fontSize: 12,
static TextStyle get tiny => const TextStyle(
fontWeight: FontWeight.w400,
letterSpacing: 0.1,
height: 1.4,
);
).copyWith(fontSize: 12);
static TextStyle get small => GoogleFonts.inter(
fontSize: 14,
static TextStyle get small => const TextStyle(
fontWeight: FontWeight.w400,
letterSpacing: 0,
height: 1.5,
);
).copyWith(fontSize: 14);
static TextStyle get standard => GoogleFonts.inter(
fontSize: 16,
static TextStyle get standard => const TextStyle(
fontWeight: FontWeight.w400,
letterSpacing: 0,
height: 1.6,
);
).copyWith(fontSize: 16);
static TextStyle get large => GoogleFonts.inter(
fontSize: 18,
static TextStyle get large => const TextStyle(
fontWeight: FontWeight.w400,
letterSpacing: 0,
height: 1.6,
);
).copyWith(fontSize: 18);
static TextStyle get extraLarge => GoogleFonts.inter(
fontSize: 20,
static TextStyle get extraLarge => const TextStyle(
fontWeight: FontWeight.w400,
letterSpacing: 0,
height: 1.5,
);
).copyWith(fontSize: 20);
static TextStyle get huge => GoogleFonts.inter(
fontSize: 24,
static TextStyle get huge => const TextStyle(
fontWeight: FontWeight.w600,
letterSpacing: -0.2,
height: 1.3,
);
).copyWith(fontSize: 24);
static TextStyle get massive => GoogleFonts.inter(
fontSize: 32,
static TextStyle get massive => const TextStyle(
fontWeight: FontWeight.w700,
letterSpacing: -0.4,
height: 1.2,
);
).copyWith(fontSize: 32);
}
/// 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(
textStyle: AppTypography.chatMessageStyle.copyWith(
color: theme.textPrimary,
height: 1.3,
height: 1.45,
),
),
@@ -125,20 +125,23 @@ class ConduitMarkdownConfig {
H1Config(
style: AppTypography.headlineLargeStyle.copyWith(
color: theme.textPrimary,
height: 1.25,
),
),
H2Config(
style: AppTypography.headlineMediumStyle.copyWith(
color: theme.textPrimary,
height: 1.25,
),
),
H3Config(
style: AppTypography.headlineSmallStyle.copyWith(
color: theme.textPrimary,
height: 1.3,
),
),
// Blockquote
// Blockquote — keep default rendering for compatibility
BlockquoteConfig(),
// Code inline

View File

@@ -493,14 +493,6 @@ packages:
url: "https://pub.dev"
source: hosted
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:
dependency: transitive
description:

View File

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