selfprivacy.org.app/lib/logic/models/jobs/job.dart

46 lines
1 KiB
Dart
Raw Normal View History

2021-05-25 21:53:54 +00:00
import 'package:equatable/equatable.dart';
2021-06-08 18:52:44 +00:00
import 'package:flutter/material.dart';
2021-08-18 10:44:46 +00:00
import 'package:selfprivacy/logic/common_enum/common_enum.dart';
2021-08-18 09:36:40 +00:00
import 'package:selfprivacy/utils/password_generator.dart';
2021-08-18 10:44:46 +00:00
import 'package:easy_localization/easy_localization.dart';
2021-05-25 21:53:54 +00:00
2021-06-08 18:52:44 +00:00
import '../user.dart';
@immutable
2021-05-25 21:53:54 +00:00
class Job extends Equatable {
Job({
String? id,
required this.title,
2021-08-18 09:36:40 +00:00
}) : id = id ?? StringGenerators.simpleId();
2021-05-25 21:53:54 +00:00
final String title;
final String id;
@override
List<Object> get props => [id, title];
}
2021-06-08 18:52:44 +00:00
class CreateUserJob extends Job {
CreateUserJob({
required this.user,
2021-08-18 10:44:46 +00:00
}) : super(title: '${"jobs.createUser".tr()} ${user.login}');
2021-06-08 18:52:44 +00:00
final User user;
@override
List<Object> get props => [id, title];
}
2021-08-18 10:44:46 +00:00
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];
}