Migrate to singbox

This commit is contained in:
problematicconsumer
2023-08-19 22:27:23 +03:30
parent 14369d0a03
commit 684acc555d
124 changed files with 3408 additions and 2047 deletions

View File

@@ -19,15 +19,61 @@ class ProxyTile extends HookConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final theme = Theme.of(context);
return ListTile(
title: Text(
proxy.name,
switch (proxy) {
ClashProxyGroup(:final name) => name.toUpperCase(),
ClashProxyItem(:final name) => name,
},
overflow: TextOverflow.ellipsis,
),
subtitle: Text(proxy.type.label),
leading: Padding(
padding: const EdgeInsets.symmetric(vertical: 8),
child: Container(
width: 6,
height: double.maxFinite,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: selected ? theme.colorScheme.primary : Colors.transparent,
),
),
),
subtitle: Text.rich(
TextSpan(
children: [
TextSpan(text: proxy.type.label),
if (proxy.udp)
WidgetSpan(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 4),
child: DecoratedBox(
decoration: BoxDecoration(
border: Border.all(
color: theme.colorScheme.tertiaryContainer,
),
borderRadius: BorderRadius.circular(6),
),
child: Text(
" UDP ",
style: TextStyle(
fontSize: theme.textTheme.labelSmall?.fontSize,
),
),
),
),
),
if (proxy case ClashProxyGroup(:final now)) ...[
TextSpan(text: " ($now)"),
],
],
),
),
trailing: delay != null ? Text(delay.toString()) : null,
selected: selected,
onTap: onSelect,
horizontalTitleGap: 4,
);
}
}