Audit finding: half-removed onboarding flows leave orphan state fields and handlers
Static analysis flags several unused fields, declarations, and locals concentrated in home_screen.dart plus one in file_browser_screen.dart. Pattern reads as "UI was refactored and removed loading spinners + cancel buttons, but the state-tracking fields and handler methods that fed them were left behind".
Findings
lib/features/home/screens/home_screen.dart
| Line |
Symbol |
What it is |
Status |
| 47 |
bool _isGettingApiKey |
API-key fetch in-progress flag |
SET (lines 72, 144, 149, 163) but never READ. Looks like the loading spinner that consumed it was removed. |
| 48 |
bool _isLinkingWallet |
Wallet-link in-progress flag |
Likely same pattern — verify no UI reads it. |
| 162 |
void _cancelGettingApiKey() |
Sets _isGettingApiKey = false |
No callers. Cancel button removed from UI. |
| 188 |
final isFullySetup |
Local: isLoggedIn && hasJwt && hasAnyWallet |
Computed but never used. Suggests a UI branch that consumed it was deleted. |
| 525 |
void _cancelLinkingWallet() |
Sets _isLinkingWallet = false and disconnects wallet |
No callers. Same as _cancelGettingApiKey. |
Note _isGettingApiKey is reset to false by _setupApiKeyListener (line 72) when the API key deep-link callback arrives. That reset is also dead because nothing reads the flag — but removing it cleanly requires removing the field, not just the assignment.
lib/features/browser/screens/file_browser_screen.dart
| Line |
Symbol |
What it is |
Status |
| 3303 |
Future<void> _createShareLink(LocalFile file) |
Comment above it: "Legacy method for backward compatibility". Body: await _createShareForRecipient(file); |
Explicitly labelled as a shim; no callers. Safe to delete the shim once you confirm no callers via reflection / dynamic dispatch (unlikely in Flutter). |
Risk
- Low in isolation — deleting unused fields/methods is a mechanical change with no behavioural impact.
- BUT: memory notes (
project_fxfiles_fa1_three_mode_signup, project_mode_bc_not_ui_wired, project_pinning_webui_wasm_redeploy) show recent and ongoing work on auth / sign-up flows. The "Mode B/C not UI-wired" memory snapshot was 2026-05-19, closed same day — but the area is in flux. There's a non-zero chance these orphan fields/methods are reserved for in-progress re-wiring rather than truly dead.
_isGettingApiKey specifically sits inside _getApiKey and _setupApiKeyListener (the active deep-link API-key flow). Removing the field means tightening that flow's surface — small chance of breaking a parked branch.
Proposed fix (NOT APPLIED)
- Delete
_isGettingApiKey, _isLinkingWallet, and the matching setters in _getApiKey, _setupApiKeyListener, _cancelGettingApiKey, _cancelLinkingWallet.
- Delete
_cancelGettingApiKey and _cancelLinkingWallet methods.
- Delete unused local
isFullySetup at line 188.
- Delete
_createShareLink shim at file_browser_screen.dart:3303-3305.
Each is a 1-3 line deletion. Total ~15 lines removed.
Verification approach (NOT APPLIED)
- Run
flutter analyze to confirm no new warnings.
- Run existing widget tests for
home_screen and file_browser_screen to confirm no behaviour regression.
- Manually test the API-key fetch + wallet-link flow end-to-end on a device to confirm the UI doesn't depend on these state fields via setState rebuilds we didn't see.
Recommendation
Defer pending owner confirmation that none of these are parked for an in-progress feature. If the owner confirms genuinely-dead, this is a quick janitorial PR. Easy to bundle with the other "info"-level cleanup PR (deprecated withOpacity migration, unused imports).
Tracking only — no code changes applied per "100%-sure-or-don't-touch" rule.
Audit finding: half-removed onboarding flows leave orphan state fields and handlers
Static analysis flags several unused fields, declarations, and locals concentrated in
home_screen.dartplus one infile_browser_screen.dart. Pattern reads as "UI was refactored and removed loading spinners + cancel buttons, but the state-tracking fields and handler methods that fed them were left behind".Findings
lib/features/home/screens/home_screen.dartbool _isGettingApiKeybool _isLinkingWalletvoid _cancelGettingApiKey()_isGettingApiKey = falsefinal isFullySetupisLoggedIn && hasJwt && hasAnyWalletvoid _cancelLinkingWallet()_isLinkingWallet = falseand disconnects wallet_cancelGettingApiKey.Note
_isGettingApiKeyis reset to false by_setupApiKeyListener(line 72) when the API key deep-link callback arrives. That reset is also dead because nothing reads the flag — but removing it cleanly requires removing the field, not just the assignment.lib/features/browser/screens/file_browser_screen.dartFuture<void> _createShareLink(LocalFile file)await _createShareForRecipient(file);Risk
project_fxfiles_fa1_three_mode_signup,project_mode_bc_not_ui_wired,project_pinning_webui_wasm_redeploy) show recent and ongoing work on auth / sign-up flows. The "Mode B/C not UI-wired" memory snapshot was 2026-05-19, closed same day — but the area is in flux. There's a non-zero chance these orphan fields/methods are reserved for in-progress re-wiring rather than truly dead._isGettingApiKeyspecifically sits inside_getApiKeyand_setupApiKeyListener(the active deep-link API-key flow). Removing the field means tightening that flow's surface — small chance of breaking a parked branch.Proposed fix (NOT APPLIED)
_isGettingApiKey,_isLinkingWallet, and the matching setters in_getApiKey,_setupApiKeyListener,_cancelGettingApiKey,_cancelLinkingWallet._cancelGettingApiKeyand_cancelLinkingWalletmethods.isFullySetupat line 188._createShareLinkshim atfile_browser_screen.dart:3303-3305.Each is a 1-3 line deletion. Total ~15 lines removed.
Verification approach (NOT APPLIED)
flutter analyzeto confirm no new warnings.home_screenandfile_browser_screento confirm no behaviour regression.Recommendation
Defer pending owner confirmation that none of these are parked for an in-progress feature. If the owner confirms genuinely-dead, this is a quick janitorial PR. Easy to bundle with the other "info"-level cleanup PR (deprecated
withOpacitymigration, unused imports).Tracking only — no code changes applied per "100%-sure-or-don't-touch" rule.