Repository navigation
Commit fe32675
authored
Add M3 date picker tests and fix divider (#127197)
partial fix #126826 (date range picker is another PR)
fixes #126597
### Description
1. This PR adds a bunch of M3 date picker tests
2. Fixes divider taking more space than it should
3. Added dividerColor theme value to allow users to customise divider color just for the date pickers from date picker theme
<details>
<summary>code sample</summary>
```dart
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@OverRide
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
datePickerTheme: DatePickerThemeData(
headerBackgroundColor: Colors.amber,
),
useMaterial3: true,
),
home: Scaffold(
body: Builder(builder: (BuildContext context) {
return Center(
child: ElevatedButton(
onPressed: () async {
showDatePicker(
context: context,
initialDate: DateTime(2016, DateTime.january, 15),
firstDate: DateTime(2001),
lastDate: DateTime(2031, DateTime.december, 31),
);
},
child: const Text('Show Date Picker'),
),
);
}),
),
);
}
}
```
</details>
### Before

### After
1 parent d9045f0 commit fe32675
4 files changed
Lines changed: 408 additions & 6 deletions
File tree
- packages/flutter
- lib/src/material
- test/material
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
675 | 675 | | |
676 | 676 | | |
677 | 677 | | |
678 | | - | |
| 678 | + | |
679 | 679 | | |
680 | 680 | | |
681 | 681 | | |
| |||
686 | 686 | | |
687 | 687 | | |
688 | 688 | | |
689 | | - | |
| 689 | + | |
690 | 690 | | |
691 | 691 | | |
692 | 692 | | |
| |||
850 | 850 | | |
851 | 851 | | |
852 | 852 | | |
| 853 | + | |
853 | 854 | | |
854 | 855 | | |
855 | 856 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| |||
282 | 283 | | |
283 | 284 | | |
284 | 285 | | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
285 | 291 | | |
286 | 292 | | |
287 | 293 | | |
| |||
317 | 323 | | |
318 | 324 | | |
319 | 325 | | |
| 326 | + | |
320 | 327 | | |
321 | 328 | | |
322 | 329 | | |
| |||
351 | 358 | | |
352 | 359 | | |
353 | 360 | | |
| 361 | + | |
354 | 362 | | |
355 | 363 | | |
356 | 364 | | |
| |||
392 | 400 | | |
393 | 401 | | |
394 | 402 | | |
| 403 | + | |
395 | 404 | | |
396 | 405 | | |
397 | 406 | | |
| |||
439 | 448 | | |
440 | 449 | | |
441 | 450 | | |
| 451 | + | |
442 | 452 | | |
443 | 453 | | |
444 | 454 | | |
| |||
478 | 488 | | |
479 | 489 | | |
480 | 490 | | |
481 | | - | |
| 491 | + | |
| 492 | + | |
482 | 493 | | |
483 | 494 | | |
484 | 495 | | |
| |||
516 | 527 | | |
517 | 528 | | |
518 | 529 | | |
| 530 | + | |
519 | 531 | | |
520 | 532 | | |
521 | 533 | | |
| |||
0 commit comments