import 'package:json_annotation/json_annotation.dart'; part 'WebSocketMessage.g.dart'; @JsonSerializable() class WebSocketMessage { String path; int? type; dynamic data; String? to; String? mac; WebSocketMessage({required this.path, this.type, this.data, this.to,this.mac}); static WebSocketMessage fromJson(Map json) => _$WebSocketMessageFromJson(json); Map toJson() => _$WebSocketMessageToJson(this); }