Add app source and tests

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
alvocool
2026-10-11 10:15:30 +03:00
parent 7e246255c2
commit 38881d1fe1
135 changed files with 21057 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
// Form validators. Screens reference these rather than writing closures
// inline, so an error message reads the same wherever the rule applies.
String? requiredField(String? value) =>
(value == null || value.trim().isEmpty) ? 'Required' : null;
String? validPort(String? value) {
if (value == null || value.trim().isEmpty) return null; // falls back to 22
final port = int.tryParse(value.trim());
if (port == null) return 'Numbers only';
if (port < 1 || port > 65535) return 'Must be 1–65535';
return null;
}
String? validHost(String? value) {
if (value == null || value.trim().isEmpty) return 'Required';
if (value.trim().contains(' ')) return 'No spaces allowed';
return null;
}
/// An absolute POSIX path, as every remote target must be.
String? validRemotePath(String? value) {
if (value == null || value.trim().isEmpty) return 'Required';
if (!value.trim().startsWith('/')) return 'Must start with /';
return null;
}