Location constructor

const Location({
  1. @JsonKey(name: 'longitude') required double longitude,
  2. @JsonKey(name: 'latitude') required double latitude,
  3. @JsonKey(name: 'horizontal_accuracy') double? horizontalAccuracy,
  4. @JsonKey(name: 'live_period') int? livePeriod,
  5. @JsonKey(name: 'heading') int? heading,
  6. @JsonKey(name: 'proximity_alert_radius') int? proximityAlertRadius,
})

Constructs a Location object

Implementation

const factory Location({
  /// Longitude as defined by sender
  @JsonKey(name: 'longitude') required double longitude,

  /// Latitude as defined by sender
  @JsonKey(name: 'latitude') required double latitude,

  /// The radius of uncertainty for the location, measured in meters; 0-1500
  @JsonKey(name: 'horizontal_accuracy') double? horizontalAccuracy,

  /// Optional. Time relative to the message sending date, during which the
  /// location can be updated; in seconds. For active live locations only.
  @JsonKey(name: 'live_period') int? livePeriod,

  /// Optional. The direction in which user is moving, in degrees; 1-360. For
  /// active live locations only.
  @JsonKey(name: 'heading') int? heading,

  /// Optional. The maximum distance for proximity alerts about approaching
  /// another chat member, in meters. For sent live locations only.
  @JsonKey(name: 'proximity_alert_radius') int? proximityAlertRadius,
}) = _Location;