import 'package:equatable/equatable.dart'; class DeviceRunStatisticsEntity extends Equatable { final String startTime; // 开始时间 final String endTime; // 结束时间 final double workArea; // 工作面积 final double? distance; // 工作距离(可为空) final int time; // 花费时间 const DeviceRunStatisticsEntity({ required this.startTime, required this.endTime, required this.workArea, this.distance, required this.time, }); factory DeviceRunStatisticsEntity.fromJson(Map json) { return DeviceRunStatisticsEntity( startTime: json['startTime'] as String, endTime: json['endTime'] as String, workArea: (json['workArea'] as num).toDouble(), distance: json['distance'] != null ? (json['distance'] as num).toDouble() : null, time: json['time'] as int, ); } @override List get props => [startTime, endTime, workArea, distance, time]; }