mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-11-11 13:27:47 +01:00
Two-package monorepo: - horatio_core: pure Dart package (parser, SRS, planner) - horatio_app: Flutter UI (Bloc/Cubit, GoRouter, TTS) Features: - Script import (txt, docx, pdf) with drag-and-drop - Four script format parsers (colon, bracketed, parenthetical, screenplay) - SM-2 spaced repetition for line memorization - Rehearsal mode with TTS and line comparison - 5 bundled public domain scripts Quality: - 83 core tests + 160 app tests, both 100% branch coverage - Strict analysis (130+ lint rules, fatal-infos) - Dead code detection script (dead_code.sh) - run.sh pipeline: analyze, test, dead-code, run, web - Pre-commit hook for horatio test coverage
29 lines
968 B
Dart
29 lines
968 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:horatio_core/horatio_core.dart';
|
|
|
|
/// A visual grade badge for line matching feedback.
|
|
class GradeBadge extends StatelessWidget {
|
|
/// Creates a [GradeBadge].
|
|
const GradeBadge({required this.grade, super.key});
|
|
|
|
/// The match grade to display.
|
|
final LineMatchGrade grade;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final (String label, Color color, IconData icon) = switch (grade) {
|
|
LineMatchGrade.exact => ('Perfect!', Colors.green, Icons.check_circle),
|
|
LineMatchGrade.minor => ('Close', Colors.orange, Icons.info_outline),
|
|
LineMatchGrade.major => ('Needs Work', Colors.deepOrange, Icons.warning),
|
|
LineMatchGrade.missed => ('Missed', Colors.red, Icons.cancel),
|
|
};
|
|
|
|
return Chip(
|
|
avatar: Icon(icon, color: color, size: 20),
|
|
label: Text(label),
|
|
backgroundColor: color.withValues(alpha: 0.15),
|
|
side: BorderSide(color: color),
|
|
);
|
|
}
|
|
}
|