Solian/lib/models/packet.dart

24 lines
467 B
Dart
Raw Normal View History

2024-05-18 10:17:16 +00:00
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(
method: json['w'],
message: json['m'],
payload: json['p'],
);
Map<String, dynamic> toJson() => {
'w': method,
'm': message,
'p': payload,
};
}