initial
This commit is contained in:
28
lib/domain/profiles/profiles_failure.dart
Normal file
28
lib/domain/profiles/profiles_failure.dart
Normal file
@@ -0,0 +1,28 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
import 'package:hiddify/core/locale/locale.dart';
|
||||
import 'package:hiddify/domain/failures.dart';
|
||||
|
||||
part 'profiles_failure.freezed.dart';
|
||||
|
||||
@freezed
|
||||
sealed class ProfileFailure with _$ProfileFailure, Failure {
|
||||
const ProfileFailure._();
|
||||
|
||||
const factory ProfileFailure.unexpected([
|
||||
Object? error,
|
||||
StackTrace? stackTrace,
|
||||
]) = ProfileUnexpectedFailure;
|
||||
|
||||
const factory ProfileFailure.notFound() = ProfileNotFoundFailure;
|
||||
|
||||
const factory ProfileFailure.invalidConfig() = ProfileInvalidConfigFailure;
|
||||
|
||||
@override
|
||||
String present(TranslationsEn t) {
|
||||
return switch (this) {
|
||||
ProfileUnexpectedFailure() => t.failure.profiles.unexpected,
|
||||
ProfileNotFoundFailure() => t.failure.profiles.notFound,
|
||||
ProfileInvalidConfigFailure() => t.failure.profiles.invalidConfig,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user