Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DateRangePicker: adding cellBuilder makes selected date square #2302

Open
joachimbulow opened this issue Mar 11, 2025 · 2 comments
Open

DateRangePicker: adding cellBuilder makes selected date square #2302

joachimbulow opened this issue Mar 11, 2025 · 2 comments
Labels
date range picker Date range picker component open Open

Comments

@joachimbulow
Copy link

joachimbulow commented Mar 11, 2025

Bug description

version: ^27.2.5

This may not be a bug, but as soon as i provide a custom cellBuilder my selected date cell is enforced with square properties on the overlay.

Not sure if there is a way to override this?
Pretty odd behaviour imo.

Tried looking into selectionShape, adding hard properties to the cell builder function, to no avail

Steps to reproduce

Step 1: Add a default SfDateRangePicker to your app.
Step 2: Add a cellBuilder returning a circular container with the date text inside.
Step 3: Select a date. The Overlayed color is square instead of circle.

Code sample

Code sample
[Add your code here]

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Stack Traces

Stack Traces
[Add the Stack Traces here]

On which target platforms have you observed this bug?

iOS

Flutter Doctor output

Doctor output
[Add your output here]
@joachimbulow joachimbulow changed the title adding cellBuilder makes selected date square DateRangePicker: adding cellBuilder makes selected date square Mar 11, 2025
@joachimbulow
Copy link
Author

joachimbulow commented Mar 11, 2025

Also seems like selectionColor is broken. At least i could NOT get it to work in single mode.

Instead i had to resort to overriding selectionColor getter from the theme.

// Having to create a custom theme just to color a selection is a bit sad, i must admit...
//
// This related to my original question, because my workaround will be to color the selection transparent when necessary :/
//
class CustomDateRangePickerThemeData extends SfDateRangePickerThemeData {
  final BuildContext context;

  CustomDateRangePickerThemeData(this.context);

  @override
  Color? get selectionColor => Colors.red;
}

@LavanyaGowtham2021 LavanyaGowtham2021 added date range picker Date range picker component open Open labels Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
date range picker Date range picker component open Open
Projects
None yet
Development

No branches or pull requests

2 participants