41 lines
776 B
Dart
41 lines
776 B
Dart
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 int port;
|
|
final List<UdpPackage> packages;
|
|
|
|
Project({
|
|
required this.id,
|
|
required this.name,
|
|
required this.port,
|
|
required this.packages,
|
|
});
|
|
|
|
factory Project.fromJson(Map<String, dynamic> json) =>
|
|
_$ProjectFromJson(json);
|
|
|
|
Map<String, dynamic> toJson() => _$ProjectToJson(this);
|
|
|
|
Project copyWith({
|
|
String? id,
|
|
String? name,
|
|
int? port,
|
|
List<UdpPackage>? packages,
|
|
}) {
|
|
return Project(
|
|
id: id ?? this.id,
|
|
name: name ?? this.name,
|
|
port: port ?? this.port,
|
|
packages: packages ?? this.packages,
|
|
);
|
|
}
|
|
}
|
|
|
|
|