123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- import 'package:domain/generated/json/base/json_convert_content.dart';
- import 'package:domain/entity/visitor_page_entity.dart';
- VisitorPageEntity $VisitorPageEntityFromJson(Map<String, dynamic> json) {
- final VisitorPageEntity visitorPageEntity = VisitorPageEntity();
- final int? count = jsonConvert.convert<int>(json['count']);
- if (count != null) {
- visitorPageEntity.count = count;
- }
- final int? page = jsonConvert.convert<int>(json['page']);
- if (page != null) {
- visitorPageEntity.page = page;
- }
- final int? limit = jsonConvert.convert<int>(json['limit']);
- if (limit != null) {
- visitorPageEntity.limit = limit;
- }
- final int? countPage = jsonConvert.convert<int>(json['count_page']);
- if (countPage != null) {
- visitorPageEntity.countPage = countPage;
- }
- final List<VisitorPageList>? list = (json['list'] as List<dynamic>?)?.map(
- (e) => jsonConvert.convert<VisitorPageList>(e) as VisitorPageList).toList();
- if (list != null) {
- visitorPageEntity.list = list;
- }
- return visitorPageEntity;
- }
- Map<String, dynamic> $VisitorPageEntityToJson(VisitorPageEntity entity) {
- final Map<String, dynamic> data = <String, dynamic>{};
- data['count'] = entity.count;
- data['page'] = entity.page;
- data['limit'] = entity.limit;
- data['count_page'] = entity.countPage;
- data['list'] = entity.list.map((v) => v.toJson()).toList();
- return data;
- }
- extension VisitorPageEntityExtension on VisitorPageEntity {
- VisitorPageEntity copyWith({
- int? count,
- int? page,
- int? limit,
- int? countPage,
- List<VisitorPageList>? list,
- }) {
- return VisitorPageEntity()
- ..count = count ?? this.count
- ..page = page ?? this.page
- ..limit = limit ?? this.limit
- ..countPage = countPage ?? this.countPage
- ..list = list ?? this.list;
- }
- }
- VisitorPageList $VisitorPageListFromJson(Map<String, dynamic> json) {
- final VisitorPageList visitorPageList = VisitorPageList();
- final String? id = jsonConvert.convert<String>(json['id']);
- if (id != null) {
- visitorPageList.id = id;
- }
- final String? name = jsonConvert.convert<String>(json['name']);
- if (name != null) {
- visitorPageList.name = name;
- }
- final String? phone = jsonConvert.convert<String>(json['phone']);
- if (phone != null) {
- visitorPageList.phone = phone;
- }
- final String? nric = jsonConvert.convert<String>(json['nric']);
- if (nric != null) {
- visitorPageList.nric = nric;
- }
- final String? vehicleNumber = jsonConvert.convert<String>(json['vehicle_number']);
- if (vehicleNumber != null) {
- visitorPageList.vehicleNumber = vehicleNumber;
- }
- final String? createdAt = jsonConvert.convert<String>(json['created_at']);
- if (createdAt != null) {
- visitorPageList.createdAt = createdAt;
- }
- final String? note = jsonConvert.convert<String>(json['note']);
- if (note != null) {
- visitorPageList.note = note;
- }
- return visitorPageList;
- }
- Map<String, dynamic> $VisitorPageListToJson(VisitorPageList entity) {
- final Map<String, dynamic> data = <String, dynamic>{};
- data['id'] = entity.id;
- data['name'] = entity.name;
- data['phone'] = entity.phone;
- data['nric'] = entity.nric;
- data['vehicle_number'] = entity.vehicleNumber;
- data['created_at'] = entity.createdAt;
- data['note'] = entity.note;
- return data;
- }
- extension VisitorPageListExtension on VisitorPageList {
- VisitorPageList copyWith({
- String? id,
- String? name,
- String? phone,
- String? nric,
- String? vehicleNumber,
- String? createdAt,
- String? note,
- }) {
- return VisitorPageList()
- ..id = id ?? this.id
- ..name = name ?? this.name
- ..phone = phone ?? this.phone
- ..nric = nric ?? this.nric
- ..vehicleNumber = vehicleNumber ?? this.vehicleNumber
- ..createdAt = createdAt ?? this.createdAt
- ..note = note ?? this.note;
- }
- }
|