import 'package:json_annotation/json_annotation.dart'; part 'news_dto.g.dart'; @JsonSerializable(createToJson: false) class NewsDto{ final List? data; const NewsDto({this.data}); factory NewsDto.fromJson(Map json) => _$NewsDtoFromJson(json); } @JsonSerializable(createToJson: false) class NewDataDto{ final String? id; final String? type; final NewAttributesDataDto? attributes; const NewDataDto({this.id, this.type, this.attributes}); factory NewDataDto.fromJson(Map json) => _$NewDataDtoFromJson(json); } @JsonSerializable(createToJson: false) class NewAttributesDataDto{ final String? title; final String? summary; @JsonKey(name: 'image_link') final String? imagelink; const NewAttributesDataDto({this.title, this.summary, this.imagelink }); factory NewAttributesDataDto.fromJson(Map json) => _$NewAttributesDataDtoFromJson(json); }