olshab
a676d454ca
changed Cupertino search bar to Material UI 3 changed baseline color and card colors implemented fetching crypto data from public API (untested)
32 lines
681 B
Dart
32 lines
681 B
Dart
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);
|
|
}
|