Steps.fromJson constructor

Steps.fromJson(
  1. Map<String, dynamic> json
)

Implementation

Steps.fromJson(Map<String, dynamic> json) {
  distance = json['distance'];
  duration = json['duration'];
  geometry = json['geometry'];
  name = json['name'];
  mode = json['mode'];
  maneuver =
      json['maneuver'] != null ? Maneuver.fromJson(json['maneuver']) : null;
  if (json['voiceInstructions'] != null) {
    voiceInstructions = <VoiceInstructions>[];
    json['voiceInstructions'].forEach((v) {
      voiceInstructions!.add(VoiceInstructions.fromJson(v));
    });
  }
  if (json['bannerInstructions'] != null) {
    bannerInstructions = <BannerInstructions>[];
    json['bannerInstructions'].forEach((v) {
      bannerInstructions!.add(BannerInstructions.fromJson(v));
    });
  }
  drivingSide = json['driving_side'];
  weight = json['weight'];
  if (json['intersections'] != null) {
    intersections = <Intersections>[];
    json['intersections'].forEach((v) {
      intersections!.add(Intersections.fromJson(v));
    });
  }
  exits = json['exits'];
}