Skip to content

Date Range Picker doesn't use DatePickerThemeData.rangePickerHeaderBackgroundColor property #127184

@TahaTesser

Description

@TahaTesser

Is there an existing issue for this?

Steps to reproduce

showDateRangePicker sample below contains a button to launch the date range picker and the DatePickerThemeData where color is provided to rangePickerHeaderBackgroundColor theme property.

Expected results

The date range picker header background should use the provided theme color

Screenshot 2023-05-19 at 14 07 07

Actual results

The date range picker header background doesn't use the provided theme color.

Screenshot 2023-05-19 at 14 07 17

Code sample

Code sample
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(
        useMaterial3: true,
        datePickerTheme: const DatePickerThemeData(
          rangePickerHeaderBackgroundColor: Colors.amber,
        ),
      ),
      home: Scaffold(
        body: Builder(builder: (BuildContext context) {
          return Center(
            child: ElevatedButton(
              onPressed: () async {
                await showDateRangePicker(
                  context: context,
                  initialDateRange: DateTimeRange(
                    start: DateTime(2021, DateTime.january, 15),
                    end: DateTime(2021, DateTime.january, 20),
                  ),
                  // initialDate: DateTime(2016, DateTime.january, 15),
                  firstDate: DateTime(2001),
                  lastDate: DateTime(2031, DateTime.december, 31),
                );
              },
              child: const Text('Show Date Range Picker'),
            ),
          );
        }),
      ),
    );
  }
}

Screenshots or Video

No response

Logs

~

Flutter Doctor output

Doctor output
[!] Flutter (Channel master, 3.11.0-6.0.pre.134, on macOS 13.3.1 22E772610a
    darwin-arm64, locale en-EE)
    • Flutter version 3.11.0-6.0.pre.134 on channel master at
      /Users/tahatesser/Code/flutter
    ! Upstream repository [email protected]:TahaTesser/flutter.git is not the same
      as FLUTTER_GIT_URL
    • FLUTTER_GIT_URL = [email protected]:NevercodeHQ/flutter.git
    • Framework revision f31dae2a80 (35 hours ago), 2023-05-17 17:18:51 -0700
    • Engine revision d970370779
    • Dart version 3.1.0 (build 3.1.0-118.0.dev)
    • DevTools version 2.23.1
    • If those were intentional, you can disregard the above warnings; however
      it is recommended to use "git" directly to perform update checks and
      upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at /Users/tahatesser/Code/android-sdk
    • Platform android-33, build-tools 33.0.2
    • ANDROID_SDK_ROOT = /Users/tahatesser/Code/android-sdk
    • Java binary at: /Applications/Android Studio
      Preview.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E222b
    • CocoaPods version 1.12.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio
    • Android Studio at /Applications/Android Studio Preview.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build
      17.0.6+0-17.0.6b829.9-10027231)

[✓] VS Code (version 1.78.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.64.0

[✓] VS Code (version 1.79.0-insider)
    • VS Code at /Applications/Visual Studio Code - Insiders.app/Contents
    • Flutter extension version 3.64.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-arm64   • macOS 13.3.1 22E772610a
      darwin-arm64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 113.0.5672.126

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

Metadata

Metadata

Assignees

Labels

f: date/time pickerDate or time picker widgetsf: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.

Type

No type

Projects

Status

Done (PR merged)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions