62 lines
1.4 KiB
Dart
Raw Normal View History

2024-10-01 15:01:01 +04:00
import 'package:json_annotation/json_annotation.dart';
part 'spells_dto.g.dart';
@JsonSerializable(createToJson: false)
2024-10-01 18:21:37 +04:00
class SpellDto {
2024-10-01 15:01:01 +04:00
final List<SpellDataDto>? data;
2024-10-01 18:21:37 +04:00
const SpellDto({
this.data,
});
2024-10-01 15:01:01 +04:00
2024-10-01 18:21:37 +04:00
factory SpellDto.fromJson(Map<String, dynamic> json) =>
_$SpellDtoFromJson(json);
2024-10-01 15:01:01 +04:00
}
@JsonSerializable(createToJson: false)
2024-10-01 18:21:37 +04:00
class SpellDataDto {
2024-10-01 15:01:01 +04:00
final String? id;
2024-10-01 18:21:37 +04:00
final String? type;
final SpellAttributesDataDto? attributes;
2024-10-01 15:01:01 +04:00
2024-10-01 18:21:37 +04:00
const SpellDataDto({
this.id,
this.type,
this.attributes,
});
2024-10-01 15:01:01 +04:00
2024-10-01 18:21:37 +04:00
factory SpellDataDto.fromJson(Map<String, dynamic> json) =>
_$SpellDataDtoFromJson(json);
2024-10-01 15:01:01 +04:00
}
@JsonSerializable(createToJson: false)
2024-10-01 18:21:37 +04:00
class SpellAttributesDataDto {
final String? slug; // хз
final String? category; // категория
final String? creator; // создатель
final String? effect; // воздействие
final String? hand; // взмах
final String? image; // картинка
final String? incantation; // произношение
final String? light; // цвет
final String? name; // название
final String? wiki; // ссылка на вики
const SpellAttributesDataDto({
this.slug,
this.category,
this.creator,
this.effect,
this.hand,
this.image,
this.incantation,
this.light,
this.name,
this.wiki,
});
factory SpellAttributesDataDto.fromJson(Map<String, dynamic> json) =>
_$SpellAttributesDataDtoFromJson(json);
}