Period Preset List Widget
Component Detail
Description
Renders the list of predefined period options (calendar year, Bufdir fiscal periods) sourced from the organization's configuration. Each preset is selectable and highlights the currently active choice.
period-preset-list
Summaries
The Period Preset List Widget eliminates a significant source of user error by presenting only the reporting periods that are contractually and operationally relevant to each organization. Rather than requiring staff to manually enter dates — which frequently leads to mismatched or out-of-scope submissions — this component surfaces the exact fiscal cycles configured for that organization's agreement with Bufdir. The result is faster report initiation, fewer corrections, and a materially lower risk of submitting data for incorrect periods. For management, this translates directly into reduced rework costs and improved data credibility with the funding authority.
This is a low-complexity UI widget with a well-contained scope: rendering a list of period presets and tracking which one is selected. It has no external service dependencies, so it can be developed and tested in isolation with straightforward mock data. Development effort is minimal — estimate one to two days including unit tests. The main dependency to coordinate is the availability of the period-preset data model and the organization configuration contract, which must be finalized before this widget can be integrated end-to-end.
No deployment blockers are anticipated; the widget ships as part of the standard frontend build.
Period Preset List Widget is a stateless Flutter UI component that receives a list of PeriodPreset objects and an active selection identifier, then renders a selectable list with highlight state. It exposes three interfaces: build(BuildContext) for standard widget rendering, onPresetTapped(PeriodPreset) as a callback to the parent controller when a user selects a preset, and setSelected(String presetId) to programmatically update the highlighted item. It has zero service dependencies — all data flows in from the parent via constructor or setState. Internally it maps over the preset list and compares each item's id against the current selection to apply the active highlight style.
The data_models dependency on period-preset means the widget must import the PeriodPreset entity model. Future evolution should consider supporting keyboard navigation for accessibility compliance on desktop form factors.
Responsibilities
- Display organization-specific period presets
- Handle preset selection state
- Highlight selected preset
Interfaces
build(BuildContext)
onPresetTapped(PeriodPreset)
setSelected(String presetId)