mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-10 12:44:31 +00:00
22 lines
629 B
Dart
22 lines
629 B
Dart
import 'package:stackwallet/dto/ordinals/ordinals_response.dart';
|
|
|
|
class PreviewResponse extends OrdinalsResponse<PreviewResponse> {
|
|
final ImageLink imageLink;
|
|
|
|
PreviewResponse({required this.imageLink});
|
|
|
|
factory PreviewResponse.fromJson(OrdinalsResponse json) {
|
|
final data = json.data as Map<String, dynamic>;
|
|
return PreviewResponse(imageLink: ImageLink.fromJson(data['_links']['image'] as Map<String, dynamic>));
|
|
}
|
|
}
|
|
|
|
class ImageLink {
|
|
final String href;
|
|
|
|
ImageLink({required this.href});
|
|
|
|
factory ImageLink.fromJson(Map<String, dynamic> json) {
|
|
return ImageLink(href: json['href'] as String);
|
|
}
|
|
}
|