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