import 'package:json_annotation/json_annotation.dart'; import 'udp_package.dart'; part 'project.g.dart'; @JsonSerializable() class Project { final String id; final String name; final String ipAddress; final int port; final List packages; Project({ required this.id, required this.name, required this.ipAddress, required this.port, required this.packages, }); factory Project.fromJson(Map json) => _$ProjectFromJson(json); Map toJson() => _$ProjectToJson(this); Project copyWith({ String? id, String? name, String? ipAddress, int? port, List? packages, }) { return Project( id: id ?? this.id, name: name ?? this.name, ipAddress: ipAddress ?? this.ipAddress, port: port ?? this.port, packages: packages ?? this.packages, ); } }