NavigationInfo.fromMap constructor

NavigationInfo.fromMap(
  1. dynamic infoMap
)

Implementation

factory NavigationInfo.fromMap(dynamic infoMap){
  final previousStepMap = Map<String, dynamic>.from(infoMap["previousStep"]);
  final nextStepMap = Map<String, dynamic>.from(infoMap["nextStep"]);
  final legMap = Map<String, dynamic>.from(infoMap["leg"]);
  return NavigationInfo(
      previousStep: Step.fromMap(previousStepMap),
      nextStep: Step.fromMap(nextStepMap),
      leg: Leg.fromMap(legMap),
      traveledDistance: infoMap["traveledDistance"] as double,
      remainingDistance: infoMap["remainingDistance"] as double,
      remainingTime: infoMap["remainingTime"] as double,
      remainingStepDistance: infoMap["remainingStepDistance"] as double?,
  );
}