-
Notifications
You must be signed in to change notification settings - Fork 29.2k
Description
Problem
If you look into the native iOS NavBar texts (such as Close, Edit, and so on) those won't scale with the font settings (thus having textScaleFactor: 1.0
).
Currently, the Close button from the bottom navigation route, is being able to scale and can't have its property overriden unless you explicitly create it yourself the leading widget). This will either add a lot of boilerplate if you want to provide the best native experience possible; or make the Close
button smaller/bigger than the others across the system UI.
This should also be considered to the AppBar title and action buttons (both text and icon).
Solution
A simple (and correct) solution would be to set the CupertinoButton
's textScaleFactor
to 1.0
in the default leadingContent
of the NavBar
.
leadingContent = CupertinoButton(
child: const Text(
'Close',
textScaleFactor: 1.0,
),
padding: EdgeInsets.zero,
onPressed: () { route.navigator.maybePop(); },
);
Edit: I already PR'd a solution with #35200.