StructuralRule class

Regra estrutural do tema: uma checagem sobre uma cor (não um par fg/bg), como "a superfície escura não é preto puro". Vive na mesma fonte única que flocksContrastContract e é iterada pelos mesmos consumidores (testes + relatório), eliminando o if (brightness == dark) duplicado.

Annotations

Constructors

StructuralRule({required String id, required String label, required ColorSelector subject, required double metric(AppColorTheme theme), required String metricPrefix, required String targetLabel, required bool check(AppColorTheme theme), bool appliesTo(AppBrightness brightness)?})
Cria uma regra estrutural identificada por id.
const

Properties

appliesTo bool Function(AppBrightness brightness)?
Se dado, a regra só vale para o brilho em que retorna true (ex.: regras só do tema escuro).
final
check bool Function(AppColorTheme theme)
true quando a regra é satisfeita pelo tema.
final
hashCode int
The hash code for this object.
no setterinherited
id String
Identificador legível (ex.: surface fora do preto puro).
final
label String
Rótulo da categoria (coluna "Tier" do relatório, ex.: darkSurface).
final
metric double Function(AppColorTheme theme)
Métrica numérica avaliada (ex.: o tom HCT da superfície).
final
metricPrefix String
Prefixo da métrica no relatório (ex.: T=).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
subject ColorSelector
Cor avaliada — usada para exibir o hex no relatório.
final
targetLabel String
Rótulo do alvo no relatório e nas mensagens de falha (ex.: [6.0, 16.0]).
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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