CatalogService class

Constructors

CatalogService({required CatalogConfig config, required String projectRootPath, CatalogRepository? repository, CatalogStateStore? stateStore, CatalogStatusEngine? statusEngine, CatalogUiKeyResolver? uiKeyResolver})

Properties

config CatalogConfig
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
projectRootPath String
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addCustomLocale({required String localeCode, required String direction, List<String>? existingLocales}) Future<void>
T038: Adds a custom locale with ISO validation and direction specification. Validates locale code against ISO standards, checks for duplicates, and stores direction. Also verifies that the specified direction is consistent with the language's natural direction.
addKey({required String keyPath, required Map<String, dynamic> valuesByLocale, String? note, bool markGreenIfComplete = true}) Future<CatalogRow>
addLocale(String locale) Future<void>
Creates a new empty locale file.
bulkReview({required List<CatalogReviewTarget> targets}) Future<CatalogBulkReviewResult>
deleteCell({required String keyPath, required String locale}) Future<CatalogRow>
deleteKey(String keyPath) Future<void>
deleteLocale(String locale) Future<void>
Deletes a locale file permanently.
getFallbackChain(String locale) Future<FallbackChain>
T025: Gets the complete fallback chain for a locale. Returns a FallbackChain entity with the resolved chain, display string, and whether a language group fallback is configured.
getLanguageGroupFallbacks() Future<Map<String, String>>
T029 helper: Gets the current language group fallbacks configuration. Returns a map of locale -> fallback locale for all configured language group fallbacks.
getLanguageGroups(List<String> locales) Map<String, List<String>>
T022: Gets language groups from provided locales. Groups locales by their language code (e.g., en_US, en_GB -> group 'en').
getLocaleDirection(String locale) Future<String>
T039: Gets the text direction for a locale. Checks custom locale directions first, then falls back to predefined RTL language codes. Returns 'rtl' for right-to-left languages, 'ltr' for left-to-right.
loadActivity({required String keyPath}) Future<List<CatalogActivityEvent>>
loadMeta() Future<CatalogMeta>
loadRows({String? search, CatalogCellStatus? status}) Future<List<CatalogRow>>
loadSummary() Future<CatalogSummary>
markReviewed({required String keyPath, required String locale}) Future<void>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeLanguageGroupFallback(String locale) Future<void>
T024: Removes a language group fallback for a locale. This is idempotent - removing a non-existent fallback is safe.
setLanguageGroupFallback({required String locale, required String newFallback, List<String>? validLocales}) Future<void>
T023: Sets a language group fallback for a locale. Validates that the fallback is in the same language group, prevents circular references, and checks locale existence. Also enforces FR-010: directionality constraint for fallbacks.
toString() String
A string representation of this object.
inherited
updateAutoGenerateDictionary(bool value) Future<CatalogConfig>
updateCell({required String keyPath, required String locale, required dynamic value}) Future<CatalogRow>
updateFallbackLocale(String locale) Future<CatalogConfig>
Updates the fallback locale in config.
updateKeyDataType({required String keyPath, required DataType dataType}) Future<CatalogRow>
updateKeyNote({required String keyPath, String? note}) Future<CatalogRow>

Operators

operator ==(Object other) bool
The equality operator.
inherited