isValidUrl property
bool
get
isValidUrl
check validity of the url
Implementation
bool get isValidUrl {
if (hasPhoto) {
final uri = Uri.tryParse(author.photoUrl!);
bool result = uri != null &&
(uri.scheme == 'http' || uri.scheme == 'https') &&
uri.host.isNotEmpty;
return result;
} else {
return false;
}
}