Taha Tesser
6e1d4f9fc6
Fix SliverAppBar.medium & SliverAppBar.large text scale (#125038)
fixes https://github.com/flutter/flutter/issues/114340
<details>
<summary>code sample</summary>
```dart
import 'package:flutter/material.dart';
/// Flutter code sample for [SliverAppBar.medium].
void main() {
runApp(const AppBarMediumApp());
}
class AppBarMediumApp extends StatelessWidget {
const AppBarMediumApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
useMaterial3: true,
),
home: MediaQuery(
data: MediaQuery.of(context).copyWith(textScaleFactor: 3.0),
child: Material(
child: CustomScrollView(
slivers: <Widget>[
SliverAppBar.medium(
leading:
IconButton(icon: const Icon(Icons.menu), onPressed: () {}),
title: const Text('Medium App Bar'),
actions: <Widget>[
IconButton(icon: const Icon(Icons.more_vert), onPressed: () {}),
],
),
// SliverAppBar.large(
// leading:
// IconButton(icon: const Icon(Icons.menu), onPressed: () {}),
// title: const Text('Large App Bar'),
// actions: <Widget>[
// IconButton(
// icon: const Icon(Icons.more_vert), onPressed: () {}),
// ],
// ),
// Just some content big enough to have something to scroll.
SliverToBoxAdapter(
child: Card(
child: SizedBox(
height: 1200,
child: Padding(
padding: const EdgeInsets.fromLTRB(8, 100, 8, 100),
child: Text(
'Here be scrolling content...',
style: Theme.of(context).textTheme.headlineSmall,
),
),
),
),
),
],
),
),
),
);
}
}
```
</details>
### Before
| Medium App Bar - `textScaleFactor: 3.0` | Large App Bar - `textScaleFactor.30` |
| --------------- | --------------- |
| <img src="https://user-images.githubusercontent.com/48603081/232815191-ab42523b-d710-4c93-a889-e9c92ca472c8.png" height="450" /> | <img src="https://user-images.githubusercontent.com/48603081/232815232-104c208d-f1dd-404e-9218-5dfb61244d56.png" height="450" /> |
### After
| Medium App Bar - `textScaleFactor: 3.0` | Large App Bar - `textScaleFactor.30` |
| --------------- | --------------- |
| <img src="https://user-images.githubusercontent.com/48603081/232815733-8b8af94f-197f-427a-bbb9-bc6cd0173658.png" height="450" /> | <img src="https://user-images.githubusercontent.com/48603081/232815758-2c336d14-085b-4e91-8b93-748a40822ea6.png" height="450" /> |
2023-04-25 08:27:24 +00:00
..
2023-03-22 21:12:22 +00:00
2023-02-22 09:22:44 -08:00
2023-03-22 21:12:22 +00:00
2023-04-25 08:27:24 +00:00
2023-04-13 18:54:08 +00:00
2023-04-24 18:33:24 +00:00
2023-03-22 21:12:22 +00:00
2023-02-08 08:52:41 -08:00
2023-02-15 17:41:41 -08:00
2023-04-03 16:38:14 +00:00
2023-04-11 11:21:13 -07:00
2023-04-11 11:21:13 -07:00
2023-02-15 17:41:41 -08:00
2023-03-18 20:13:08 -07:00
2023-03-18 20:13:08 -07:00
2023-02-15 17:41:41 -08:00
2023-02-15 17:41:41 -08:00
2023-02-28 23:55:58 +00:00
2023-02-02 19:33:57 +00:00
2023-02-15 17:41:41 -08:00
2023-04-14 22:40:10 +00:00
2023-04-14 22:40:10 +00:00
2023-02-15 17:41:41 -08:00
2023-04-17 13:41:55 -07:00
2023-02-15 17:41:41 -08:00
2023-04-20 11:43:49 -07:00
2023-03-19 12:14:19 +00:00
2023-03-31 09:42:16 -07:00
2023-03-23 17:45:34 -07:00
2023-04-24 16:20:21 -07:00
2023-02-15 17:41:41 -08:00
2023-04-24 16:20:21 -07:00
2023-03-13 21:50:24 +00:00
2023-04-19 00:09:34 +00:00
2023-04-18 23:00:03 +00:00
2023-02-15 17:41:41 -08:00
2023-02-02 19:33:57 +00:00
2023-03-22 21:12:22 +00:00
2023-04-04 16:23:32 -07:00
2023-02-15 17:41:41 -08:00
2023-04-20 11:39:25 +00:00
2023-02-15 17:41:41 -08:00
2023-03-29 19:58:58 +00:00
2023-04-24 21:41:06 +00:00
2023-02-15 17:41:41 -08:00
2023-04-10 20:22:54 +00:00
2023-02-15 17:41:41 -08:00
2023-02-13 23:55:58 +00:00
2023-02-13 23:55:58 +00:00
2023-04-21 13:43:37 +00:00
2023-02-15 17:41:41 -08:00
2023-03-22 21:12:22 +00:00
2023-02-15 17:41:41 -08:00
2023-04-24 21:41:06 +00:00
2023-02-15 17:41:41 -08:00
2023-03-25 21:00:23 +00:00
2023-04-21 13:43:37 +00:00
2023-02-09 16:51:26 +00:00
2023-04-18 09:33:30 +00:00
2023-03-09 19:05:32 +00:00
2023-02-13 23:52:32 +00:00
2023-03-06 18:34:08 +00:00
2023-04-10 20:22:54 +00:00
2023-02-23 19:43:21 +00:00
2023-04-18 21:09:53 +00:00
2023-02-15 17:41:41 -08:00
2023-02-15 17:41:41 -08:00
2023-02-15 17:41:41 -08:00
2023-02-15 17:41:41 -08:00
2023-03-27 13:39:41 -07:00
2023-02-15 17:41:41 -08:00
2023-03-23 18:13:47 +00:00
2023-02-15 17:41:41 -08:00
2023-03-24 22:07:47 +00:00
2023-02-10 17:32:43 +00:00
2023-04-24 21:41:06 +00:00
2023-02-15 17:41:41 -08:00
2023-03-15 00:08:18 +00:00
2023-03-22 21:12:22 +00:00
2023-04-06 23:34:12 +00:00
2023-03-22 21:12:22 +00:00
2023-02-15 17:41:41 -08:00
2023-04-24 22:43:05 +00:00
2023-02-15 17:41:41 -08:00
2023-04-04 20:33:02 +00:00
2023-04-04 20:33:02 +00:00
2023-02-15 17:41:41 -08:00
2023-02-02 19:33:57 +00:00
2023-02-24 10:51:37 -08:00
2023-04-12 00:07:20 +00:00
2023-04-05 16:10:32 +00:00
2023-03-15 00:08:18 +00:00
2023-02-15 17:41:41 -08:00
2023-04-20 04:50:52 +00:00
2023-03-16 15:04:19 -07:00
2023-04-07 19:38:52 +00:00
2023-03-27 23:31:11 -07:00
2023-04-04 15:38:20 -07:00
2023-02-15 17:41:41 -08:00
2023-04-17 23:19:11 +00:00
2023-02-23 19:43:21 +00:00
2023-02-15 17:41:41 -08:00
2023-03-27 15:25:56 -07:00
2023-03-27 15:25:56 -07:00
2023-04-24 10:26:47 -07:00
2023-04-17 12:52:48 -07:00
2023-02-09 18:32:49 +00:00
2023-02-08 07:55:24 +00:00
2023-02-15 17:41:41 -08:00
2023-03-28 16:45:15 +00:00
2023-03-28 16:45:15 +00:00
2023-04-24 21:41:06 +00:00
2023-02-15 17:41:41 -08:00
2023-04-24 19:25:21 +00:00
2023-03-29 22:59:06 +00:00
2023-03-15 00:08:18 +00:00
2023-02-15 17:41:41 -08:00
2023-04-21 22:38:06 +00:00
2023-02-15 17:41:41 -08:00
2023-04-07 01:44:23 +00:00
2023-02-07 05:40:18 +00:00
2023-03-22 21:12:22 +00:00
2023-02-15 17:41:41 -08:00
2023-03-09 19:05:32 +00:00
2023-02-15 17:41:41 -08:00
2023-02-03 06:31:47 -08:00
2023-02-15 17:41:41 -08:00
2023-02-23 19:43:21 +00:00