One loading boolean cannot explain a screen that already has data while refreshing, saving an edit, or retrying an attachment. Model the operation the user is waiting for and preserve useful content when it remains valid.
The same applies to errors. A failed refresh, rejected permission, invalid input, and uncertain submission need different explanations and recovery paths.
Separate initial load from work on existing data
Define states for no data yet, current data, refreshing, stale-but-usable data where appropriate, and unrecoverable load failure. Represent write progress separately so saving one record does not hide the entire screen unnecessarily.
Use the current Flutter architecture guide to think about ownership of presentation state. The specific state model should follow the feature rather than a universal enum copied across every screen.
Walk through a fictional request-detail screen
Suppose a staff member opens a service request. On first load, the app can show a skeleton or focused progress state. If a later refresh fails, the existing details may remain visible with a clear indication that the latest state could not be checked.
When the staff member saves a note, show that action's progress and prevent accidental repeated submission under the duplicate policy. If validation fails, retain the note and point to the field. If access was removed, explain the permission change rather than suggesting an endless retry.
Test a slow first load, empty result, refresh failure, partial attachment failure, write rejection, and network interruption after a successful save. For the last case, distinguish uncertain confirmation from a definite unsaved state before inviting another submission.
Keep recovery specific and accessible
Place the next action near the affected task. Retry can help a temporary fetch failure; correcting a value helps validation; signing in helps session expiry only when current access still exists. Do not use the same button for every failure.
Make status changes understandable without relying on colour alone. Consider screen-reader announcements, focus after errors, and whether a spinner leaves keyboard users without a route back. A state that looks clear in a screenshot may still be confusing during interaction.
The tradeoff is completeness versus state explosion. Start from meaningful user situations and consolidate only when recovery and data meaning are genuinely the same. A small explicit model is easier to test than many loosely related booleans.
The Social App case study provides mobile-product context. This service-request screen is fictional and includes no device measurement or reported incident.
Questions about Flutter loading states
Should a refresh replace existing data with a spinner?
Only when keeping the old data would mislead the user. Otherwise, retain useful content and explain the refresh state.
Is every error retryable?
No. Validation, permissions, missing resources, and uncertain writes require distinct decisions. Match the action to the failure.
What should be tested first?
Save an edit while refresh fails and verify the draft, status, and recovery path independently. Bring confusing combinations to a Flutter interface-state review.