Step.fromMap constructor

Step.fromMap(
  1. dynamic stepMap
)

Implementation

factory Step.fromMap(dynamic stepMap) {
  return Step(
    name: stepMap["name"] as String?,
    number: stepMap["number"] as int,
    distance: stepMap["distance"] as double,
    duration: stepMap["duration"] as double,
    isLastStep: stepMap["isLastStep"] as bool,
    levelChange: stepMap["levelChange"] != null
        ? LevelChange.fromMap(
            Map<String, dynamic>.from(stepMap["levelChange"]))
        : null,
    navInstructions: NavigationInstructions.fromMap(
        Map<String, dynamic>.from(stepMap["navInstructions"])),
  );
}