selfprivacy.org.app/lib/logic/common_enum/common_enum.dart

142 lines
3.7 KiB
Dart
Raw Normal View History

2021-08-18 10:44:46 +00:00
import 'package:easy_localization/easy_localization.dart';
2022-05-30 13:49:42 +00:00
import 'package:flutter/material.dart';
2021-08-18 10:44:46 +00:00
import 'package:selfprivacy/ui/components/brand_icons/brand_icons.dart';
enum LoadingStatus {
uninitialized,
refreshing,
success,
error,
}
2021-01-08 12:37:28 +00:00
enum InitializingSteps {
2022-02-16 07:28:29 +00:00
setHetznerKey,
2021-01-08 12:37:28 +00:00
setCloudFlareKey,
setDomainName,
setRootUser,
createServer,
checkCloudFlareDns,
startServer,
checkSystemDnsAndDkimSet,
}
2022-05-16 20:30:14 +00:00
2021-04-10 03:04:23 +00:00
enum Period { hour, day, month }
2021-08-18 10:44:46 +00:00
enum ServiceTypes {
mail,
messenger,
passwordManager,
video,
cloud,
socialNetwork,
git,
2021-08-29 13:54:28 +00:00
vpn,
2021-08-18 10:44:46 +00:00
}
extension ServiceTypesExt on ServiceTypes {
String get title {
switch (this) {
case ServiceTypes.mail:
return 'services.mail.title'.tr();
case ServiceTypes.messenger:
return 'services.messenger.title'.tr();
case ServiceTypes.passwordManager:
return 'services.password_manager.title'.tr();
case ServiceTypes.video:
return 'services.video.title'.tr();
case ServiceTypes.cloud:
return 'services.cloud.title'.tr();
case ServiceTypes.socialNetwork:
return 'services.social_network.title'.tr();
case ServiceTypes.git:
return 'services.git.title'.tr();
2021-08-29 13:54:28 +00:00
case ServiceTypes.vpn:
return 'services.vpn.title'.tr();
2021-08-18 10:44:46 +00:00
}
}
String get subtitle {
switch (this) {
case ServiceTypes.mail:
return 'services.mail.subtitle'.tr();
case ServiceTypes.messenger:
return 'services.messenger.subtitle'.tr();
case ServiceTypes.passwordManager:
return 'services.password_manager.subtitle'.tr();
case ServiceTypes.video:
return 'services.video.subtitle'.tr();
case ServiceTypes.cloud:
return 'services.cloud.subtitle'.tr();
case ServiceTypes.socialNetwork:
return 'services.social_network.subtitle'.tr();
case ServiceTypes.git:
return 'services.git.subtitle'.tr();
2021-08-29 13:54:28 +00:00
case ServiceTypes.vpn:
return 'services.vpn.subtitle'.tr();
2021-08-18 10:44:46 +00:00
}
}
2021-12-23 13:52:12 +00:00
String get loginInfo {
switch (this) {
case ServiceTypes.mail:
return 'services.mail.login_info'.tr();
case ServiceTypes.messenger:
return 'services.messenger.login_info'.tr();
case ServiceTypes.passwordManager:
return 'services.password_manager.login_info'.tr();
case ServiceTypes.video:
return 'services.video.login_info'.tr();
case ServiceTypes.cloud:
return 'services.cloud.login_info'.tr();
case ServiceTypes.socialNetwork:
return 'services.social_network.login_info'.tr();
case ServiceTypes.git:
return 'services.git.login_info'.tr();
case ServiceTypes.vpn:
return '';
}
}
String get subdomain {
switch (this) {
case ServiceTypes.passwordManager:
return 'password';
case ServiceTypes.video:
return 'meet';
case ServiceTypes.cloud:
return 'cloud';
case ServiceTypes.socialNetwork:
return 'social';
case ServiceTypes.git:
return 'git';
case ServiceTypes.vpn:
case ServiceTypes.messenger:
default:
return '';
}
}
2021-08-18 10:44:46 +00:00
IconData get icon {
switch (this) {
case ServiceTypes.mail:
return BrandIcons.envelope;
case ServiceTypes.messenger:
return BrandIcons.messanger;
case ServiceTypes.passwordManager:
return BrandIcons.key;
case ServiceTypes.video:
return BrandIcons.webcam;
case ServiceTypes.cloud:
return BrandIcons.upload;
case ServiceTypes.socialNetwork:
return BrandIcons.social;
case ServiceTypes.git:
return BrandIcons.git;
2021-08-29 13:54:28 +00:00
case ServiceTypes.vpn:
2022-05-30 13:49:42 +00:00
return Icons.vpn_lock_outlined;
2021-08-18 10:44:46 +00:00
}
}
2021-08-29 13:54:28 +00:00
2022-05-24 18:55:39 +00:00
String get txt => toString().split('.')[1];
2021-08-18 10:44:46 +00:00
}