PIbd-32_Shabunov_O.A._Mobil.../lib/data/dtos/coins_dto.dart
olshab 04120c4847 fixed localizations issues
changed application name
updated svg icons
2024-12-16 22:59:15 +04:00

35 lines
781 B
Dart

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