pda_template/lib/app/enum/stand.dart
liyuqi da66e8e96a 1. 架构设计:
* 业务逻辑与UI解耦合
* 生产者消费者模式
* 仓库模式
* 观察者模式
2. 页面开发:
* 空载具入库
* 手动码盘入库
* 呼叫空托
2025-04-14 23:28:20 +08:00

26 lines
739 B
Dart

enum Stand {
stand1(point: "P1", message: "1号拣选站台"),
stand2(point: "P2", message: "2号拣选站台"),
stand3(point: "P3", message: "3号拣选站台"),
stand4(point: "R1", message: "1号入库站台");
final String point;
final String message;
const Stand({required this.point, required this.message});
static Stand? getStandByCode(String point) {
return Stand.values.firstWhere(
(stand) => stand.point == point,
orElse: () => throw Exception('未找到对应的站台'),
);
}
static Stand? getStandByMessage(String message) {
return Stand.values.firstWhere(
(stand) => stand.message == message,
orElse: () => throw Exception('未找到对应的站台'),
);
}
}