Solian/lib/models/packet.dart

24 lines
467 B
Dart
Raw Normal View History

class NetworkPackage {
String method;
String? message;
Map<String, dynamic>? payload;
NetworkPackage({
required this.method,
this.message,
this.payload,
});
factory NetworkPackage.fromJson(Map<String, dynamic> json) => NetworkPackage(
2024-05-01 16:49:38 +00:00
method: json['w'],
message: json['m'],
payload: json['p'],
2024-05-01 09:37:34 +00:00
);
Map<String, dynamic> toJson() => {
2024-05-01 16:49:38 +00:00
'w': method,
'm': message,
'p': payload,
2024-05-01 09:37:34 +00:00
};
}