USB 摄像头+远程遥控+中英的适配+topic的集成和状态的使用到相应页面
This commit is contained in:
168
lib/features/pv_control/presentation/theme/pv_colors.dart
Normal file
168
lib/features/pv_control/presentation/theme/pv_colors.dart
Normal file
@@ -0,0 +1,168 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// 光伏电站机器人远程控制横屏页专用配色(深蓝科技风大屏风格)
|
||||
///
|
||||
/// 该页面是独立的横屏大屏可视化界面,视觉风格与常规浅色/深色 [AppColors]
|
||||
/// 完全不同,因此单独维护一套固定配色,不随系统主题切换。
|
||||
/// 颜色取自设计稿:深蓝渐变底 + 青色描边发光 + 语义状态色。
|
||||
class PvColors {
|
||||
PvColors._();
|
||||
|
||||
// ===== 背景 =====
|
||||
/// 页面底色(最深,接近黑蓝)
|
||||
static const Color bgDeepest = Color(0xFF040A16);
|
||||
|
||||
/// 渐变起始(左上)
|
||||
static const Color bgGradientTop = Color(0xFF0A1A30);
|
||||
|
||||
/// 渐变结束(右下)
|
||||
static const Color bgGradientBottom = Color(0xFF050C1A);
|
||||
|
||||
// ===== 卡片 / 面板 =====
|
||||
/// 卡片填充(半透明蓝)
|
||||
static const Color card = Color(0xE6102338);
|
||||
|
||||
/// 卡片内嵌块填充
|
||||
static const Color cardInner = Color(0x331E3A5F);
|
||||
|
||||
/// 卡片描边(青色微光)
|
||||
static const Color cardBorder = Color(0x662FB6E0);
|
||||
|
||||
// ===== 强调 / 主色 =====
|
||||
/// 科技青主色
|
||||
static const Color accent = Color(0xFF22D3EE);
|
||||
|
||||
/// 亮青(图标高亮)
|
||||
static const Color accentBright = Color(0xFF5FEBFF);
|
||||
|
||||
// ===== 文字 =====
|
||||
static const Color textPrimary = Color(0xFFF2F7FC);
|
||||
static const Color textSecondary = Color(0xFF9DB2C9);
|
||||
static const Color textTertiary = Color(0xFF6A819B);
|
||||
|
||||
// ===== 语义状态色 =====
|
||||
/// 危险 / 紧急停止 / 障碍物预警
|
||||
static const Color danger = Color(0xFFFF3B4E);
|
||||
|
||||
/// 在线 / 成功
|
||||
static const Color online = Color(0xFF22E0A0);
|
||||
|
||||
/// 警告
|
||||
static const Color warning = Color(0xFFFFA940);
|
||||
|
||||
/// 信息蓝(速度、温度等仪表)
|
||||
static const Color info = Color(0xFF3FA9FF);
|
||||
|
||||
/// 页面背景渐变
|
||||
static const LinearGradient pageGradient = LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [bgGradientTop, bgGradientBottom],
|
||||
);
|
||||
|
||||
/// 标准卡片装饰:半透明蓝底 + 青色描边 + 圆角
|
||||
static BoxDecoration panel({
|
||||
double radius = 14,
|
||||
Color? fill,
|
||||
Color? border,
|
||||
bool glow = false,
|
||||
}) {
|
||||
return BoxDecoration(
|
||||
color: fill ?? card,
|
||||
borderRadius: BorderRadius.circular(radius),
|
||||
border: Border.all(color: border ?? cardBorder, width: 1),
|
||||
boxShadow: glow
|
||||
? [
|
||||
BoxShadow(
|
||||
color: accent.withValues(alpha: 0.18),
|
||||
blurRadius: 16,
|
||||
spreadRadius: 1,
|
||||
),
|
||||
]
|
||||
: null,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// 统一排版规范:收敛字号阶梯与行高,避免各组件各写各的导致视觉不和谐。
|
||||
///
|
||||
/// 所有 pv_control 组件的文本都应引用这里的样式,需要变色时用 `copyWith(color: ...)`。
|
||||
class PvType {
|
||||
PvType._();
|
||||
|
||||
/// 统一行高倍数,让多行文本的纵向节奏一致。
|
||||
static const double lh = 1.2;
|
||||
|
||||
/// 顶部导航主标题
|
||||
static const TextStyle navTitle = TextStyle(
|
||||
color: PvColors.textPrimary,
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w800,
|
||||
letterSpacing: 1.5,
|
||||
height: lh,
|
||||
);
|
||||
|
||||
/// 顶部导航副标题
|
||||
static const TextStyle navSubtitle = TextStyle(
|
||||
color: PvColors.textSecondary,
|
||||
fontSize: 10,
|
||||
letterSpacing: 1,
|
||||
height: lh,
|
||||
);
|
||||
|
||||
/// 卡片标题(设备名 / 驾驶模式 / 浮层标题)
|
||||
static const TextStyle cardTitle = TextStyle(
|
||||
color: PvColors.textPrimary,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w700,
|
||||
height: lh,
|
||||
);
|
||||
|
||||
/// 仪表数值(速度 / 里程 / 温度)
|
||||
static const TextStyle metricValue = TextStyle(
|
||||
color: PvColors.textPrimary,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w800,
|
||||
height: lh,
|
||||
);
|
||||
|
||||
/// 文本型数值(网络“正常”等短词)
|
||||
static const TextStyle metricText = TextStyle(
|
||||
color: PvColors.textPrimary,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w800,
|
||||
height: lh,
|
||||
);
|
||||
|
||||
/// 正文
|
||||
static const TextStyle body = TextStyle(
|
||||
color: PvColors.textPrimary,
|
||||
fontSize: 12,
|
||||
height: lh,
|
||||
);
|
||||
|
||||
/// 次要标签 / 说明
|
||||
static const TextStyle label = TextStyle(
|
||||
color: PvColors.textSecondary,
|
||||
fontSize: 11,
|
||||
height: lh,
|
||||
);
|
||||
|
||||
/// 更小的辅助文字(单位 / 角标 / 徽标)
|
||||
static const TextStyle caption = TextStyle(
|
||||
color: PvColors.textSecondary,
|
||||
fontSize: 10,
|
||||
height: lh,
|
||||
);
|
||||
}
|
||||
|
||||
/// 统一间距刻度,供各组件纵向 / 横向留白引用,保证节奏和谐。
|
||||
class PvGap {
|
||||
PvGap._();
|
||||
|
||||
static const double xs = 4;
|
||||
static const double sm = 6;
|
||||
static const double md = 8;
|
||||
static const double lg = 10;
|
||||
static const double xl = 14;
|
||||
}
|
||||
Reference in New Issue
Block a user