mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2024-11-10 09:07:47 +01:00
a54ca799b9
* update rules of analysis_options.yaml. and solved all problems * refactor: fix remaining problems --------- Co-authored-by: Ushie <ushiekane@gmail.com>
50 lines
1.1 KiB
Dart
50 lines
1.1 KiB
Dart
import 'package:json_annotation/json_annotation.dart';
|
|
import 'package:revanced_manager/utils/string.dart';
|
|
|
|
part 'patch.g.dart';
|
|
|
|
@JsonSerializable()
|
|
class Patch {
|
|
Patch({
|
|
required this.name,
|
|
required this.description,
|
|
required this.version,
|
|
required this.excluded,
|
|
required this.dependencies,
|
|
required this.compatiblePackages,
|
|
});
|
|
|
|
factory Patch.fromJson(Map<String, dynamic> json) => _$PatchFromJson(json);
|
|
final String name;
|
|
final String description;
|
|
final String version;
|
|
final bool excluded;
|
|
final List<String> dependencies;
|
|
final List<Package> compatiblePackages;
|
|
|
|
Map<String, dynamic> toJson() => _$PatchToJson(this);
|
|
|
|
String getSimpleName() {
|
|
return name
|
|
.replaceAll('-', ' ')
|
|
.split('-')
|
|
.join(' ')
|
|
.toTitleCase()
|
|
.replaceFirst('Microg', 'MicroG');
|
|
}
|
|
}
|
|
|
|
@JsonSerializable()
|
|
class Package {
|
|
Package({
|
|
required this.name,
|
|
required this.versions,
|
|
});
|
|
|
|
factory Package.fromJson(Map<String, dynamic> json) =>
|
|
_$PackageFromJson(json);
|
|
final String name;
|
|
final List<String> versions;
|
|
|
|
Map toJson() => _$PackageToJson(this);
|
|
}
|