Benefit Calculator Screen
Component Detail
Description
Main interactive screen that guides the peer mentor through the benefit calculation flow. Presents input controls, live-updating results, and a call-to-action to share the generated results card.
benefit-calculator-screen
Summaries
The Benefit Calculator Screen is the primary value-demonstration tool for peer mentors, enabling them to instantly see and communicate the tangible impact of their volunteer work in terms of hours saved and costs avoided. By putting a shareable, visually compelling results card directly in the hands of volunteers, the organisation transforms abstract goodwill into concrete ROI narratives that can be shared on social media or used in recruitment conversations. This drives volunteer retention, strengthens the programme's public health funding case, and differentiates the organisation's volunteer platform from competitors who offer no such impact quantification. The cost of building and maintaining this screen is low given its narrow, well-defined scope.
This screen is the user-facing entry point for the entire benefit calculation feature and carries low implementation complexity. It composes three existing components — the input panel, results card, and calculation service — so the primary delivery risk is coordination of those dependencies being ready before integration testing begins. The screen itself requires minimal logic; most complexity sits downstream. QA should verify reactive update behaviour (results refresh on each input change), the share flow handoff, and the reset state.
No backend calls are made from this screen, which eliminates network-related delivery risk and simplifies test environment setup. Estimated delivery is 1–2 days once dependencies are stable.
BenefitCalculatorScreen is a stateful Flutter widget that acts as the orchestration layer for the calculation feature. It holds local form state and passes change callbacks (`onInputChanged`) down to `CalculatorInputPanel`, which emits typed change events. On each change, the screen invokes `BenefitCalculationService.calculate()` synchronously (pure function, no async) and passes the resulting `BenefitCalculationResult` to `BenefitResultsCard` for display. The `onShareTapped` callback triggers image capture via `BenefitResultsCard.captureAsImage()` and hands the `Uint8List` to the platform share sheet.
`onResetTapped` resets local state and calls `CalculatorInputPanel.reset()`. The widget tree is a single `CustomScrollView` with two slivers — input panel and results card — ensuring the screen is usable on small-viewport phones without fixed-height layout constraints.
Responsibilities
- Render calculator input and output sections in a single scrollable view
- Update results display reactively as inputs change
- Provide accessible entry point to share flow
Interfaces
build(BuildContext)
onInputChanged(field, value)
onShareTapped()
onResetTapped()
Relationships
Dependencies (3)
Components this component depends on