Aidra Driver 1.3.5+68
Aidra Driver - Your path to green energy
Loading...
Searching...
No Matches
unloading_request_model.dart
Go to the documentation of this file.
1import '../../domain/entities/unloading_request_entity.dart';
2import 'collection_voucher_model.dart';
3
6 required super.warehouseResponsibleId,
7 required super.firstWeight,
8 required super.userId,
9 required super.collectionVouchers,
10 });
11
12 factory UnloadingRequestModel.fromJson(Map<String, dynamic> json) {
14 warehouseResponsibleId: json['warehouseResponsibleId'] as int,
15 firstWeight: (json['firstWeight'] as num).toDouble(),
16 userId: json['userId'] as int,
17 collectionVouchers: (json['collectionVouchers'] as List<dynamic>)
18 .map((voucherJson) => CollectionVoucherModel.fromJson(voucherJson as Map<String, dynamic>))
19 .toList(),
20 );
21 }
22
23 Map<String, dynamic> toJson() {
24 return {
25 'warehouseResponsibleId': warehouseResponsibleId,
26 'firstWeight': firstWeight,
27 'userId': userId,
28 'collectionVouchers': collectionVouchers
29 .map((voucher) => (voucher as CollectionVoucherModel).toJson())
30 .toList(),
31 };
32 }
33}
UnloadingRequestEntity({ required this.warehouseResponsibleId, required this.firstWeight, required this.userId, required this.collectionVouchers, })
final List< CollectionVoucherEntity > collectionVouchers
UnloadingRequestModel({ required super.warehouseResponsibleId, required super.firstWeight, required super.userId, required super.collectionVouchers, })
Map< String, dynamic > toJson()