Files
umbrix/lib/singbox/model/singbox_outbound.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

37 lines
1.3 KiB
Dart

import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:umbrix/singbox/model/singbox_proxy_type.dart';
part 'singbox_outbound.freezed.dart';
part 'singbox_outbound.g.dart';
@freezed
class SingboxOutboundGroup with _$SingboxOutboundGroup {
@JsonSerializable(fieldRename: FieldRename.kebab)
const factory SingboxOutboundGroup({
required String tag,
@JsonKey(fromJson: _typeFromJson) required ProxyType type,
@JsonKey(defaultValue: '') @Default('') String selected,
@Default([]) List<SingboxOutboundGroupItem> items,
}) = _SingboxOutboundGroup;
factory SingboxOutboundGroup.fromJson(Map<String, dynamic> json) => _$SingboxOutboundGroupFromJson(json);
}
@freezed
class SingboxOutboundGroupItem with _$SingboxOutboundGroupItem {
const SingboxOutboundGroupItem._();
@JsonSerializable(fieldRename: FieldRename.kebab)
const factory SingboxOutboundGroupItem({
required String tag,
@JsonKey(fromJson: _typeFromJson) required ProxyType type,
required int urlTestDelay,
}) = _SingboxOutboundGroupItem;
factory SingboxOutboundGroupItem.fromJson(Map<String, dynamic> json) => _$SingboxOutboundGroupItemFromJson(json);
}
final Map<String, ProxyType> _keyMap = Map.fromEntries(ProxyType.values.map((e) => MapEntry(e.key, e)));
ProxyType _typeFromJson(dynamic type) => ProxyType.fromJson(type);