TF-265 Remove prefix https:// in url login form

This commit is contained in:
dab246
2022-03-07 11:24:09 +07:00
committed by Dat H. Pham
parent 46b8f74298
commit 025bc53790
3 changed files with 30 additions and 1 deletions
@@ -13,4 +13,16 @@ extension URLExtension on String {
return '$prefixUrlHttps${this}';
}
}
String removePrefix() {
if (startsWith(prefixUrlHttps)) {
return replaceAll(prefixUrlHttps, '');
} else if (startsWith(prefixUrlHttp)) {
return replaceAll(prefixUrlHttp, '');
} else {
return this;
}
}
bool isValid() => startsWith(prefixUrlHttps) || startsWith(prefixUrlHttp);
}