Added path field
This commit is contained in:
@@ -53,8 +53,8 @@ class Connect extends _$Connect {
|
||||
ref.notifyListeners();
|
||||
}
|
||||
|
||||
void validatePort(value) {
|
||||
if (value != null && value != '') {
|
||||
void validatePort(String value) {
|
||||
if (value != '') {
|
||||
if (int.tryParse(value) != null && int.parse(value) <= 65535) {
|
||||
state.portError = null;
|
||||
} else {
|
||||
@@ -65,6 +65,20 @@ class Connect extends _$Connect {
|
||||
ref.notifyListeners();
|
||||
}
|
||||
|
||||
void validatePath(String value) {
|
||||
if (value == "") {
|
||||
state.pathError = null;
|
||||
} else {
|
||||
if (Regexps.path.hasMatch(value) == true) {
|
||||
state.pathError = null;
|
||||
} else {
|
||||
state.pathError = t.onboarding.invalidPath;
|
||||
}
|
||||
}
|
||||
state.validValues = validValues();
|
||||
ref.notifyListeners();
|
||||
}
|
||||
|
||||
void validateToken(String value) {
|
||||
if (value != "") {
|
||||
state.tokenError = null;
|
||||
@@ -79,7 +93,9 @@ class Connect extends _$Connect {
|
||||
return state.tokenController.text != "" &&
|
||||
state.tokenError == null &&
|
||||
state.ipDomainController.text != "" &&
|
||||
state.ipDomainError == null;
|
||||
state.ipDomainError == null &&
|
||||
state.pathError == null &&
|
||||
state.portError == null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ final connectToServerProvider = AutoDisposeFutureProvider<bool>.internal(
|
||||
);
|
||||
|
||||
typedef ConnectToServerRef = AutoDisposeFutureProviderRef<bool>;
|
||||
String _$connectHash() => r'946ac6cce15a0ac9b3a7f8c1b606b3782e64f5e7';
|
||||
String _$connectHash() => r'576283d8c543cdb4b1ae22c99cc63a23e4ff2981';
|
||||
|
||||
/// See also [Connect].
|
||||
@ProviderFor(Connect)
|
||||
|
||||
Reference in New Issue
Block a user