23 lines
608 B
Dart
23 lines
608 B
Dart
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
import 'package:hiddify/core/prefs/prefs.dart';
|
|
import 'package:hiddify/domain/failures.dart';
|
|
|
|
part 'update_failure.freezed.dart';
|
|
|
|
@freezed
|
|
sealed class UpdateFailure with _$UpdateFailure, Failure {
|
|
const UpdateFailure._();
|
|
|
|
const factory UpdateFailure.unexpected([
|
|
Object? error,
|
|
StackTrace? stackTrace,
|
|
]) = UpdateUnexpectedFailure;
|
|
|
|
@override
|
|
({String type, String? message}) present(TranslationsEn t) {
|
|
return switch (this) {
|
|
UpdateUnexpectedFailure() => (type: t.failure.unexpected, message: null),
|
|
};
|
|
}
|
|
}
|