toJson method

Map<String, dynamic> toJson()

Converts the Position instance into a Map instance that can be serialized to JSON.

Implementation

Map<String, dynamic> toJson() => {
      'longitude': longitude,
      'latitude': latitude,
      'timestamp': timestamp?.millisecondsSinceEpoch,
      'mocked': mocked,
      'accuracy': accuracy,
      'altitude': altitude,
      'heading': heading,
      'speed': speed,
      'speedAccuracy': speedAccuracy,
    };