18 lines
479 B
Dart
18 lines
479 B
Dart
|
import 'package:json_annotation/json_annotation.dart';
|
||
|
|
||
|
// dart run build_runner build --delete-conflicting-outputs
|
||
|
|
||
|
part 'characters_dto.g.dart';
|
||
|
|
||
|
@JsonSerializable(createToJson: false)
|
||
|
class CharacterDataDto {
|
||
|
final String? title;
|
||
|
final double? price;
|
||
|
@JsonKey(name: "image")
|
||
|
final String? imageUrl;
|
||
|
|
||
|
const CharacterDataDto(this.title, this.price, this.imageUrl);
|
||
|
|
||
|
factory CharacterDataDto.fromJson(Map<String, dynamic> json) => _$CharacterDataDtoFromJson(json);
|
||
|
}
|