syncfusion / flutter-widgets

Syncfusion Flutter widgets libraries include high quality UI widgets and file-format packages to help you create rich, high-quality applications for iOS, Android, and web from a single code base.
1.48k stars 700 forks source link

[syncfusion_flutter_datepicker] Enable customization on "_getActionsButton" #1937

Open omi-ramdelatina opened 1 week ago

omi-ramdelatina commented 1 week ago

Use case

As a developer I want to have a fully customizable action buttons "Cancel" & "OK". Current implementation only relies on below code block, in which a bit limiting. Lastly, "Action buttons" alignment parameter should also be available.

// date_picker.dart lines 7055-7060
Color textColor =
    widget.todayHighlightColor ?? _datePickerTheme.todayHighlightColor!;
if (textColor == Colors.transparent) {
  final TextStyle style = _datePickerTheme.todayTextStyle!;
  textColor = style.color != null ? style.color! : Colors.blue;
}

Proposal

I don't know how to properly implement this but maybe create a dedicated class for action button styling?

class DateRangePickerActionButtonStyle {
  // alignment
  // confirmButtonStyle
  // confirmTextStyle
  // cancelButtonStyle
  // cancelTextStyle
}
PreethikaSelvam commented 1 week ago

Hi @omi-ramdelatina,

We have analyzed your query, but currently, we do not have direct support for achieving your requirement. However, we have prepared a workaround sample to achieve your requirement by adding a custom button and handling the selected date through the DateRangePickerController. We have shared a sample for your reference. You can modify the sample based on your needs.

Please let us know if you need any further assistance.

Regards,

Preethika Selvam. gh1937.zip