simplified code across the app and consolidated duplicated helpers

This commit is contained in:
2026-09-27 17:29:54 +02:00
parent 3e856d0b1c
commit ee1240f71a
155 changed files with 1772 additions and 2546 deletions
+4 -8
View File
@@ -88,14 +88,10 @@ class DevToolsSettings {
if (trimmed.isEmpty) return null;
final uri = Uri.tryParse(trimmed);
if (uri == null || !uri.hasScheme) return null;
if (uri.scheme == 'https') {
// always fine
} else if (uri.scheme == 'http' && allowsHttpCustomEndpoint) {
// dev only
} else {
return null;
}
if (uri.host.isEmpty) return null;
final schemeAllowed =
uri.scheme == 'https' ||
(uri.scheme == 'http' && allowsHttpCustomEndpoint);
if (!schemeAllowed || uri.host.isEmpty) return null;
return trimmed.endsWith('/')
? trimmed.substring(0, trimmed.length - 1)
: trimmed;