paletteUrlLoader function

Future<EufemiaPaletteData> paletteUrlLoader (
  1. String url,
  2. {Map<String, String> headers}
)

Loads EufemiaPaletteData from the given url

Implementation

Future<EufemiaPaletteData> paletteUrlLoader(String url,
    {Map<String, String> headers}) async {
  final data = await http.get(url, headers: headers);
  if (data.body != null) {
    return EufemiaPaletteData.fromJson(jsonDecode(data.body));
  }
  throw Exception('Palette url loading failed (${data.statusCode})');
}