import 'package:stackwallet/dto/ordinals/ordinals_response.dart'; class ContentResponse extends OrdinalsResponse { final FileLink fileLink; ContentResponse({required this.fileLink}); factory ContentResponse.fromJson(OrdinalsResponse json) { final data = json.data as Map; return ContentResponse(fileLink: FileLink.fromJson(data['_links']['file'] as Map)); // TODO don't cast as Map } } class FileLink { final String href; FileLink({required this.href}); factory FileLink.fromJson(Map json) { return FileLink(href: json['href'] as String); } }