Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
DateRangePickerDialog
does not use `rangePickerHeaderBackground…
…Color` from `DatePickerTheme` in M2 (#147370) fixes [DatePickerThemeData's `rangePickerHeaderBackgroundColor` not being applied to DateRangePickerDialog on M2](flutter/flutter#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" /> |
- Loading branch information