Skip to content

feat: setup google font support to update app theme - #12

Merged
koukibadr merged 2 commits into
mainfrom
feat/typography/setup-google-font-support
Aug 11, 2026
Merged

feat: setup google font support to update app theme#12
koukibadr merged 2 commits into
mainfrom
feat/typography/setup-google-font-support

Conversation

@koukibadr

@koukibadr koukibadr commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features

    • Added support for configuring Google Fonts in themes.
    • Added optional fallback font selection, defaulting to Roboto when no font is configured.
    • Existing font-family settings continue to take precedence.
  • Improvements

    • Empty font configuration values are now treated as unset.
    • Updated the example configuration with the latest initialization API key.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@koukibadr, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 49 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 4b68ab8c-b91f-432d-a1e9-26bcf14e89fe

📥 Commits

Reviewing files that changed from the base of the PR and between 6ee0230 and 952e317.

📒 Files selected for processing (1)
  • lib/flutter_skin.dart
📝 Walkthrough

Walkthrough

The PR adds Google font support to SkinModel and FlutterSkin.toThemeData. It adds a fallbackFont parameter, defines font selection precedence, adds the google_fonts dependency, and updates the example API key.

Changes

Google font theme support

Layer / File(s) Summary
Google font model contract
lib/models/skin_model.dart, pubspec.yaml
SkinModel now stores and parses googleFont. The package adds the google_fonts dependency.
Theme font resolution
lib/flutter_skin.dart
toThemeData accepts fallbackFont and selects a configured family, Google font, fallback font, or Roboto.

Example configuration

Layer / File(s) Summary
Example API key update
example/lib/main.dart
The example uses a different FlutterSkin initialization API key.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant SkinModel
  participant FlutterSkin
  participant google_fonts
  participant ThemeData
  SkinModel->>FlutterSkin: provide fontFamily and googleFont
  FlutterSkin->>google_fonts: resolve googleFont
  google_fonts-->>FlutterSkin: return font family
  FlutterSkin->>ThemeData: create theme with selected font
Loading

Possibly related PRs

Poem

A bunny found a font so bright,
Google letters hopped in sight.
Fallbacks wait, and Roboto too,
Themes now know just what to do.
Hop, hop—clean fonts for you!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding Google Font support to update the app theme.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@lib/flutter_skin.dart`:
- Around line 106-112: Update the remote theme construction around ThemeData so
the fallbackTheme decision occurs before evaluating the fontFamily expression.
When colors is null and fallbackTheme is provided, return or use the fallback
theme without invoking GoogleFonts.getFont; only resolve the remote font for
paths that actually construct the remote theme.
- Around line 106-112: Update the ThemeData construction in
lib/flutter_skin.dart to apply the selected Google font across the full text
theme using GoogleFonts.getTextTheme and the base theme’s textTheme, rather than
assigning only GoogleFonts.getFont(...).fontFamily. Preserve the existing
fontFamily override and fallback font selection behavior.
- Around line 94-112: The font selection in toThemeData must validate dynamic
names before calling GoogleFonts.getFont. Trim googleFont and fallbackFont,
select the first candidate present in GoogleFonts.asMap(), and use Roboto when
neither is supported, preserving the existing fontFamily override behavior.

In `@pubspec.yaml`:
- Line 18: Update the Flutter SDK constraint in pubspec.yaml to a lower bound of
>=3.38.0 to satisfy google_fonts ^8.2.1, or downgrade google_fonts to a release
compatible with the existing >=1.17.0 constraint.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 56cfff62-3a68-4a94-b42f-41872c19abd6

📥 Commits

Reviewing files that changed from the base of the PR and between 8185aeb and 6ee0230.

📒 Files selected for processing (4)
  • example/lib/main.dart
  • lib/flutter_skin.dart
  • lib/models/skin_model.dart
  • pubspec.yaml

Comment thread lib/flutter_skin.dart Outdated
Comment thread lib/flutter_skin.dart Outdated
Comment thread pubspec.yaml
@koukibadr
koukibadr force-pushed the feat/typography/setup-google-font-support branch from 2777917 to 952e317 Compare August 11, 2026 08:29
@koukibadr
koukibadr merged commit 910a37e into main Aug 11, 2026
4 checks passed
@koukibadr
koukibadr deleted the feat/typography/setup-google-font-support branch August 11, 2026 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant