refactor: reduce model and focus boilerplate

This commit is contained in:
edde746
2026-05-06 00:26:44 +02:00
parent 18a5041334
commit 91c23786f2
36 changed files with 624 additions and 364 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ class LogEntry {
final Object? error;
final StackTrace? stackTrace;
LogEntry({required this.timestamp, required this.level, required this.message, this.error, this.stackTrace});
const LogEntry({required this.timestamp, required this.level, required this.message, this.error, this.stackTrace});
/// Estimate the memory size of this log entry in bytes
int get estimatedSize {
+3
View File
@@ -173,6 +173,9 @@ String toBulletedString(List<String> parts) {
return parts.join(' · ');
}
String formatRating(double value) =>
value == value.truncateToDouble() ? value.toInt().toString() : value.toStringAsFixed(1);
final RegExp _trailingZeroPattern = RegExp(r'\.?0+$');
/// Format a playback rate for display (e.g. 1.25 → "1.25x", 2.0 → "2x").