Files
umbrix/lib/features/proxy/model/proxy_failure.dart
Umbrix Developer 76a374950f feat: mobile-like window size and always-visible stats
- Changed window size to mobile phone format (400x800)
- Removed width condition for ActiveProxyFooter - now always visible
- Added run-umbrix.sh launch script with icon copying
- Stats cards now display on all screen sizes
2026-01-17 13:09:20 +03:00

48 lines
1.3 KiB
Dart

import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:umbrix/core/localization/translations.dart';
import 'package:umbrix/core/model/failures.dart';
part 'proxy_failure.freezed.dart';
@freezed
sealed class ProxyFailure with _$ProxyFailure, Failure {
const ProxyFailure._();
@With<UnexpectedFailure>()
const factory ProxyFailure.unexpected([
Object? error,
StackTrace? stackTrace,
]) = ProxyUnexpectedFailure;
@With<ExpectedFailure>()
const factory ProxyFailure.serviceNotRunning() = ServiceNotRunning;
@With<ExpectedFailure>()
const factory ProxyFailure.unknownIp() = UnknownIp;
@With<ExpectedMeasuredFailure>()
const factory ProxyFailure.unableToRetrieveIp([
Object? error,
StackTrace? stackTrace,
]) = UnableToRetrieveIp;
@override
({String type, String? message}) present(TranslationsEn t) {
return switch (this) {
ProxyUnexpectedFailure() => (
type: t.failure.unexpected,
message: null,
),
ServiceNotRunning() => (
type: t.failure.singbox.serviceNotRunning,
message: null,
),
UnknownIp() => (type: t.general.unknown, message: null),
UnableToRetrieveIp() => (
type: t.failure.unexpected,
message: null,
),
};
}
}