Skip to content

feat(very_good_app_ui): add responsive typography system#520

Open
juanRodriguez17 wants to merge 6 commits intomainfrom
feat/very-good-app-ui-text-styles
Open

feat(very_good_app_ui): add responsive typography system#520
juanRodriguez17 wants to merge 6 commits intomainfrom
feat/very-good-app-ui-text-styles

Conversation

@juanRodriguez17
Copy link
Copy Markdown

@juanRodriguez17 juanRodriguez17 commented Apr 23, 2026

Description

  • Add AppTextStyles with desktop and mobile static TextStyle constants covering the Material 3 type scale
  • Add desktopTextTheme, mobileTextTheme getters and a getResponsiveTextTheme(BuildContext) helper (with a defined breakpoint)
  • Register AppTextStyles as a ThemeExtension in both light and dark AppTheme
  • Add test coverage

Issue #521

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore
  • 🧪 Test

@juanRodriguez17 juanRodriguez17 self-assigned this Apr 24, 2026
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we delete this file?

static const TextStyle displayLargeDesktop = TextStyle(
fontSize: 48,
fontWeight: FontWeight.w700,
height: 56 / 48,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't we add the value directly instead of performing an operation? same for the ones below


/// Returns the appropriate TextTheme based on screen width.
/// Uses 600px as the breakpoint (same as ResponsiveScaffold).
static TextTheme getResponsiveTextTheme(BuildContext context) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we avoid passing BuildContext here? since it's a huge object that changes rapidly, we want to rely directly on specific properties of it like Size

Comment on lines +305 to +310
/// ============ THEME EXTENSION ============
@override
AppTextStyles copyWith() => this;

@override
AppTextStyles lerp(AppTextStyles? other, double t) => this;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these necessary since they just return the same instance? let's remove them if we can

group('desktop text styles', () {
test('displayLargeDesktop has correct values', () {
const style = AppTextStyles.displayLargeDesktop;
expect(style.fontSize, 48);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
expect(style.fontSize, 48);
expect(style.fontSize, equals(48));

prefer using matches instead of raw values

Comment on lines +19 to +35

# Uncomment and update the font family name and assets once font files are
# added under assets/fonts/. Also update AppTextStyles.fontFamily accordingly.
# flutter:
# fonts:
# - family: CustomFont
# fonts:
# - asset: assets/fonts/CustomFont-Light.ttf
# weight: 300
# - asset: assets/fonts/CustomFont-Regular.ttf
# weight: 400
# - asset: assets/fonts/CustomFont-Medium.ttf
# weight: 500
# - asset: assets/fonts/CustomFont-SemiBold.ttf
# weight: 600
# - asset: assets/fonts/CustomFont-Bold.ttf
# weight: 700
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's remove these comments, we can add it to the README if it's important documentation

@github-project-automation github-project-automation Bot moved this from Needs Triage to In Review in VGV Open Source 🦄 🧙🌟 May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

2 participants