You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ui [nfc]: Define app-bar title text style all in one place
Much like we did in b75908b for
ContentTheme.textStylePlainParagraph, this is meant to collect all
the details that had been implicitly defining the app-bar title
style, from various sources:
- [_M3Typography.englishLike] or [_M3Typography.dense] (the latter
for Japanese)
- [Typography.blackCupertino] or [Typography.blackMountainView]
(depending on platform)
- `zulipTypography` in lib/widgets/text.dart
- [ColorScheme.onSurface]
, make them explicit, and make it clear that this doesn't inherit
from anything.
(Unlike in b75908b, this handles the wrinkle of giving the
appropriate textBaseline for our Japanese support. See a recent
commit that added localizedTextBaseline.)
If we were defining this within the scope of the global `ThemeData`,
rather than outside it (to add to it), we might instead have aliased
the details like so:
final theme = Theme.of(context);
theme.textTheme.titleLarge!
.apply(color: theme.colorScheme.onSurface);
, which is much simpler; oh, well. That `textTheme` is the result of
complicated computations based on Typography in [Theme.of], and
[Theme.of] only works when you're below the right [Theme] in the
widget tree.
Next, we'll change the `color`, `fontSize`, and `height` to align
with the Figma. (We couldn't have just passed a `TextStyle` with
those three fields by themselves, even with `inherit: true`. If you
give AppBar a TextStyle for the title like this, it just takes it
literally, in place of the default style that applies when you don't
give the TextStyle.)
0 commit comments