Date Selection Step
Component Detail
Description
Wizard step 2 that defaults to today's date with a calendar picker available for override. The default state satisfies the overwhelming majority of registrations without any interaction, and the override path is accessible but never mandatory.
date-step
Summaries
The Date Selection Step removes a common source of unnecessary user interaction by defaulting to today's date, which is the correct value for the overwhelming majority of activity registrations. This design decision directly reduces the steps required to complete a registration, lowering drop-off risk and improving workflow efficiency across the entire user base. The override path — an accessible calendar picker — ensures edge cases are handled without burdening typical users. From a business perspective, minimising the effort required to register an activity encourages consistent data entry, improving the accuracy and completeness of organisational records that downstream reporting and compliance processes depend on.
This step is low complexity with a single dependency on activity-registration-cubit and no external service calls. The primary development tasks are integrating a platform-appropriate calendar picker, implementing the configurable future-date validation threshold, and ensuring the default date is correctly sourced and displayed on mount. The configurable threshold for future-date validation must be defined and agreed with stakeholders before implementation begins, as it affects both the validation logic and the test matrix. Testing should cover timezone edge cases, particularly for users whose device timezone differs from the organisation's operating timezone.
No significant delivery risks are anticipated, but the validation threshold configuration must be documented clearly to avoid ambiguity during QA.
Date Selection Step is a low-complexity mobile UI widget that initialises with a DateTime defaultDate passed at build time, immediately displaying it as the pre-filled value. The onDateSelected(DateTime date) callback propagates changes to activity-registration-cubit, which owns authoritative date state. openCalendarPicker() triggers the platform calendar overlay; consider using showDatePicker() from Flutter's material library or a custom accessible picker depending on design system requirements. validateDate() enforces the configurable future-date threshold — this threshold value should be injected rather than hardcoded, either via constructor parameter or retrieved from a config provider, to support organisation-level customisation.
Timezone handling is a non-trivial concern: ensure DateTime values are normalised consistently (UTC or local) throughout the Cubit and persistence layer to avoid off-by-one date bugs at midnight boundaries.
Responsibilities
- Display today's date as the pre-filled default
- Provide an accessible calendar picker for date override
- Validate that the selected date is not in the future beyond a configurable threshold
- Emit date change events to Cubit
Interfaces
build(DateTime defaultDate)
onDateSelected(DateTime date)
openCalendarPicker()
validateDate(DateTime date) -> bool