Athena — roomy-mobile/archive/changes/2025-12-28-fix-runtime-locale-switching/tasks/003-migrate-services.md


status: done

Task: Migrate services to use S.current for error messages

End Goal

All services that return TurboResponse.fail() or similar error constructs use S.current instead of gStrings, maintaining the same behavior but removing the gStrings dependency.

Currently

Services use gStrings for error messages:

return TurboResponse.fail(title: gStrings.errorTitle);

Should

Services use S.current directly:

return TurboResponse.fail(title: S.current.errorTitle);

Constraints

  • [ ] Services do not have BuildContext access - use S.current
  • [ ] Error messages reflect the locale at error generation time (acceptable)
  • [ ] Import S from lib/generated/l10n.dart

Acceptance Criteria

  • [ ] No gStrings usages remain in any service file
  • [ ] All services import S from generated path
  • [ ] flutter analyze passes

Implementation Checklist

  • [x] 3.1 Migrate lib/auth/services/auth_service.dart (11 usages)
  • [x] 3.2 Migrate lib/auth/services/email_service.dart (10 usages)
  • [x] 3.3 Migrate lib/auth/services/user_service.dart (2 usages)
  • [x] 3.4 Migrate lib/cleaning/services/cleaning_tasks_service.dart (2 usages)
  • [x] 3.5 Migrate lib/feedback/services/dialog_service.dart (4 usages)
  • [x] 3.6 Migrate lib/feedbacks/services/feedback_storage_service.dart (4 usages)
  • [x] 3.7 Migrate lib/firebase/cloud_functions/apis/cloud_functions_api.dart (14 usages)
  • [x] 3.8 Migrate lib/households/services/household_invites_service.dart (8 usages)
  • [x] 3.9 Migrate lib/households/services/household_service.dart (2 usages)
  • [x] 3.10 Migrate lib/shopping/services/image_service.dart (4 usages)
  • [x] 3.11 Migrate lib/shopping/services/shopping_list_item_dtos_service.dart (2 usages)
  • [x] 3.12 Migrate lib/auth/mixins/firebase_auth_exception_handler.dart (32 usages)
  • [x] 3.13 Run flutter analyze

Notes

The firebase_auth_exception_handler.dart has the highest usage count (32) and handles Firebase authentication errors. All error messages should be migrated to S.current.

Reacties

Nog geen reacties