Service Layer medium complexity mobileshared
0
Dependencies
0
Dependents
2
Entities
0
Integrations

Description

Core service that fetches the active organization's label configuration from Supabase on app startup and caches it in the Riverpod state layer. Provides synchronous label resolution across the entire app, injecting organization-specific strings into all UI components that use the Dynamic Label Widget.

Feature: Organization Labels & Terminology

labels-service

Responsibilities

  • Fetch label configuration from Supabase on app startup
  • Cache resolved labels in Riverpod state for synchronous access
  • Provide type-safe label resolution using Dart constants key definitions
  • Invalidate and refresh cache when organization context changes
  • Support locale-specific overrides for future Sami language support

Interfaces

loadLabelsForOrganization(organizationId)
getLabel(LabelKey key)
getLabelWithFallback(LabelKey key, String fallback)
refreshLabels()
setActiveOrganization(organizationId)
getActiveLabelConfig()
subscribeToLabelChanges()
clearCache()
getSupportedLocales()

Related Data Entities (2)

Data entities managed by this component