40 lines
766 B
Dart
40 lines
766 B
Dart
import 'package:json_annotation/json_annotation.dart';
|
|
|
|
part 'udp_package.g.dart';
|
|
|
|
@JsonSerializable()
|
|
class UdpPackage {
|
|
final String id;
|
|
final String name;
|
|
final String data;
|
|
final String ipAddress;
|
|
|
|
UdpPackage({
|
|
required this.id,
|
|
required this.name,
|
|
required this.data,
|
|
required this.ipAddress,
|
|
});
|
|
|
|
factory UdpPackage.fromJson(Map<String, dynamic> json) =>
|
|
_$UdpPackageFromJson(json);
|
|
|
|
Map<String, dynamic> toJson() => _$UdpPackageToJson(this);
|
|
|
|
UdpPackage copyWith({
|
|
String? id,
|
|
String? name,
|
|
String? data,
|
|
String? ipAddress,
|
|
}) {
|
|
return UdpPackage(
|
|
id: id ?? this.id,
|
|
name: name ?? this.name,
|
|
data: data ?? this.data,
|
|
ipAddress: ipAddress ?? this.ipAddress,
|
|
);
|
|
}
|
|
}
|
|
|
|
|