toJson method

Map<String, dynamic> toJson()

Converts the TimeDistanceMatrix to a Map having String keys 'durations', 'destinations', and 'sources'.

Implementation

Map<String, dynamic> toJson() => <String, dynamic>{
      'durations': durations,
      'destinations': destinations
          .map<Map<String, dynamic>>(
              (TimeDistanceMatrixLocation e) => e.toJson())
          .toList(),
      'sources': sources
          .map<Map<String, dynamic>>(
              (TimeDistanceMatrixLocation e) => e.toJson())
          .toList(),
    };