import 'package:json_annotation/json_annotation.dart';

part 'message_data.g.dart';

@JsonSerializable()
class MessageData {
  @JsonKey(name: "lat")
  final double? latitude;

  @JsonKey(name: "lng")
  final double? longitude;

  @JsonKey(name: "speed")
  final double? speed;

  @JsonKey(name: "bearing")
  final double? bearing;

  @JsonKey(name: "addr")
  final String? address;

  @JsonKey(name: "network")
  final String? network;

  MessageData({this.latitude,
    this.longitude,
    this.speed,
    this.bearing,
    this.address,
    this.network});

  factory MessageData.fromJson(Map<String, dynamic> json) =>
      _$MessageDataFromJson(json);

  Map<String, dynamic> toJson() => _$MessageDataToJson(this);
}
