| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- import 'package:fixnum/fixnum.dart';
- import 'package:get/get.dart';
- import 'm_net_image.dart';
- import 'm_position.dart';
- import 'package:trackoffical_app/pb.dart' as pb;
- class ProjectInfo {
- Int64 id = Int64(0);
- // 方案图片
- MNetImage pic = MNetImage();
- String name = "";
- String address = "";
- MPosition position = MPosition();
- // 项目介绍
- String introduction = "";
- // 及格线,关门时间
- Duration passLine = 0.seconds;
- // 结束时限
- Duration deadLine = 0.seconds;
- int totalControlNum = 0;
- // 直线距离:米
- int straightLineDistance = 0;
- bool isInGame = false;
- // 地图图片
- MNetImage image = MNetImage();
- // 比例尺
- int mapScale = 0;
- // 等高距(米)
- int contourIntervalM = 0;
- List<MapRoute> routes = [];
- }
- class MapRoute {
- Int64 id = Int64(0);
- String name = "";
- MNetImage image = MNetImage();
- }
- extension PbProjectInfoExtension on pb.ProjectInfoSimple {
- ProjectInfo toModel() {
- return ProjectInfo()
- ..id = rsId
- ..name = rsName
- ..address = addr
- ..pic = projectImage.toModel()
- ..position = position.toModel()
- ..isInGame = isInGame;
- }
- }
- extension PbProjectDetailExtension on pb.ProjectDetailReply {
- ProjectInfo toModel() {
- final out = baseInfo.toModel();
- out.introduction = content;
- out.passLine = lockup.seconds;
- out.deadLine = forcedEntTime.seconds;
- out.totalControlNum = totalControlNum;
- out.straightLineDistance = maxRange;
- out.image = image.toModel();
- out.mapScale = mapScaleNumber;
- out.contourIntervalM = contourInterval;
- out.routes = routes
- .map((m) => MapRoute()
- ..id = m.id
- ..name = m.name
- ..image = m.image.toModel())
- .toList();
- return out;
- }
- }
|