Epic: A
Depends on: TP-02
Source: docs/theme-parser-github-issues.md
Goal
Create an immutable model for Querya custom theme manifests without converting colors to Flutter Color yet.
Files
lib/core/theme/parser/querya_theme_manifest.dart
test/core/theme/parser/querya_theme_manifest_test.dart
Implementation
Add:
enum QueryaThemeType { dark, light }
class QueryaThemeManifest {
const QueryaThemeManifest({
required this.schema,
required this.id,
required this.name,
required this.type,
required this.shadcnColors,
required this.editorColors,
this.tokenColors = const [],
this.description,
this.author,
this.version,
});
}
class QueryaThemeManifestParseException implements Exception {
const QueryaThemeManifestParseException(this.message);
final String message;
}
Fields:
schema: String
id: String
name: String
type: QueryaThemeType
shadcnColors: Map<String, String>
editorColors: Map<String, String>
tokenColors: List<TokenColorRule>
- optional metadata fields.
Add QueryaThemeManifest.fromJsonString(String raw).
Use existing:
stripJsonc
TokenColorRule / existing token color parser path where possible.
Performance Notes
- Do not create
Color, QueryaTheme, or ThemeData here.
- Keep maps unmodifiable.
- Parsing should be pure and synchronous for a single file; async belongs in services.
Acceptance Criteria
- Valid dark/light fixtures parse.
- JSONC fixture parses.
- Missing required fields throw
QueryaThemeManifestParseException.
- Unknown fields are ignored.
- Returned maps are immutable or safely copied.
Tests
Cover:
- valid full dark;
- valid full light;
- minimal manifest;
- JSONC comments/trailing commas;
- missing
id;
- invalid
type;
- empty
shadcn_colors / editor_colors behavior according to docs.
Epic: A
Depends on: TP-02
Source:
docs/theme-parser-github-issues.mdGoal
Create an immutable model for Querya custom theme manifests without converting colors to Flutter
Coloryet.Files
lib/core/theme/parser/querya_theme_manifest.darttest/core/theme/parser/querya_theme_manifest_test.dartImplementation
Add:
Fields:
schema: Stringid: Stringname: Stringtype: QueryaThemeTypeshadcnColors: Map<String, String>editorColors: Map<String, String>tokenColors: List<TokenColorRule>Add
QueryaThemeManifest.fromJsonString(String raw).Use existing:
stripJsoncTokenColorRule/ existing token color parser path where possible.Performance Notes
Color,QueryaTheme, orThemeDatahere.Acceptance Criteria
QueryaThemeManifestParseException.Tests
Cover:
id;type;shadcn_colors/editor_colorsbehavior according to docs.