Orange-OpenSource / Orange-OpenSource/ouds-flutter

[Improvement][Wireframe and Sosh] fontFamily and TextStyle properties from ThemeData not applied to CupertinoNavigationBar and CupertinoTabBar

Open
#645 0 comments 0 reactions 1 assignee View on GitHub

@nouha06 is already working on this.

Since Apr 8, 2026.

⚛️ component 🔍 triage 🖌️ theme 🧩 enhancement 🧰 library
Dominant language
Dart
Stars
10
Forks
5
Avg merge
6d 8h
Merged PRs (30d)
9

Description

Problem Description:

When attempting to apply a custom fontFamily (or other TextStyle properties like fontSize, fontWeight, etc.) defined in a custom ThemeData to CupertinoNavigationBar and CupertinoTabBar components, the styles are not correctly inherited or applied for Wireframe and sosh themes. While Material widgets correctly pick up the fontFamilyfrom ThemeData.fontFamily or ThemeData.textTheme, Cupertino widgets within the same MaterialApp context do not.

Root Cause:

CupertinoTabBar and CupertinoNavigationBar (and other Cupertino widgets) do not directly inherit their text styles from the ThemeData.textTheme or ThemeData.fontFamily. Instead, they rely on the CupertinoThemeData's textTheme, specifically properties like:
CupertinoTextThemeData.tabLabelTextStyle (for CupertinoTabBar item labels)
CupertinoTextThemeData.navTitleTextStyle (for CupertinoNavigationBar titles)
CupertinoTextThemeData.navLargeTitleTextStyle (for CupertinoNavigationBar.large titles)
CupertinoTextThemeData.actionTextStyle (for text-based actions in CupertinoNavigationBar)

If these CupertinoTextThemeData properties are not explicitly set, Cupertino widgets fall back to their default iOS-like styles, ignoring the custom fontFamily provided in the MaterialApp's ThemeData.

Recommended Approach:

The issue can be resolved by explicitly defining the CupertinoThemeData within the MaterialApp's ThemeData using the cupertinoOverrideTheme property. Within this cupertinoOverrideTheme, the relevant CupertinoTextThemeData properties must be set to use the desired fontFamily and package (if the font is from a package).

Additionally, any custom wrapper widgets around CupertinoNavigationBar or CupertinoTabBar (e.g., OudsToolbarTop, OudsTabBar in our project) and their associated style modifiers (e.g., OudsToolbarTopTextStyleModifier) must be updated to retrieve text styles from CupertinoTheme.of(context).textTheme rather than hardcoding them or relying solely on OudsTheme.of(context).typographyTokens.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.