isYouTubeUrl function
Implementation
bool isYouTubeUrl(String url) {
RegExp youtubeRegex = RegExp(
r'^((?:https?:)?//)?((?:www|m)\.)?(youtube(-nocookie)?\.com|youtu.be)(/(?:[\w\-]+\?v=|embed/|live/|v/)?)([\w\-]+)(\S+)?$');
return youtubeRegex.hasMatch(url);
}