feat(news,calendar): improve corporate calendar filters and news sentiment dialogs

This commit is contained in:
2026-08-15 19:30:00 +02:00
parent 067f1bfdd5
commit 960a4bdbd6
11 changed files with 556 additions and 87 deletions
+16 -5
View File
@@ -15,15 +15,26 @@ class StatusBadge extends StatelessWidget {
});
factory StatusBadge.sentiment(String status, {double? score}) {
Color bg = AppTheme.textMuted;
if (status.toUpperCase().contains('POS') || (score != null && score > 0.15)) {
final sUpper = status.trim().toUpperCase();
Color bg;
if (sUpper.contains('POS')) {
bg = AppTheme.primaryEmerald;
} else if (status.toUpperCase().contains('NEG') || (score != null && score < -0.15)) {
} else if (sUpper.contains('NEG')) {
bg = AppTheme.accentRed;
} else if (status.toUpperCase().contains('NEU')) {
} else if (sUpper.contains('NEU')) {
bg = AppTheme.accentCyan;
} else if (score != null) {
if (score > 0.15) {
bg = AppTheme.primaryEmerald;
} else if (score < -0.15) {
bg = AppTheme.accentRed;
} else {
bg = AppTheme.accentCyan;
}
} else {
bg = AppTheme.textMuted;
}
return StatusBadge(label: status.toUpperCase(), color: bg);
return StatusBadge(label: sUpper.isNotEmpty ? sUpper : 'NEUTRAL', color: bg);
}
@override