Skip to content

CalendarDatePicker: todayBorder color is incorrectly overridden by todayForegroundColor #177911

Description

@abikko

Steps to reproduce

  1. Add into theme todayForegroundColor e.g Colors.black, and remove BorderSide(e.g null or empty BorderSide())
  2. But material/calendar_date_picker.dart 1201:77 will use todayForegroundColor property instead
  3. I think that every developer should have to decide, show on today's date border or not, if should - with specifying color in CalendarPickerData

Expected results

CalendarDatePicker should use borderSide without copyWithing it.

Actual results

CalendarDatePicker - overriding specified border color

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),
          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

[Upload media here]

Image

Logs

Logs

No logs

Flutter Doctor output

Doctor output
bug % flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.35.4, on macOS 26.0 25A354 darwin-arm64, locale en-KZ)
[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0)
[✓] Xcode - develop for iOS and macOS (Xcode 26.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2025.1)
[✓] VS Code (version 1.105.1)
[✓] Connected device (3 available)
    ! Error: Browsing on the local area network for Abylaikhan’s iPhone. Ensure the device is unlocked and attached with a cable
      or associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources

• No issues found!

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listf: date/time pickerDate or time picker widgetsf: material designflutter/packages/flutter/material repository.found in release: 3.35Found to occur in 3.35found in release: 3.38Found to occur in 3.38frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

Type

No type
No fields configured for issues without a type.

Projects

Status
Done (PR merged)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions