This commit is contained in:
problematicconsumer
2023-12-01 12:56:24 +03:30
parent 9c165e178b
commit ed614988a2
181 changed files with 3092 additions and 2341 deletions

View File

@@ -0,0 +1,17 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'installed_package_info.freezed.dart';
part 'installed_package_info.g.dart';
@freezed
class InstalledPackageInfo with _$InstalledPackageInfo {
@JsonSerializable(fieldRename: FieldRename.kebab)
const factory InstalledPackageInfo({
required String packageName,
required String name,
required bool isSystemApp,
}) = _InstalledPackageInfo;
factory InstalledPackageInfo.fromJson(Map<String, dynamic> json) =>
_$InstalledPackageInfoFromJson(json);
}

View File

@@ -0,0 +1,24 @@
import 'package:hiddify/core/localization/translations.dart';
enum PerAppProxyMode {
off,
include,
exclude;
bool get enabled => this != off;
({String title, String message}) present(TranslationsEn t) => switch (this) {
off => (
title: t.settings.network.perAppProxyModes.off,
message: t.settings.network.perAppProxyModes.offMsg,
),
include => (
title: t.settings.network.perAppProxyModes.include,
message: t.settings.network.perAppProxyModes.includeMsg,
),
exclude => (
title: t.settings.network.perAppProxyModes.exclude,
message: t.settings.network.perAppProxyModes.excludeMsg,
),
};
}