parent
c278340717
commit
6550a40a4a
@ -0,0 +1,37 @@
|
||||
import 'package:aku_new_community/model/common/img_model.dart';
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'information_detail_model.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class InformationDetailModel extends Equatable {
|
||||
final int id;
|
||||
final String title;
|
||||
final String content;
|
||||
final int viewsNum;
|
||||
final String createDate;
|
||||
final List<ImgModel> imgList;
|
||||
|
||||
factory InformationDetailModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$InformationDetailModelFromJson(json);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
id,
|
||||
title,
|
||||
content,
|
||||
viewsNum,
|
||||
createDate,
|
||||
imgList,
|
||||
];
|
||||
|
||||
const InformationDetailModel({
|
||||
required this.id,
|
||||
required this.title,
|
||||
required this.content,
|
||||
required this.viewsNum,
|
||||
required this.createDate,
|
||||
required this.imgList,
|
||||
});
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'information_detail_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
InformationDetailModel _$InformationDetailModelFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
InformationDetailModel(
|
||||
id: json['id'] as int,
|
||||
title: json['title'] as String,
|
||||
content: json['content'] as String,
|
||||
viewsNum: json['viewsNum'] as int,
|
||||
createDate: json['createDate'] as String,
|
||||
imgList: (json['imgList'] as List<dynamic>)
|
||||
.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
Loading…
Reference in new issue