validateNetworkInput method
Validates input for saveNetwork.
Implementation
@protected
void validateNetworkInput(String url, String fileName) {
if (url.isEmpty) {
throw const InvalidInputException('URL cannot be empty');
}
final uri = Uri.tryParse(url);
if (uri == null ||
!uri.hasScheme ||
(!uri.isScheme('http') && !uri.isScheme('https'))) {
throw const InvalidInputException('URL must use http or https scheme');
}
if (fileName.isEmpty) {
throw const InvalidInputException('File name cannot be empty');
}
}