Skip to content

CalendarDatePicker: todayBorder color is still overridden by todayForegroundColor in year picker #189298

Closed
flutter/packages
#12697

Description

@Xiang329

Steps to reproduce

In #177911, only the date selection was fixed, but the issue with the year selection remains.

Expected results

The year selection in CalendarDatePicker should also use the color property of borderSide.

Actual results

The year selection in CalendarDatePicker is overridden by todayForegroundColor.

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(
      title: 'Flutter Demo',
      theme: ThemeData(
        datePickerTheme: DatePickerThemeData(
          todayBorder: BorderSide(color: Colors.red, width: 4),
          todayForegroundColor: WidgetStateProperty.all(Colors.blue),
          todayBackgroundColor: WidgetStateProperty.all(Colors.white),
        ),
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
      ),
      home: Scaffold(
        body: Center(
          child: CalendarDatePicker(
            initialDate: DateTime.now(),
            firstDate: DateTime(1900),
            lastDate: DateTime(2100),
            onDateChanged: (DateTime value) {},
          ),
        ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration
date picker (fixed) year picker
Image Image

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[!] Flutter (Channel stable, 3.44.1, on Microsoft Windows [版本 10.0.26200.8655], locale zh-TW) [545ms]
    • Flutter version 3.44.1 on channel stable at C:\Users\user\fvm\default
    ! Warning: `flutter` on your path resolves to C:\Users\user\fvm\versions\3.44.1\bin\flutter, which is not inside
      your current Flutter SDK checkout at C:\Users\user\fvm\default. Consider adding C:\Users\user\fvm\default\bin to
      the front of your path.
    ! Warning: `dart` on your path resolves to C:\Users\user\fvm\versions\3.44.1\bin\dart, which is not inside your
      current Flutter SDK checkout at C:\Users\user\fvm\default. Consider adding C:\Users\user\fvm\default\bin to the
      front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 924134a44c (6 weeks ago), 2026-05-29 12:13:22 -0400
    • Engine revision c416acfeb8
    • Dart version 3.12.1
    • DevTools version 2.57.0
    • Feature flags: enable-web, no-enable-linux-desktop, no-enable-macos-desktop, enable-windows-desktop,
      enable-android, enable-ios, cli-animations, enable-native-assets, enable-swift-package-manager,
      omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly
      to perform update checks and upgrades.
[✓] Windows Version (11 專業版 64-bit, 25H2, 2009) [5.4s]
[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [2.8s]
    • Android SDK at C:\Users\user\AppData\Local\Android\Sdk
    • Emulator version 35.2.10.0 (build_id 12414864) (CL:N/A)
    ✗ Flutter requires Android SDK 36 and the Android BuildTools 28.0.3
      To update the Android SDK visit https://flutter.dev/to/windows-android-setup for detailed instructions.
    • All Android licenses accepted.
[✗] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe) [124ms]
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.14.31 (April 2026)) [123ms]
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.14.37216.2
    • Windows 10 SDK version 10.0.26100.0
[✓] Connected device (2 available) [256ms]
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [版本 10.0.26200.8655]
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 150.0.4078.48
[✓] Network resources [423ms]
    • All expected network resources are available.

Activity

  1. suryaKommana2662 commented on Jul 13, 2026

    @suryaKommana2662
    Contributor

    @Xiang329 Thanks for filing the issue and for providing a clear reproduction sample. I was able to reproduce this issue on the latest Flutter stable channel. The todayBorder color is correctly applied in the date picker view, but in the year picker it is still overridden by todayForegroundColor, as described. Routing to the team-design for further investigation.

    Flutter Doctor Output

    [√] Flutter (Channel stable, 3.44.6, on Microsoft Windows [Version 10.0.26200.8655], locale en-IN) [419ms]
        • Flutter version 3.44.6 on channel stable at C:\flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision ee80f08bbf (4 days ago), 2026-07-08 15:02:06 -0700
        • Engine revision 83675ed276
        • Dart version 3.12.2
        • DevTools version 2.57.0
        • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios,
          cli-animations, enable-native-assets, enable-swift-package-manager, omit-legacy-version-file, enable-lldb-debugging,
          enable-uiscene-migration
    
    [√] Windows Version (Windows 11 or higher, 25H2, 2009) [1,265ms]
    
    [√] Android toolchain - develop for Android devices (Android SDK version 36.1.0) [3.3s]
        • Android SDK at C:\Android\Sdk
        • Emulator version 36.5.11.0 (build_id 15261927) (CL:N/A)
        • Platform android-36.1, build-tools 36.1.0
        • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
          This is the JDK bundled with the latest Android Studio installation on this machine.
          To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
        • Java version OpenJDK Runtime Environment (build 21.0.10+-14961533-b1163.108)
        • All Android licenses accepted.
    
    [√] Chrome - develop for the web [171ms]
        • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
    
    [√] Visual Studio - develop Windows apps (Visual Studio Community 2026 18.6.1) [169ms]
        • Visual Studio at C:\Program Files\Microsoft Visual Studio\18\Community
        • Visual Studio Community 2026 version 18.6.11819.183
        • Windows 10 SDK version 10.0.26100.0
    
    [√] Connected device (4 available) [685ms]
        • sdk gphone16k x86 64 (mobile) • emulator-5554 • android-x64    • Android 17 (API 37) (emulator)
        • Windows (desktop)             • windows       • windows-x64    • Microsoft Windows [Version 10.0.26200.8655]
        • Chrome (web)                  • chrome        • web-javascript • Google Chrome 150.0.7871.101
        • Edge (web)                    • edge          • web-javascript • Microsoft Edge 149.0.4022.80
    
    [√] Network resources [719ms]
        • All expected network resources are available.
    
    • No issues found!
  2. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    p: material_uimaterial_ui package in flutter/packages
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    team-designOwned by Design Languages team
    and removed
    in triagePresently being triaged by the triage team
    on Jul 13, 2026
  3. added
    packageflutter/packages repository. See also p: labels.
    and removed
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Aug 17, 2026
  4. github-actions commented on Sep 28, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  5. locked as resolved and limited conversation to collaborators on Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listhas reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.team-designOwned by Design Languages teamtriaged-designTriaged by Design Languages teamwaiting for PR to land (fixed)A fix is in flight

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions