add paginator in boxes and deliveries

This commit is contained in:
Thinzar Win
2020-10-16 17:57:58 +06:30
parent e4fbf8bd20
commit 8235f28aa8
14 changed files with 1227 additions and 64 deletions

View File

@@ -11,6 +11,7 @@ const cargo_types_collection = "cargo_types";
const custom_duties_collection = "custom_duties";
const discounts_by_weights_collection = "discounts_by_weight";
const shipments_collection = "shipments";
const boxes_collection = "boxes";
// docs
const setting_doc_id = "setting";

View File

@@ -1,3 +1,4 @@
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:fcs/domain/entities/discount_by_weight.dart';
import 'package:fcs/domain/entities/rate.dart';
import 'package:fcs/domain/vo/shipment_status.dart';
@@ -109,8 +110,8 @@ class Box {
this.cartonType,
this.fcsID,
this.userName,
this.rate,
this.weight,
this.rate = 0,
this.weight = 0,
this.packageType,
this.pickUpID,
this.remark,
@@ -133,4 +134,21 @@ class Box {
'delivery_address': deliveryAddress.toMap(),
};
}
factory Box.fromMap(Map<String, dynamic> map, String docID) {
var _arrivedDate = (map['arrived_date'] as Timestamp);
return Box(
id: docID,
arrivedDate: _arrivedDate != null ? _arrivedDate.toDate() : null,
shipmentNumber: map['shipment_number'],
receiverNumber: map['receiver_number'],
boxNumber: map['box_number'],
length: map['length'],
width: map['width'],
height: map['height'],
userName: map['user_name'],
fcsID: map['fcs_id'],
cartonType: map['carton_type']);
}
}