Taha Tesser
9a2d94ed8c
Fix DateRangePickerDialog does not use rangePickerHeaderBackgroundColor from DatePickerTheme in M2 (#147370)
fixes [DatePickerThemeData's `rangePickerHeaderBackgroundColor` not being applied to DateRangePickerDialog on M2](https://github.com/flutter/flutter/issues/147301)
### Code sample
<details>
<summary>expand to view the 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(
debugShowCheckedModeBanner: false,
theme: ThemeData(
useMaterial3: false,
datePickerTheme: const DatePickerThemeData(
rangePickerHeaderBackgroundColor: Colors.red,
),
),
home: Scaffold(
body: Center(
child: Builder(builder: (BuildContext context) {
return ElevatedButton(
onPressed: () {
showDateRangePicker(
context: context,
currentDate: DateTime.now(),
initialDateRange: DateTimeRange(
start: DateTime.now(),
end: DateTime.now().add(const Duration(days: 7)),
),
firstDate: DateTime(2000),
lastDate: DateTime(2025),
);
},
child: const Text('Show Date Range Picker'),
);
}),
),
),
);
}
}
```
</details>
### When using `rangePickerHeaderBackgroundColor` in `DatePickerTheme` for M2
```dart
theme: ThemeData(
useMaterial3: false,
datePickerTheme: const DatePickerThemeData(
rangePickerHeaderBackgroundColor: Colors.red,
),
),
```
| Before | After |
| --------------- | --------------- |
| <img src="https://github.com/flutter/flutter/assets/48603081/4e85a115-c702-45b2-8f1e-2f3c87c37629" /> | <img src="https://github.com/flutter/flutter/assets/48603081/d002ba0a-6328-4f97-8ba0-dcbb9662bbb3" /> |
2024-04-26 04:18:24 +00:00
..
2024-04-09 19:35:07 +00:00
2024-02-28 13:55:50 -08:00
2024-04-09 19:35:07 +00:00
2024-01-31 16:13:17 +00:00
2024-01-31 16:13:17 +00:00
2024-03-24 18:01:17 +00:00
2024-01-24 16:49:18 +00:00
2024-04-25 10:32:45 -07:00
2024-04-25 10:32:45 -07:00
2024-04-09 19:35:07 +00:00
2024-04-18 07:21:18 -07:00
2024-02-28 13:55:50 -08:00
2024-02-28 13:55:50 -08:00
2024-04-24 10:11:56 -07:00
2024-03-19 17:58:13 +00:00
2024-04-16 07:53:27 -07:00
2024-02-28 13:55:50 -08:00
2024-01-19 18:29:07 +00:00
2024-03-19 17:58:13 +00:00
2024-03-01 12:44:29 +00:00
2024-02-28 13:55:50 -08:00
2024-02-28 13:55:50 -08:00
2024-02-12 10:07:51 -08:00
2024-02-28 13:55:50 -08:00
2024-03-19 17:58:13 +00:00
2024-04-23 19:24:00 +00:00
2024-04-23 19:24:00 +00:00
2024-02-28 13:55:50 -08:00
2024-03-24 18:01:17 +00:00
2024-04-03 15:54:34 +00:00
2024-04-01 09:42:51 +00:00
2024-04-18 07:16:32 -07:00
2024-04-09 19:35:07 +00:00
2024-04-26 04:18:24 +00:00
2024-04-26 04:18:24 +00:00
2024-02-13 00:12:02 +00:00
2024-04-09 19:35:07 +00:00
2024-01-16 10:08:27 +00:00
2024-02-28 13:55:50 -08:00
2024-04-08 20:47:13 +00:00
2024-04-14 07:59:43 -07:00
2024-02-28 13:55:50 -08:00
2024-02-07 13:57:21 +00:00
2024-02-28 13:55:50 -08:00
2024-02-28 13:55:50 -08:00
2024-01-22 10:01:05 +00:00
2024-01-22 10:01:05 +00:00
2024-04-24 22:44:04 +00:00
2024-01-22 11:13:31 +00:00
2024-02-28 13:55:50 -08:00
2024-02-28 13:55:50 -08:00
2024-04-22 16:49:19 +00:00
2024-01-24 16:13:26 +00:00
2024-01-24 16:13:26 +00:00
2024-03-19 17:58:13 +00:00
2024-04-24 11:56:32 +00:00
2024-04-24 11:56:32 +00:00
2024-04-22 20:40:33 -07:00
2024-04-09 19:35:07 +00:00
2024-02-07 02:44:21 +00:00
2024-04-09 19:35:07 +00:00
2024-04-22 16:49:19 +00:00
2024-02-27 22:49:13 +00:00
2024-04-24 23:45:50 +00:00
2024-04-09 19:35:07 +00:00
2024-03-19 17:58:16 +00:00
2024-02-21 08:59:24 +00:00
2024-04-03 15:49:38 -07:00
2024-03-19 17:58:13 +00:00
2024-04-24 11:56:32 +00:00
2024-04-09 19:35:07 +00:00
2024-03-11 23:04:57 +00:00
2024-04-09 19:35:07 +00:00
2024-03-19 17:58:13 +00:00
2024-04-09 19:35:07 +00:00
2024-03-19 17:58:13 +00:00
2024-04-09 19:35:07 +00:00
2024-04-18 08:03:19 -07:00
2024-04-09 19:35:07 +00:00
2024-02-28 13:55:50 -08:00
2024-03-13 18:07:59 +00:00
2024-03-27 16:43:10 -07:00
2024-04-17 11:03:48 -07:00
2024-03-28 01:20:55 +00:00
2024-03-19 17:58:13 +00:00
2024-03-27 16:43:10 -07:00
2024-03-28 22:22:20 +00:00
2024-02-12 10:07:51 -08:00
2024-02-28 13:55:50 -08:00
2024-03-19 17:58:13 +00:00
2024-01-22 18:21:31 +00:00
2024-01-05 21:28:07 +00:00
2024-04-23 11:14:19 -07:00
2024-04-22 16:49:19 +00:00
2024-03-13 16:31:50 +00:00
2024-03-19 17:58:13 +00:00
2024-03-25 22:58:11 +00:00
2024-03-19 17:58:13 +00:00
2024-02-27 22:49:13 +00:00
2024-01-17 22:49:04 +00:00
2024-04-24 11:56:32 +00:00
2024-04-24 11:56:32 +00:00
2024-04-24 09:06:17 -07:00
2024-03-09 07:50:23 +00:00
2024-03-19 17:58:13 +00:00
2024-04-09 19:35:07 +00:00
2024-04-15 16:06:07 +00:00
2024-03-28 01:20:55 +00:00
2024-02-12 10:07:51 -08:00
2024-02-28 13:55:50 -08:00
2024-03-19 17:58:13 +00:00
2024-03-24 18:01:17 +00:00
2024-04-22 20:28:50 +00:00
2024-04-17 07:59:07 +00:00
2024-04-09 19:35:07 +00:00
2024-02-28 13:55:50 -08:00
2024-03-07 07:19:26 +00:00
2024-03-01 06:40:47 +00:00
2024-03-06 20:41:04 +00:00
2024-02-28 13:55:50 -08:00
2024-02-28 13:55:50 -08:00
2024-03-19 17:58:13 +00:00
2024-04-09 19:35:07 +00:00
2024-04-09 19:35:07 +00:00
2024-02-23 19:02:22 +00:00
2024-03-28 01:20:55 +00:00
2024-04-16 12:15:37 -07:00
2024-02-21 00:34:11 +00:00