getData static method
Get data from a youtube link
Implementation
static Future<SpotifyMetadata> getData(String link) async {
final Uri uri = Uri.parse("https://open.spotify.com/oembed?url=$link");
http.Response result;
try {
result = await http.get(uri);
} catch (e) {
throw 'Incorrect link';
}
return SpotifyMetadata.fromMap(json.decode(result.body));
}