Skip to content

Selecting the first or last possible date can result in error upon reopening the dialog #55

@chabad360

Description

@chabad360

Bug Description

The Picker reuses the time portion of a given DateTime if a use doesn't select a time. This can cause it to return an invalid DateTime if the user selected the earliest or latest possible date. Upon attempting to reopen the picker, the picker will crash, complaining that the _selectedDateTime is before or after the specified minimum or maximum DateTime.

Reproduction Steps

  1. Set DateTime.now().subtract(Duration(days: 7)) as the minimumDateTime.
  2. Set DateTime.now().subtract(Duration(minutes: 10)) as the initialDateTime.
  3. Select the earliest possible day (7 days ago) in the picker.
  4. Reopen the picker.
  5. Error.

Supposed solution

Picker should either disallow selecting an invalid DateTime or constrain the selection to be within the minimum and maximum.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions