mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-27 11:16:45 +00:00
update
This commit is contained in:
parent
1202e4ad53
commit
1a8a4e7270
|
@ -212,7 +212,10 @@
|
|||
"_comment": "Jobs list",
|
||||
"title": "Jobs list",
|
||||
"start": "Start",
|
||||
"empty": "No jobs"
|
||||
"empty": "No jobs",
|
||||
"createUser": "Create",
|
||||
"serviceTurnOff": "Turn off",
|
||||
"serviceTurnOn": "Turn on"
|
||||
},
|
||||
"validations": {
|
||||
"required": "Required",
|
||||
|
|
|
@ -212,7 +212,10 @@
|
|||
"_comment": "Jobs list",
|
||||
"title": "Задачи",
|
||||
"start": "Начать выполенение",
|
||||
"empty": "Пусто"
|
||||
"empty": "Пусто",
|
||||
"createUser": "Создать запись",
|
||||
"serviceTurnOff": "Остановить",
|
||||
"serviceTurnOn": "Запустить"
|
||||
},
|
||||
"validations": {
|
||||
"required": "обязательное поле",
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_icons/brand_icons.dart';
|
||||
|
||||
enum InitializingSteps {
|
||||
setHeznerKey,
|
||||
setCloudFlareKey,
|
||||
|
@ -10,3 +14,71 @@ enum InitializingSteps {
|
|||
}
|
||||
enum Period { hour, day, month }
|
||||
|
||||
enum ServiceTypes {
|
||||
mail,
|
||||
messenger,
|
||||
passwordManager,
|
||||
video,
|
||||
cloud,
|
||||
socialNetwork,
|
||||
git,
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:selfprivacy/logic/common_enum/common_enum.dart';
|
||||
import 'package:selfprivacy/utils/password_generator.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
|
||||
import '../user.dart';
|
||||
|
||||
|
@ -21,10 +23,23 @@ class Job extends Equatable {
|
|||
class CreateUserJob extends Job {
|
||||
CreateUserJob({
|
||||
required this.user,
|
||||
}) : super(title: 'Create ${user.login}');
|
||||
}) : super(title: '${"jobs.createUser".tr()} ${user.login}');
|
||||
|
||||
final User user;
|
||||
|
||||
@override
|
||||
List<Object> get props => [id, title];
|
||||
}
|
||||
|
||||
class ServiceToggleJob extends Job {
|
||||
ServiceToggleJob({
|
||||
required this.type,
|
||||
required this.needToTurnOn,
|
||||
}) : super(title: '${needToTurnOn ? "jobs.serviceTurnOn".tr() : "jobs.serviceTurnOff".tr()} ');
|
||||
|
||||
final ServiceTypes type;
|
||||
final bool needToTurnOn;
|
||||
|
||||
@override
|
||||
List<Object> get props => [id, title];
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
|||
import 'package:selfprivacy/config/brand_colors.dart';
|
||||
import 'package:selfprivacy/config/brand_theme.dart';
|
||||
import 'package:selfprivacy/config/text_themes.dart';
|
||||
import 'package:selfprivacy/logic/common_enum/common_enum.dart';
|
||||
import 'package:selfprivacy/logic/cubit/app_config/app_config_cubit.dart';
|
||||
import 'package:selfprivacy/logic/models/state_types.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_button/brand_button.dart';
|
||||
|
@ -67,44 +68,6 @@ class _Card extends StatelessWidget {
|
|||
IconData iconData;
|
||||
String subtitle;
|
||||
|
||||
switch (serviceType) {
|
||||
case ServiceTypes.mail:
|
||||
iconData = BrandIcons.envelope;
|
||||
title = 'services.mail.title'.tr();
|
||||
subtitle = 'services.mail.subtitle'.tr();
|
||||
break;
|
||||
case ServiceTypes.messenger:
|
||||
iconData = BrandIcons.messanger;
|
||||
title = 'services.messenger.title'.tr();
|
||||
subtitle = 'services.messenger.subtitle'.tr();
|
||||
break;
|
||||
case ServiceTypes.passwordManager:
|
||||
iconData = BrandIcons.key;
|
||||
title = 'services.password_manager.title'.tr();
|
||||
subtitle = 'services.password_manager.subtitle'.tr();
|
||||
break;
|
||||
case ServiceTypes.video:
|
||||
iconData = BrandIcons.webcam;
|
||||
title = 'services.video.title'.tr();
|
||||
subtitle = 'services.video.subtitle'.tr();
|
||||
break;
|
||||
case ServiceTypes.cloud:
|
||||
iconData = BrandIcons.upload;
|
||||
title = 'services.cloud.title'.tr();
|
||||
subtitle = 'services.cloud.subtitle'.tr();
|
||||
break;
|
||||
case ServiceTypes.socialNetwork:
|
||||
iconData = BrandIcons.social;
|
||||
title = 'services.social_network.title'.tr();
|
||||
subtitle = 'services.social_network.subtitle'.tr();
|
||||
break;
|
||||
case ServiceTypes.git:
|
||||
iconData = BrandIcons.git;
|
||||
title = 'services.git.title'.tr();
|
||||
subtitle = 'services.git.subtitle'.tr();
|
||||
break;
|
||||
}
|
||||
|
||||
var isReady = context.watch<AppConfigCubit>().state.isFullyInitilized;
|
||||
var changeTab = context.read<ChangeTab>().onPress;
|
||||
return GestureDetector(
|
||||
|
@ -118,8 +81,8 @@ class _Card extends StatelessWidget {
|
|||
serviceType: serviceType,
|
||||
status:
|
||||
isReady ? StateType.stable : StateType.uninitialized,
|
||||
title: title,
|
||||
icon: iconData,
|
||||
title: serviceType.title,
|
||||
icon: serviceType.icon,
|
||||
changeTab: changeTab,
|
||||
);
|
||||
},
|
||||
|
@ -131,12 +94,12 @@ class _Card extends StatelessWidget {
|
|||
children: [
|
||||
IconStatusMask(
|
||||
status: isReady ? StateType.stable : StateType.uninitialized,
|
||||
child: Icon(iconData, size: 30, color: Colors.white),
|
||||
child: Icon(serviceType.icon, size: 30, color: Colors.white),
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
BrandText.h2(title),
|
||||
BrandText.h2(serviceType.title),
|
||||
SizedBox(height: 10),
|
||||
BrandText.body2(subtitle),
|
||||
BrandText.body2(serviceType.subtitle),
|
||||
SizedBox(height: 10),
|
||||
],
|
||||
),
|
||||
|
@ -145,16 +108,6 @@ class _Card extends StatelessWidget {
|
|||
}
|
||||
}
|
||||
|
||||
enum ServiceTypes {
|
||||
mail,
|
||||
messenger,
|
||||
passwordManager,
|
||||
video,
|
||||
cloud,
|
||||
socialNetwork,
|
||||
git,
|
||||
}
|
||||
|
||||
class _ServiceDetails extends StatelessWidget {
|
||||
const _ServiceDetails({
|
||||
Key? key,
|
||||
|
|
Loading…
Reference in a new issue