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