Commit 7138c8c
committed
refactor(widgets): make AvailabilityStatus switches exhaustiveness-checked
Both switches over AvailabilityStatus in drink_card.dart were C-style
switch statements, which are not exhaustiveness-checked. The semantic
label switch had no safety net at all: a seventh enum value would fall
through and silently omit availability from the screen-reader label.
#349 established that the festival status_text vocabulary is not stable
across festivals, so a new status value is a realistic event.
Both are now switch expressions with no wildcard arm, so a new enum
value is a compile error. Verified by adding a seventh value and
confirming non_exhaustive_switch_expression fires at both sites.
Output is unchanged.
Fixes #534
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ER7MeRfgMqxnaKBGDaSRWy1 parent c4f18d2 commit 7138c8c
1 file changed
Lines changed: 21 additions & 49 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
182 | 174 | | |
183 | 175 | | |
184 | 176 | | |
| |||
274 | 266 | | |
275 | 267 | | |
276 | 268 | | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
306 | 278 | | |
307 | 279 | | |
308 | 280 | | |
| |||
0 commit comments