tasmeeUnderlineColorFor function
Color?
tasmeeUnderlineColorFor({
- required TasmeeWordStatus? status,
- required TasmeeErrorKind? kind,
- required TasmeeStyle style,
يحدّد لون الخط السفلي لكلمة تسميع من حالتها ونوع خطأها (null = بلا خط: المخفية والجارية والوضع غير المفعّل).
style النمط المحلول مسبقًا في نطاق بناء السطر — بلا سياق Get
(استدعاء أثناء الـ layout قد يسبق جاهزية Get.context).
Implementation
Color? tasmeeUnderlineColorFor({
required TasmeeWordStatus? status,
required TasmeeErrorKind? kind,
required TasmeeStyle style,
}) {
if (status == null || status == TasmeeWordStatus.hidden) return null;
if (status == TasmeeWordStatus.current) return null; // لها تظليل مرسوم.
return switch (status) {
TasmeeWordStatus.correct => style.correctColor,
TasmeeWordStatus.incorrect => switch (kind) {
TasmeeErrorKind.tajweed => style.tajweedErrorColor,
TasmeeErrorKind.tashkeel => style.tashkeelErrorColor,
TasmeeErrorKind.normal => style.normalErrorColor,
_ => style.incorrectColor,
},
TasmeeWordStatus.current => null,
TasmeeWordStatus.hidden => null,
};
}