Skip to content

Conversation

@Hixie
Copy link
Contributor

@Hixie Hixie commented Aug 10, 2023

This enables our various date picker classes to have a null initialDate.

It also fixes the logic of some of the widgets which used to do something when you changed the initial* parameters, which is wrong for initial* properties (they by definition should only impact the initial state) and wrong for properties in general (behaviour should not change based on whether the widget was built with a new value or not, that violates the reactive design principles).

Fixes #638.

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Aug 10, 2023
Copy link
Contributor

@HansMuller HansMuller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't DatePicker.initialEntryMode also need to be updated?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change the key explanations are really useful; I'm not sure that most developers would appreciate what you mean otherwise.

@Hixie
Copy link
Contributor Author

Hixie commented Aug 17, 2023

Doesn't DatePicker.initialEntryMode also need to be updated?

As far as I can tell it's already doing the right thing. If you mean the documentation, then I did try to update it but I wasn't really sure what it should say. I don't want to recommend resetting the key just to change the mode because that'll reset everything else as well which seems rather disruptive (compared to when changing the selected date, where you kind of want to be resetting everything? I think?).

This enables our various date picker classes to have a null `initialDate`.

It also fixes the logic of some of the widgets which used to do something when you _changed_ the `initial*` parameters, which is wrong for `initial*` properties (they by definition should only impact the initial state) and wrong for properties in general (behaviour should not change based on whether the widget was built with a new value or not, that violates the reactive design principles).
@Hixie
Copy link
Contributor Author

Hixie commented Aug 17, 2023

I updated the branch and will mark it to land on green but feel free to remove the autosubmit label if you have a particular thing you'd like me to change for initialEntryMode.

@Hixie Hixie added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 17, 2023
@HansMuller
Copy link
Contributor

The initialEntryMode parameter seemed like it needed a /// Subsequently changing this has no effect ... comment just for the sake of symmetry. I agree that resetting this parameter with a new key is likely to lead to more confusion; I'm fine with leaving things as they are here.

@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Aug 17, 2023
@auto-submit
Copy link
Contributor

auto-submit bot commented Aug 17, 2023

auto label is removed for flutter/flutter/132343, due to - The status or check suite Linux web_tests_5 has failed. Please fix the issues identified (or deflake) before re-applying this label.

@Hixie Hixie added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 17, 2023
@auto-submit auto-submit bot merged commit d19fb63 into flutter:master Aug 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 18, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 18, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 18, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 18, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DatePicker should allow the selected date to be null

2 participants