DrivingBehaviourAnalysisResult.fromMap constructor
DrivingBehaviourAnalysisResult.fromMap(- Map map
)
Implementation
DrivingBehaviourAnalysisResult.fromMap(Map map)
: assert(map != null),
super.fromMap(map) {
distance = map['distance'];
duration = map['duration'];
averageSpeed = map['averageSpeed'];
maxSpeed = map['maxSpeed'];
speedingNum = map['speedingNum'];
harshAccelerationNum = map['harshAccelerationNum'];
harshBreakingNum = map['harshBreakingNum'];
harshSteeringNum = map['harshSteeringNum'];
startPoint = map['startPoint'] != null
? StartPoint.fromMap(map['startPoint'])
: null;
endPoint =
map['endPoint'] != null ? EndPoint.fromMap(map['endPoint']) : null;
if (map['speedings'] != null) {
speedings = <SpeedingInfo>[];
map['speedings'].forEach((e) {
speedings.add(SpeedingInfo.fromMap(e as Map));
});
}
if (map['harshAccelerationPoints'] != null) {
harshAccelerationPoints = <HarshAccelerationPoint>[];
map['harshAccelerationPoints'].forEach((e) {
harshAccelerationPoints.add(HarshAccelerationPoint.fromMap(e as Map));
});
}
if (map['harshBreakingPoints'] != null) {
harshBreakingPoints = <HarshBreakingPoint>[];
map['harshBreakingPoints'].forEach((e) {
harshBreakingPoints.add(HarshBreakingPoint.fromMap(e as Map));
});
}
if (map['harshSteeringPoints'] != null) {
harshSteeringPoints = <HarshSteeringPoint>[];
map['harshBreakingPoints'].forEach((e) {
harshSteeringPoints.add(HarshSteeringPoint.fromMap(e as Map));
});
}
}