Created with <3 with dartpad.dev.
Created
November 9, 2023 04:39
-
-
Save matifdeveloper/c2ff86c43b207ea0687cffde7414fa01 to your computer and use it in GitHub Desktop.
Check the String is URL or not
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
print(isURL('https://dartpad.dev/?')); | |
} | |
bool isURL(String value) { | |
final uri = Uri.parse(value); | |
if (uri.scheme == 'http' || uri.scheme == 'https') { | |
return true; | |
} else { | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment