You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
aku_new_community/lib/models/news/news_item_model.dart

27 lines
634 B

import 'package:common_utils/common_utils.dart';
import 'package:json_annotation/json_annotation.dart';
3 years ago
import 'package:aku_new_community/model/common/img_model.dart';
part 'news_item_model.g.dart';
@JsonSerializable()
class NewsItemModel {
final int id;
final String title;
final String createDate;
final List<ImgModel> imgList;
3 years ago
DateTime? get create => DateUtil.getDateTime(createDate);
3 years ago
NewsItemModel({
required this.id,
required this.title,
required this.createDate,
required this.imgList,
});
factory NewsItemModel.fromJson(Map<String, dynamic> json) =>
_$NewsItemModelFromJson(json);
}