2024-09-25 15:53:40 +04:00
|
|
|
import 'package:json_annotation/json_annotation.dart';
|
|
|
|
part 'news_dto.g.dart';
|
|
|
|
@JsonSerializable(createToJson: false)
|
|
|
|
class NewsDto{
|
2024-10-06 23:20:02 +04:00
|
|
|
@JsonKey(name: 'articles')
|
2024-09-25 19:28:26 +04:00
|
|
|
final List<NewAttributesDataDto>? data;
|
2024-09-25 15:53:40 +04:00
|
|
|
const NewsDto({this.data});
|
|
|
|
factory NewsDto.fromJson(Map<String, dynamic> json) => _$NewsDtoFromJson(json);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@JsonSerializable(createToJson: false)
|
|
|
|
class NewAttributesDataDto{
|
|
|
|
final String? title;
|
2024-10-06 23:20:02 +04:00
|
|
|
final String? description;
|
|
|
|
@JsonKey(name: 'urlToImage')
|
2024-09-25 15:53:40 +04:00
|
|
|
final String? imagelink;
|
|
|
|
|
2024-10-06 23:20:02 +04:00
|
|
|
const NewAttributesDataDto({this.title, this.description, this.imagelink });
|
2024-09-25 15:53:40 +04:00
|
|
|
factory NewAttributesDataDto.fromJson(Map<String, dynamic> json) => _$NewAttributesDataDtoFromJson(json);
|
|
|
|
}
|