Improve ping indicator
This commit is contained in:
@@ -16,7 +16,8 @@
|
||||
"agree": "Agree",
|
||||
"decline": "Decline",
|
||||
"unknown": "Unknown",
|
||||
"hidden": "Hidden"
|
||||
"hidden": "Hidden",
|
||||
"timeout": "timeout"
|
||||
},
|
||||
"intro": {
|
||||
"termsAndPolicyCaution(rich)": "by continuing you agree with ${tap(@:about.termsAndConditions)}",
|
||||
@@ -132,6 +133,7 @@
|
||||
"activeProxySemanticLabel": "Active proxy",
|
||||
"delaySemantics": {
|
||||
"result": "delay: ${delay}ms",
|
||||
"timeout": "delay test timeout",
|
||||
"testing": "delay: testing..."
|
||||
},
|
||||
"ipInfoSemantics": {
|
||||
|
||||
@@ -11,6 +11,7 @@ extension AppLocaleX on AppLocale {
|
||||
"ru" => "Русский",
|
||||
"zh" || "zh_CN" => "中文",
|
||||
"tr" => "Türkçe",
|
||||
"es" => "Spanish",
|
||||
_ => "Unknown",
|
||||
};
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ class ActiveProxyDelayIndicator extends HookConsumerWidget {
|
||||
switch (activeProxy) {
|
||||
case AsyncData(value: final proxy):
|
||||
final delay = proxy.urlTestDelay;
|
||||
final timeout = delay > 65000;
|
||||
return Center(
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
@@ -41,16 +42,27 @@ class ActiveProxyDelayIndicator extends HookConsumerWidget {
|
||||
const Gap(8),
|
||||
if (delay > 0)
|
||||
Text.rich(
|
||||
semanticsLabel:
|
||||
t.proxies.delaySemantics.result(delay: delay),
|
||||
semanticsLabel: timeout
|
||||
? t.proxies.delaySemantics.timeout
|
||||
: t.proxies.delaySemantics.result(delay: delay),
|
||||
TextSpan(
|
||||
children: [
|
||||
TextSpan(
|
||||
text: delay > 65000 ? "×" : delay.toString(),
|
||||
style: theme.textTheme.titleMedium
|
||||
?.copyWith(fontWeight: FontWeight.bold),
|
||||
),
|
||||
const TextSpan(text: " ms"),
|
||||
if (timeout)
|
||||
TextSpan(
|
||||
text: t.general.timeout,
|
||||
style: theme.textTheme.titleMedium?.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: theme.colorScheme.error,
|
||||
),
|
||||
)
|
||||
else ...[
|
||||
TextSpan(
|
||||
text: delay.toString(),
|
||||
style: theme.textTheme.titleMedium
|
||||
?.copyWith(fontWeight: FontWeight.bold),
|
||||
),
|
||||
const TextSpan(text: " ms"),
|
||||
],
|
||||
],
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user