initial upload
This commit is contained in:
39
lib/models/udp_package.dart
Normal file
39
lib/models/udp_package.dart
Normal file
@ -0,0 +1,39 @@
|
||||
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,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user