26 lines
769 B
Dart
26 lines
769 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
import '../../core/observations/observed_event.dart';
|
|
|
|
class SeverityBadge extends StatelessWidget {
|
|
const SeverityBadge({required this.level, super.key});
|
|
|
|
final MavSeverity level;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final (icon, color) = switch (level.wireValue) {
|
|
0 || 1 || 2 || 3 => (Icons.error_outline, Colors.red.shade700),
|
|
4 => (Icons.warning_amber_outlined, Colors.orange.shade800),
|
|
5 || 6 => (Icons.info_outline, Colors.blue.shade700),
|
|
7 => (Icons.bug_report_outlined, Colors.grey.shade700),
|
|
_ => (Icons.help_outline, Colors.grey.shade700),
|
|
};
|
|
|
|
return Semantics(
|
|
label: 'Severity: ${level.label}',
|
|
child: Icon(icon, color: color),
|
|
);
|
|
}
|
|
}
|