parent
9610a1c949
commit
171e3f6596
@ -1,138 +1,139 @@
|
||||
class LifePayModel {
|
||||
int? years;
|
||||
int? paymentNum;
|
||||
List<DailyPaymentTypeVos>? dailyPaymentTypeVos;
|
||||
|
||||
LifePayModel({this.years, this.paymentNum, this.dailyPaymentTypeVos});
|
||||
|
||||
LifePayModel.fromJson(Map<String, dynamic> json) {
|
||||
years = json['years'];
|
||||
paymentNum = json['paymentNum'];
|
||||
if (json['dailyPaymentTypeVos'] != null) {
|
||||
dailyPaymentTypeVos = [];
|
||||
json['dailyPaymentTypeVos'].forEach((v) {
|
||||
dailyPaymentTypeVos!.add(new DailyPaymentTypeVos.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['years'] = this.years;
|
||||
data['paymentNum'] = this.paymentNum;
|
||||
if (this.dailyPaymentTypeVos != null) {
|
||||
data['dailyPaymentTypeVos'] =
|
||||
this.dailyPaymentTypeVos!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class DailyPaymentTypeVos {
|
||||
int? id;
|
||||
String? name;
|
||||
List<DetailedVoList>? detailedVoList;
|
||||
|
||||
DailyPaymentTypeVos({this.id, this.name, this.detailedVoList});
|
||||
|
||||
DailyPaymentTypeVos.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['name'];
|
||||
if (json['detailedVoList'] != null) {
|
||||
detailedVoList = [];
|
||||
json['detailedVoList'].forEach((v) {
|
||||
detailedVoList!.add(new DetailedVoList.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['name'] = this.name;
|
||||
if (this.detailedVoList != null) {
|
||||
data['detailedVoList'] =
|
||||
this.detailedVoList!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class DetailedVoList {
|
||||
int? groupId;
|
||||
double? paymentPrice;
|
||||
List<DetailsVoList>? detailsVoList;
|
||||
|
||||
DetailedVoList({this.groupId, this.paymentPrice, this.detailsVoList});
|
||||
|
||||
DetailedVoList.fromJson(Map<String, dynamic> json) {
|
||||
groupId = json['groupId'];
|
||||
paymentPrice = json['paymentPrice'];
|
||||
if (json['detailsVoList'] != null) {
|
||||
detailsVoList = [];
|
||||
json['detailsVoList'].forEach((v) {
|
||||
detailsVoList!.add(new DetailsVoList.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['groupId'] = this.groupId;
|
||||
data['paymentPrice'] = this.paymentPrice;
|
||||
if (this.detailsVoList != null) {
|
||||
data['detailsVoList'] =
|
||||
this.detailsVoList!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class DetailsVoList {
|
||||
int? id;
|
||||
String? month;
|
||||
double? costPrice;
|
||||
double? paidPrice;
|
||||
double? totalPrice;
|
||||
String? beginDate;
|
||||
String? endDate;
|
||||
String? unitPriceType;
|
||||
int? num;
|
||||
|
||||
DetailsVoList(
|
||||
{this.id,
|
||||
this.month,
|
||||
this.costPrice,
|
||||
this.paidPrice,
|
||||
this.totalPrice,
|
||||
this.beginDate,
|
||||
this.endDate,
|
||||
this.unitPriceType,
|
||||
this.num});
|
||||
|
||||
DetailsVoList.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
month = json['month'];
|
||||
costPrice = json['costPrice'];
|
||||
paidPrice = json['paidPrice'];
|
||||
totalPrice = json['totalPrice'];
|
||||
beginDate = json['beginDate'];
|
||||
endDate = json['endDate'];
|
||||
unitPriceType = json['unitPriceType'];
|
||||
num = json['num'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['month'] = this.month;
|
||||
data['costPrice'] = this.costPrice;
|
||||
data['paidPrice'] = this.paidPrice;
|
||||
data['totalPrice'] = this.totalPrice;
|
||||
data['beginDate'] = this.beginDate;
|
||||
data['endDate'] = this.endDate;
|
||||
data['unitPriceType'] = this.unitPriceType;
|
||||
data['num'] = this.num;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
// class LifePayModel {
|
||||
// int? years;
|
||||
// int? paymentNum;
|
||||
// List<DailyPaymentTypeVos>? dailyPaymentTypeVos;
|
||||
|
||||
// LifePayModel({this.years, this.paymentNum, this.dailyPaymentTypeVos});
|
||||
|
||||
// LifePayModel.fromJson(Map<String, dynamic> json) {
|
||||
// years = json['years'];
|
||||
// paymentNum = json['paymentNum'];
|
||||
// if (json['dailyPaymentTypeVos'] != null) {
|
||||
// dailyPaymentTypeVos = [];
|
||||
// json['dailyPaymentTypeVos'].forEach((v) {
|
||||
// dailyPaymentTypeVos!.add(new DailyPaymentTypeVos.fromJson(v));
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
// Map<String, dynamic> toJson() {
|
||||
// final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
// data['years'] = this.years;
|
||||
// data['paymentNum'] = this.paymentNum;
|
||||
// if (this.dailyPaymentTypeVos != null) {
|
||||
// data['dailyPaymentTypeVos'] =
|
||||
// this.dailyPaymentTypeVos!.map((v) => v.toJson()).toList();
|
||||
// }
|
||||
// return data;
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
// class DailyPaymentTypeVos {
|
||||
// int? id;
|
||||
// String? name;
|
||||
// List<DetailedVoList>? detailedVoList;
|
||||
|
||||
// DailyPaymentTypeVos({this.id, this.name, this.detailedVoList});
|
||||
|
||||
// DailyPaymentTypeVos.fromJson(Map<String, dynamic> json) {
|
||||
// id = json['id'];
|
||||
// name = json['name'];
|
||||
// if (json['detailedVoList'] != null) {
|
||||
// detailedVoList = [];
|
||||
// json['detailedVoList'].forEach((v) {
|
||||
// detailedVoList!.add(new DetailedVoList.fromJson(v));
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
// Map<String, dynamic> toJson() {
|
||||
// final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
// data['id'] = this.id;
|
||||
// data['name'] = this.name;
|
||||
// if (this.detailedVoList != null) {
|
||||
// data['detailedVoList'] =
|
||||
// this.detailedVoList!.map((v) => v.toJson()).toList();
|
||||
// }
|
||||
// return data;
|
||||
// }
|
||||
// }
|
||||
|
||||
// class DetailedVoList {
|
||||
// int? groupId;
|
||||
// double? paymentPrice;
|
||||
// List<DetailsVoList>? detailsVoList;
|
||||
|
||||
// DetailedVoList({this.groupId, this.paymentPrice, this.detailsVoList});
|
||||
|
||||
// DetailedVoList.fromJson(Map<String, dynamic> json) {
|
||||
// groupId = json['groupId'];
|
||||
// paymentPrice = json['paymentPrice'];
|
||||
// if (json['detailsVoList'] != null) {
|
||||
// detailsVoList = [];
|
||||
// json['detailsVoList'].forEach((v) {
|
||||
// detailsVoList!.add(new DetailsVoList.fromJson(v));
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
// Map<String, dynamic> toJson() {
|
||||
// final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
// data['groupId'] = this.groupId;
|
||||
// data['paymentPrice'] = this.paymentPrice;
|
||||
// if (this.detailsVoList != null) {
|
||||
// data['detailsVoList'] =
|
||||
// this.detailsVoList!.map((v) => v.toJson()).toList();
|
||||
// }
|
||||
// return data;
|
||||
// }
|
||||
// }
|
||||
|
||||
// class DetailsVoList {
|
||||
// int? id;
|
||||
// String? month;
|
||||
// double? costPrice;
|
||||
// double? paidPrice;
|
||||
// double? totalPrice;
|
||||
// String? beginDate;
|
||||
// String? endDate;
|
||||
// String? unitPriceType;
|
||||
// int? num;
|
||||
|
||||
// DetailsVoList(
|
||||
// {this.id,
|
||||
// this.month,
|
||||
// this.costPrice,
|
||||
// this.paidPrice,
|
||||
// this.totalPrice,
|
||||
// this.beginDate,
|
||||
// this.endDate,
|
||||
// this.unitPriceType,
|
||||
// this.num});
|
||||
|
||||
// DetailsVoList.fromJson(Map<String, dynamic> json) {
|
||||
// id = json['id'];
|
||||
// month = json['month'];
|
||||
// costPrice = json['costPrice'];
|
||||
// paidPrice = json['paidPrice'];
|
||||
// totalPrice = json['totalPrice'];
|
||||
// beginDate = json['beginDate'];
|
||||
// endDate = json['endDate'];
|
||||
// unitPriceType = json['unitPriceType'];
|
||||
// num = json['num'];
|
||||
// }
|
||||
|
||||
// Map<String, dynamic> toJson() {
|
||||
// final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
// data['id'] = this.id;
|
||||
// data['month'] = this.month;
|
||||
// data['costPrice'] = this.costPrice;
|
||||
// data['paidPrice'] = this.paidPrice;
|
||||
// data['totalPrice'] = this.totalPrice;
|
||||
// data['beginDate'] = this.beginDate;
|
||||
// data['endDate'] = this.endDate;
|
||||
// data['unitPriceType'] = this.unitPriceType;
|
||||
// data['num'] = this.num;
|
||||
// return data;
|
||||
// }
|
||||
// }
|
||||
|
@ -0,0 +1,102 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
part 'life_pay_list_model.g.dart';
|
||||
|
||||
@JsonSerializable(createToJson: true, explicitToJson: true)
|
||||
class LifePayListModel extends Equatable {
|
||||
final int years;
|
||||
final int paymentNum;
|
||||
final List<DailyPaymentTypeVos> dailyPaymentTypeVos;
|
||||
LifePayListModel({
|
||||
required this.years,
|
||||
required this.paymentNum,
|
||||
required this.dailyPaymentTypeVos,
|
||||
});
|
||||
factory LifePayListModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$LifePayListModelFromJson(json);
|
||||
factory LifePayListModel.zero() =>
|
||||
LifePayListModel(years: 0, paymentNum: 0, dailyPaymentTypeVos: [
|
||||
DailyPaymentTypeVos(id: 0, name: '', detailedVoList: [
|
||||
DetailedVoList(groupId: 0, paymentPrice: 0, detailsVoList: [])
|
||||
])
|
||||
]);
|
||||
Map<String, dynamic> toJson() => _$LifePayListModelToJson(this);
|
||||
@override
|
||||
List<Object?> get props => [years, paymentNum, dailyPaymentTypeVos];
|
||||
}
|
||||
|
||||
@JsonSerializable(createToJson: true, explicitToJson: true)
|
||||
class DailyPaymentTypeVos extends Equatable {
|
||||
final int id;
|
||||
final String name;
|
||||
final List<DetailedVoList> detailedVoList;
|
||||
DailyPaymentTypeVos({
|
||||
required this.id,
|
||||
required this.name,
|
||||
required this.detailedVoList,
|
||||
});
|
||||
factory DailyPaymentTypeVos.fromJson(Map<String, dynamic> json) =>
|
||||
_$DailyPaymentTypeVosFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$DailyPaymentTypeVosToJson(this);
|
||||
@override
|
||||
List<Object> get props => [id, name, detailedVoList];
|
||||
}
|
||||
|
||||
@JsonSerializable(createToJson: true, explicitToJson: true)
|
||||
class DetailedVoList extends Equatable {
|
||||
final int groupId;
|
||||
final num paymentPrice;
|
||||
final List<DetailsVoList> detailsVoList;
|
||||
DetailedVoList({
|
||||
required this.groupId,
|
||||
required this.paymentPrice,
|
||||
required this.detailsVoList,
|
||||
});
|
||||
factory DetailedVoList.fromJson(Map<String, dynamic> json) =>
|
||||
_$DetailedVoListFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$DetailedVoListToJson(this);
|
||||
@override
|
||||
List<Object> get props => [groupId, paymentPrice, detailsVoList];
|
||||
}
|
||||
|
||||
@JsonSerializable(createToJson: true, explicitToJson: true)
|
||||
class DetailsVoList extends Equatable {
|
||||
final int id;
|
||||
final String month;
|
||||
final num costPrice;
|
||||
final num paidPrice;
|
||||
final num totalPrice;
|
||||
final String beginDate;
|
||||
final String endDate;
|
||||
final String unitPriceType;
|
||||
@JsonKey(name: 'num')
|
||||
final int number;
|
||||
DetailsVoList({
|
||||
required this.id,
|
||||
required this.month,
|
||||
required this.costPrice,
|
||||
required this.paidPrice,
|
||||
required this.totalPrice,
|
||||
required this.beginDate,
|
||||
required this.endDate,
|
||||
required this.unitPriceType,
|
||||
required this.number,
|
||||
});
|
||||
factory DetailsVoList.fromJson(Map<String, dynamic> json) =>
|
||||
_$DetailsVoListFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$DetailsVoListToJson(this);
|
||||
@override
|
||||
List<Object> get props {
|
||||
return [
|
||||
id,
|
||||
month,
|
||||
costPrice,
|
||||
paidPrice,
|
||||
totalPrice,
|
||||
beginDate,
|
||||
endDate,
|
||||
unitPriceType,
|
||||
number,
|
||||
];
|
||||
}
|
||||
}
|
@ -0,0 +1,87 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'life_pay_list_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
LifePayListModel _$LifePayListModelFromJson(Map<String, dynamic> json) {
|
||||
return LifePayListModel(
|
||||
years: json['years'] as int,
|
||||
paymentNum: json['paymentNum'] as int,
|
||||
dailyPaymentTypeVos: (json['dailyPaymentTypeVos'] as List<dynamic>)
|
||||
.map((e) => DailyPaymentTypeVos.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$LifePayListModelToJson(LifePayListModel instance) =>
|
||||
<String, dynamic>{
|
||||
'years': instance.years,
|
||||
'paymentNum': instance.paymentNum,
|
||||
'dailyPaymentTypeVos':
|
||||
instance.dailyPaymentTypeVos.map((e) => e.toJson()).toList(),
|
||||
};
|
||||
|
||||
DailyPaymentTypeVos _$DailyPaymentTypeVosFromJson(Map<String, dynamic> json) {
|
||||
return DailyPaymentTypeVos(
|
||||
id: json['id'] as int,
|
||||
name: json['name'] as String,
|
||||
detailedVoList: (json['detailedVoList'] as List<dynamic>)
|
||||
.map((e) => DetailedVoList.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$DailyPaymentTypeVosToJson(
|
||||
DailyPaymentTypeVos instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'name': instance.name,
|
||||
'detailedVoList': instance.detailedVoList.map((e) => e.toJson()).toList(),
|
||||
};
|
||||
|
||||
DetailedVoList _$DetailedVoListFromJson(Map<String, dynamic> json) {
|
||||
return DetailedVoList(
|
||||
groupId: json['groupId'] as int,
|
||||
paymentPrice: json['paymentPrice'] as num,
|
||||
detailsVoList: (json['detailsVoList'] as List<dynamic>)
|
||||
.map((e) => DetailsVoList.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$DetailedVoListToJson(DetailedVoList instance) =>
|
||||
<String, dynamic>{
|
||||
'groupId': instance.groupId,
|
||||
'paymentPrice': instance.paymentPrice,
|
||||
'detailsVoList': instance.detailsVoList.map((e) => e.toJson()).toList(),
|
||||
};
|
||||
|
||||
DetailsVoList _$DetailsVoListFromJson(Map<String, dynamic> json) {
|
||||
return DetailsVoList(
|
||||
id: json['id'] as int,
|
||||
month: json['month'] as String,
|
||||
costPrice: json['costPrice'] as num,
|
||||
paidPrice: json['paidPrice'] as num,
|
||||
totalPrice: json['totalPrice'] as num,
|
||||
beginDate: json['beginDate'] as String,
|
||||
endDate: json['endDate'] as String,
|
||||
unitPriceType: json['unitPriceType'] as String,
|
||||
number: json['num'] as int,
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$DetailsVoListToJson(DetailsVoList instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'month': instance.month,
|
||||
'costPrice': instance.costPrice,
|
||||
'paidPrice': instance.paidPrice,
|
||||
'totalPrice': instance.totalPrice,
|
||||
'beginDate': instance.beginDate,
|
||||
'endDate': instance.endDate,
|
||||
'unitPriceType': instance.unitPriceType,
|
||||
'num': instance.number,
|
||||
};
|
@ -0,0 +1,21 @@
|
||||
|
||||
import 'package:aku_community/models/life_pay/life_pay_list_model.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SharLifPayModel extends InheritedWidget {
|
||||
SharLifPayModel({Key? key, required this.child, required this.models})
|
||||
: super(key: key, child: child);
|
||||
|
||||
final Widget child;
|
||||
List<LifePayListModel> models;
|
||||
|
||||
static SharLifPayModel? of(BuildContext context) {
|
||||
return context.dependOnInheritedWidgetOfExactType<SharLifPayModel>();
|
||||
}
|
||||
|
||||
@override
|
||||
bool updateShouldNotify(SharLifPayModel oldWidget) {
|
||||
return oldWidget.models != models;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in new issue