Files
flutterApp/lib/features/v2/waring_center/presentation/constants/alarm_constants.dart
2026-08-18 08:52:33 +08:00

99 lines
2.0 KiB
Dart

/// 告警中心全局常量
/// 包含颜色、尺寸、枚举等全局配置
library;
import 'package:flutter/material.dart';
/// 颜色常量(仅保留告警等级等模式无关的品牌语义色,
/// UI 层颜色请使用 context.appColors 语义色)
class AlarmColors {
/// 主色调
static const Color primary = Color(0xFF165DFF);
/// 高危色 - 红色告警
static const Color danger = Color(0xFFF53F3F);
/// 中危色 - 橙色告警
static const Color warning = Color(0xFFFF7D00);
/// 低危色 - 绿色告警
static const Color success = Color(0xFF00B42A);
/// 提示色 - 蓝色提示
static const Color info = Color(0xFF69b1ff);
}
/// 尺寸常量
class AlarmDimensions {
/// 通用圆角
static const double borderRadius = 16.0;
/// 水平边距
static const double horizontalPadding = 16.0;
/// 模块间距
static const double moduleSpacing = 20.0;
/// 导航栏高度
static const double appBarHeight = 44.0;
}
/// 告警等级枚举
enum AlarmLevel {
/// 高危
danger('高危', AlarmColors.danger, Icons.warning_rounded),
/// 中危
warning('中危', AlarmColors.warning, Icons.warning_amber_rounded),
/// 低危
low('低危', AlarmColors.success, Icons.info_rounded),
/// 提示
info('提示', AlarmColors.info, Icons.info_outline_rounded);
const AlarmLevel(this.label, this.color, this.icon);
/// 显示文本
final String label;
/// 颜色
final Color color;
/// 图标
final IconData icon;
}
/// 告警状态枚举
enum AlarmStatus {
/// 待处理
pending('待处理'),
/// 处理中
processing('处理中'),
/// 已关闭
closed('已关闭'),
/// 已忽略
ignored('已忽略');
const AlarmStatus(this.label);
/// 显示文本
final String label;
}
/// 筛选标签枚举
enum AlarmFilterTab {
all('全部'),
unprocessed('未处理'),
confirmed('已确认'),
recovered('已恢复');
const AlarmFilterTab(this.label);
/// 显示文本
final String label;
}