Add proxy tag sanitization
This commit is contained in:
@@ -1 +1 @@
|
|||||||
core.version=0.4.1
|
core.version=0.5.0
|
||||||
@@ -21,6 +21,8 @@ class OutboundGroup with _$OutboundGroup {
|
|||||||
|
|
||||||
@freezed
|
@freezed
|
||||||
class OutboundGroupItem with _$OutboundGroupItem {
|
class OutboundGroupItem with _$OutboundGroupItem {
|
||||||
|
const OutboundGroupItem._();
|
||||||
|
|
||||||
@JsonSerializable(fieldRename: FieldRename.kebab)
|
@JsonSerializable(fieldRename: FieldRename.kebab)
|
||||||
const factory OutboundGroupItem({
|
const factory OutboundGroupItem({
|
||||||
required String tag,
|
required String tag,
|
||||||
@@ -28,6 +30,9 @@ class OutboundGroupItem with _$OutboundGroupItem {
|
|||||||
required int urlTestDelay,
|
required int urlTestDelay,
|
||||||
}) = _OutboundGroupItem;
|
}) = _OutboundGroupItem;
|
||||||
|
|
||||||
|
String get sanitizedTag =>
|
||||||
|
tag.replaceFirst(RegExp(r"\§[^]*"), "").trimRight();
|
||||||
|
|
||||||
factory OutboundGroupItem.fromJson(Map<String, dynamic> json) =>
|
factory OutboundGroupItem.fromJson(Map<String, dynamic> json) =>
|
||||||
_$OutboundGroupItemFromJson(json);
|
_$OutboundGroupItemFromJson(json);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class ProxyTile extends HookConsumerWidget {
|
|||||||
return ListTile(
|
return ListTile(
|
||||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
||||||
title: Text(
|
title: Text(
|
||||||
proxy.tag,
|
proxy.sanitizedTag,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
leading: Padding(
|
leading: Padding(
|
||||||
|
|||||||
Reference in New Issue
Block a user