PIbd-32_Shabunov_O.A._Mobil.../lib/data/dtos/coins_dto.dart

32 lines
681 B
Dart
Raw Normal View History

import 'package:json_annotation/json_annotation.dart';
part 'coins_dto.g.dart';
@JsonSerializable(createToJson: false)
class CoinsDto {
final List<CoinDataDto>? coins;
CoinsDto({this.coins});
factory CoinsDto.fromJson(Map<String, dynamic> json) => _$CoinsDtoFromJson(json);
}
@JsonSerializable(createToJson: false)
class CoinDataDto {
final String? id;
final String? name;
final String? image;
final double? currentPrice;
final double? priceChange24h;
CoinDataDto({
this.id,
this.name,
this.image,
this.currentPrice,
this.priceChange24h,
});
factory CoinDataDto.fromJson(Map<String, dynamic> json) => _$CoinDataDtoFromJson(json);
}