Commit 95cdebe
authored
Add
fixes [`Time selector separator` in TimePicker is not centered vertically](flutter/flutter#143691)
Separator currently `hourMinuteTextStyle` to style itself.
This introduces `timeSelectorSeparatorColor` and `timeSelectorSeparatorTextStyle` from Material 3 specs to correctly style the separator. This also adds ability to change separator color without changing `hourMinuteTextColor`.
### Specs for the time selector separator
https://m3.material.io/components/time-pickers/specs

### Code sample
<details>
<summary>expand to view the code sample</summary>
```dart
import 'package:flutter/material.dart';
void main() {
runApp(const App());
}
class App extends StatelessWidget {
const App({super.key});
@OverRide
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
// timePickerTheme: TimePickerThemeData(
// hourMinuteTextColor: Colors.amber,
// )
),
home: Scaffold(
body: Center(
child: Builder(builder: (context) {
return ElevatedButton(
onPressed: () async {
await showTimePicker(
context: context,
initialTime: TimeOfDay.now(),
);
},
child: const Text('Pick Time'),
);
}),
),
),
);
}
}
```
</details>
| Before | After |
| --------------- | --------------- |
| <img src="https://github.com/flutter/flutter/assets/48603081/20beeba4-5cc2-49ee-bba8-1c552c0d1e44" /> | <img src="https://github.com/flutter/flutter/assets/48603081/24927187-aff7-4191-930c-bceab6a4b4c2" /> |timeSelectorSeparatorColor and timeSelectorSeparatorTextStyle for Material 3 Time Picker (#143739)1 parent f923375 commit 95cdebe
File tree
6 files changed
+170
-38
lines changed- dev/tools/gen_defaults/lib
- packages
- flutter_localizations/test/material
- flutter
- lib/src/material
- test/material
6 files changed
+170
-38
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
336 | 350 | | |
337 | 351 | | |
338 | 352 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | | - | |
| 245 | + | |
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
| |||
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
281 | | - | |
| 281 | + | |
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
| |||
428 | 428 | | |
429 | 429 | | |
430 | 430 | | |
431 | | - | |
432 | | - | |
| 431 | + | |
| 432 | + | |
433 | 433 | | |
434 | 434 | | |
435 | 435 | | |
436 | | - | |
| 436 | + | |
437 | 437 | | |
438 | 438 | | |
439 | 439 | | |
| |||
455 | 455 | | |
456 | 456 | | |
457 | 457 | | |
458 | | - | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
459 | 462 | | |
460 | 463 | | |
461 | 464 | | |
462 | | - | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
463 | 469 | | |
464 | 470 | | |
465 | 471 | | |
| |||
478 | 484 | | |
479 | 485 | | |
480 | 486 | | |
481 | | - | |
| 487 | + | |
482 | 488 | | |
483 | 489 | | |
484 | 490 | | |
| |||
1801 | 1807 | | |
1802 | 1808 | | |
1803 | 1809 | | |
1804 | | - | |
| 1810 | + | |
1805 | 1811 | | |
1806 | 1812 | | |
1807 | 1813 | | |
| |||
3655 | 3661 | | |
3656 | 3662 | | |
3657 | 3663 | | |
| 3664 | + | |
| 3665 | + | |
| 3666 | + | |
| 3667 | + | |
| 3668 | + | |
| 3669 | + | |
| 3670 | + | |
| 3671 | + | |
| 3672 | + | |
| 3673 | + | |
| 3674 | + | |
| 3675 | + | |
| 3676 | + | |
| 3677 | + | |
3658 | 3678 | | |
3659 | 3679 | | |
3660 | 3680 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
| |||
261 | 263 | | |
262 | 264 | | |
263 | 265 | | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
264 | 285 | | |
265 | 286 | | |
266 | 287 | | |
| |||
287 | 308 | | |
288 | 309 | | |
289 | 310 | | |
| 311 | + | |
| 312 | + | |
290 | 313 | | |
291 | 314 | | |
292 | 315 | | |
| |||
311 | 334 | | |
312 | 335 | | |
313 | 336 | | |
| 337 | + | |
| 338 | + | |
314 | 339 | | |
315 | 340 | | |
316 | 341 | | |
| |||
355 | 380 | | |
356 | 381 | | |
357 | 382 | | |
| 383 | + | |
| 384 | + | |
358 | 385 | | |
359 | 386 | | |
360 | 387 | | |
| |||
382 | 409 | | |
383 | 410 | | |
384 | 411 | | |
| 412 | + | |
| 413 | + | |
385 | 414 | | |
386 | 415 | | |
387 | 416 | | |
| |||
414 | 443 | | |
415 | 444 | | |
416 | 445 | | |
417 | | - | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
418 | 449 | | |
419 | 450 | | |
420 | 451 | | |
| |||
442 | 473 | | |
443 | 474 | | |
444 | 475 | | |
| 476 | + | |
| 477 | + | |
445 | 478 | | |
446 | 479 | | |
447 | 480 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1831 | 1831 | | |
1832 | 1832 | | |
1833 | 1833 | | |
1834 | | - | |
| 1834 | + | |
1835 | 1835 | | |
1836 | 1836 | | |
1837 | 1837 | | |
| |||
1965 | 1965 | | |
1966 | 1966 | | |
1967 | 1967 | | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
| 1971 | + | |
| 1972 | + | |
| 1973 | + | |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
| 1977 | + | |
| 1978 | + | |
| 1979 | + | |
| 1980 | + | |
| 1981 | + | |
| 1982 | + | |
| 1983 | + | |
| 1984 | + | |
| 1985 | + | |
| 1986 | + | |
| 1987 | + | |
| 1988 | + | |
| 1989 | + | |
| 1990 | + | |
| 1991 | + | |
| 1992 | + | |
| 1993 | + | |
1968 | 1994 | | |
1969 | 1995 | | |
1970 | 1996 | | |
| |||
2175 | 2201 | | |
2176 | 2202 | | |
2177 | 2203 | | |
2178 | | - | |
| 2204 | + | |
| 2205 | + | |
2179 | 2206 | | |
2180 | 2207 | | |
2181 | | - | |
| 2208 | + | |
2182 | 2209 | | |
2183 | 2210 | | |
2184 | 2211 | | |
| |||
Lines changed: 39 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| |||
89 | 91 | | |
90 | 92 | | |
91 | 93 | | |
| 94 | + | |
| 95 | + | |
92 | 96 | | |
93 | 97 | | |
94 | 98 | | |
| |||
118 | 122 | | |
119 | 123 | | |
120 | 124 | | |
121 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
122 | 128 | | |
123 | 129 | | |
124 | 130 | | |
| |||
798 | 804 | | |
799 | 805 | | |
800 | 806 | | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
801 | 839 | | |
802 | 840 | | |
803 | 841 | | |
| |||
0 commit comments