feat: Add patch options (#1354)

This commit is contained in:
aAbed
2023-10-12 00:00:39 +00:00
committed by GitHub
parent 2abadc73e4
commit ac636670c3
31 changed files with 1889 additions and 397 deletions

View File

@ -9,6 +9,7 @@ class Patch {
required this.description,
required this.excluded,
required this.compatiblePackages,
required this.options,
});
factory Patch.fromJson(Map<String, dynamic> json) => _$PatchFromJson(json);
@ -16,6 +17,7 @@ class Patch {
final String? description;
final bool excluded;
final List<Package> compatiblePackages;
final List<Option> options;
Map<String, dynamic> toJson() => _$PatchToJson(this);
@ -33,8 +35,32 @@ class Package {
factory Package.fromJson(Map<String, dynamic> json) =>
_$PackageFromJson(json);
final String name;
final List<String> versions;
Map toJson() => _$PackageToJson(this);
}
@JsonSerializable()
class Option {
Option({
required this.key,
required this.title,
required this.description,
required this.value,
required this.required,
required this.optionClassType,
});
factory Option.fromJson(Map<String, dynamic> json) => _$OptionFromJson(json);
final String key;
final String title;
final String description;
dynamic value;
final bool required;
final String optionClassType;
Map toJson() => _$OptionToJson(this);
}