rename shipment
This commit is contained in:
@@ -7,20 +7,11 @@ import 'package:fcs/domain/vo/radio.dart';
|
||||
import 'package:fcs/pages/main/model/base_model.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
|
||||
class PickUpModel extends BaseModel {
|
||||
final log = Logger('PickUpModel');
|
||||
class ShipmentModel extends BaseModel {
|
||||
final log = Logger('ShipmentModel');
|
||||
|
||||
StreamSubscription<QuerySnapshot> listener;
|
||||
|
||||
// var profile = FCSProfile(
|
||||
// id: '1',
|
||||
// usaAddress: '154-19 64th Ave.\nFlushing, NY 11367',
|
||||
// mmAddress: 'FCS Trading Myanmar\nRoom 333, Yangon',
|
||||
// usaContactNumber: '1 (929) 215-2247',
|
||||
// mmContactNumber: '+95 9 700224723',
|
||||
// mail: 'admin@fcs.com',
|
||||
// facebook: 'https://facebook.com/fcs');
|
||||
|
||||
List<RadioGroup> radioGroups1 = [
|
||||
RadioGroup(
|
||||
text: "FCS Pickup",
|
||||
@@ -62,9 +53,9 @@ class PickUpModel extends BaseModel {
|
||||
return radioGroups;
|
||||
}
|
||||
|
||||
List<PickUp> get pickups {
|
||||
List<PickUp> pickups = [
|
||||
PickUp(
|
||||
List<Shipment> get pickups {
|
||||
List<Shipment> pickups = [
|
||||
Shipment(
|
||||
id: "S200412 - 12 Apr 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
phoneNumber: '+959111111111',
|
||||
@@ -83,7 +74,7 @@ class PickUpModel extends BaseModel {
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
PickUp(
|
||||
Shipment(
|
||||
id: "S200125 - 12 May 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
phoneNumber: '+959111111111',
|
||||
@@ -100,7 +91,7 @@ class PickUpModel extends BaseModel {
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
PickUp(
|
||||
Shipment(
|
||||
id: "S200441 - 13 Apr 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
phoneNumber: '+959111111111',
|
||||
@@ -118,7 +109,7 @@ class PickUpModel extends BaseModel {
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
PickUp(
|
||||
Shipment(
|
||||
id: "S200412 - 12 Apr 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
phoneNumber: '+959111111111',
|
||||
@@ -135,7 +126,7 @@ class PickUpModel extends BaseModel {
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
PickUp(
|
||||
Shipment(
|
||||
id: "S200125 - 12 May 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
phoneNumber: '+959111111111',
|
||||
@@ -152,7 +143,7 @@ class PickUpModel extends BaseModel {
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
PickUp(
|
||||
Shipment(
|
||||
id: "S200441 - 13 Apr 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
phoneNumber: '+959111111111',
|
||||
@@ -169,7 +160,7 @@ class PickUpModel extends BaseModel {
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
PickUp(
|
||||
Shipment(
|
||||
id: "S200441 - 10 Apr 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
phoneNumber: '+959111111111',
|
||||
@@ -186,7 +177,7 @@ class PickUpModel extends BaseModel {
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
PickUp(
|
||||
Shipment(
|
||||
id: "S200441 - 6 Apr 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
phoneNumber: '+959111111111',
|
||||
@@ -207,8 +198,8 @@ class PickUpModel extends BaseModel {
|
||||
return pickups;
|
||||
}
|
||||
|
||||
List<PickUp> pickups1 = [
|
||||
PickUp(
|
||||
List<Shipment> pickups1 = [
|
||||
Shipment(
|
||||
id: "S200412 - 12 Apr 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
phoneNumber: '+959111111111',
|
||||
@@ -227,7 +218,7 @@ class PickUpModel extends BaseModel {
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
PickUp(
|
||||
Shipment(
|
||||
id: "S200125 - 12 May 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
phoneNumber: '+959111111111',
|
||||
@@ -244,7 +235,7 @@ class PickUpModel extends BaseModel {
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
PickUp(
|
||||
Shipment(
|
||||
id: "S200441 - 13 Apr 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
phoneNumber: '+959111111111',
|
||||
@@ -262,7 +253,7 @@ class PickUpModel extends BaseModel {
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
PickUp(
|
||||
Shipment(
|
||||
id: "S200412 - 12 Apr 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
phoneNumber: '+959111111111',
|
||||
@@ -279,7 +270,7 @@ class PickUpModel extends BaseModel {
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
PickUp(
|
||||
Shipment(
|
||||
id: "S200125 - 12 May 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
phoneNumber: '+959111111111',
|
||||
@@ -296,7 +287,7 @@ class PickUpModel extends BaseModel {
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
PickUp(
|
||||
Shipment(
|
||||
id: "S200441 - 13 Apr 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
phoneNumber: '+959111111111',
|
||||
@@ -313,7 +304,7 @@ class PickUpModel extends BaseModel {
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
PickUp(
|
||||
Shipment(
|
||||
id: "S200441 - 10 Apr 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
phoneNumber: '+959111111111',
|
||||
@@ -330,7 +321,7 @@ class PickUpModel extends BaseModel {
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
PickUp(
|
||||
Shipment(
|
||||
id: "S200441 - 6 Apr 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
phoneNumber: '+959111111111',
|
||||
@@ -349,22 +340,22 @@ class PickUpModel extends BaseModel {
|
||||
]),
|
||||
];
|
||||
|
||||
List<PickUp> get canceled {
|
||||
List<PickUp> _p = pickups.where((e) => e.status == "Canceled").toList()
|
||||
List<Shipment> get canceled {
|
||||
List<Shipment> _p = pickups.where((e) => e.status == "Canceled").toList()
|
||||
..sort((e1, e2) {
|
||||
return e2.date.compareTo(e1.date);
|
||||
});
|
||||
return _p;
|
||||
}
|
||||
|
||||
List<PickUp> get completed {
|
||||
List<Shipment> get completed {
|
||||
return pickups.where((e) => e.status == "Pickuped").toList()
|
||||
..sort((e1, e2) {
|
||||
return e2.date.compareTo(e1.date);
|
||||
});
|
||||
}
|
||||
|
||||
List<PickUp> get upcoming {
|
||||
List<Shipment> get upcoming {
|
||||
return pickups
|
||||
.where((e) =>
|
||||
e.status == "Pending" ||
|
||||
@@ -6,7 +6,7 @@ import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/localization/app_translations.dart';
|
||||
import 'package:fcs/pages/box/model/box_model.dart';
|
||||
import 'package:fcs/pages/main/model/main_model.dart';
|
||||
import 'package:fcs/pages/shipment/model/pickup_model.dart';
|
||||
import 'package:fcs/pages/shipment/model/shipment_model.dart';
|
||||
import 'package:fcs/pages/shipment_address/model/shipment_address_model.dart';
|
||||
import 'package:fcs/pages/shipment_address/shipping_address_row.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
@@ -24,15 +24,15 @@ import 'package:flutter/material.dart';
|
||||
|
||||
import 'pickup_box_editor.dart';
|
||||
|
||||
class PickUpEditor extends StatefulWidget {
|
||||
final PickUp pickUp;
|
||||
PickUpEditor({this.pickUp});
|
||||
class ShipmentEditor extends StatefulWidget {
|
||||
final Shipment pickUp;
|
||||
ShipmentEditor({this.pickUp});
|
||||
|
||||
@override
|
||||
_PickUpEditorState createState() => _PickUpEditorState();
|
||||
_ShipmentEditorState createState() => _ShipmentEditorState();
|
||||
}
|
||||
|
||||
class _PickUpEditorState extends State<PickUpEditor> {
|
||||
class _ShipmentEditorState extends State<ShipmentEditor> {
|
||||
var dateFormatter = new DateFormat('dd MMM yyyy');
|
||||
final numberFormatter = new NumberFormat("#,###");
|
||||
MultiImgController multiImgController = MultiImgController();
|
||||
@@ -53,7 +53,7 @@ class _PickUpEditorState extends State<PickUpEditor> {
|
||||
TextEditingController _pickupDate = new TextEditingController();
|
||||
TextEditingController _handlingFeeController = new TextEditingController();
|
||||
|
||||
PickUp _pickUp;
|
||||
Shipment _pickUp;
|
||||
bool _isLoading = false;
|
||||
var now = new DateTime.now();
|
||||
bool isNew;
|
||||
@@ -88,7 +88,7 @@ class _PickUpEditorState extends State<PickUpEditor> {
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
];
|
||||
_pickUp = PickUp(cargoTypes: _cargoTypes);
|
||||
_pickUp = Shipment(cargoTypes: _cargoTypes);
|
||||
}
|
||||
var shipmentModel =
|
||||
Provider.of<ShipmentAddressModel>(context, listen: false);
|
||||
@@ -102,7 +102,7 @@ class _PickUpEditorState extends State<PickUpEditor> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var pickupModel = Provider.of<PickUpModel>(context);
|
||||
var pickupModel = Provider.of<ShipmentModel>(context);
|
||||
|
||||
final fromTimeBox = fcsInput(
|
||||
'From',
|
||||
@@ -1,21 +1,21 @@
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/localization/app_translations.dart';
|
||||
import 'package:fcs/pages/shipment/model/pickup_model.dart';
|
||||
import 'package:fcs/pages/shipment/model/shipment_model.dart';
|
||||
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'pickup_editor.dart';
|
||||
import 'pickup_list_row.dart';
|
||||
import 'shipment_editor.dart';
|
||||
import 'shipment_list_row.dart';
|
||||
|
||||
class PickUpList extends StatefulWidget {
|
||||
class ShipmentList extends StatefulWidget {
|
||||
@override
|
||||
_PickUpListState createState() => _PickUpListState();
|
||||
_ShipmentListState createState() => _ShipmentListState();
|
||||
}
|
||||
|
||||
class _PickUpListState extends State<PickUpList> {
|
||||
class _ShipmentListState extends State<ShipmentList> {
|
||||
bool _isLoading = false;
|
||||
|
||||
@override
|
||||
@@ -30,7 +30,7 @@ class _PickUpListState extends State<PickUpList> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var pickupModel = Provider.of<PickUpModel>(context);
|
||||
var pickupModel = Provider.of<ShipmentModel>(context);
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: DefaultTabController(
|
||||
@@ -82,7 +82,7 @@ class _PickUpListState extends State<PickUpList> {
|
||||
shrinkWrap: true,
|
||||
itemCount: pickupModel.pickups.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return PickupListRow(pickUp: pickupModel.pickups[index]);
|
||||
return ShipmentListRow(pickUp: pickupModel.pickups[index]);
|
||||
}),
|
||||
// body: TabBarView(
|
||||
// children: [
|
||||
@@ -98,11 +98,11 @@ class _PickUpListState extends State<PickUpList> {
|
||||
}
|
||||
|
||||
_newPickup() {
|
||||
Navigator.of(context).push(BottomUpPageRoute(PickUpEditor()));
|
||||
Navigator.of(context).push(BottomUpPageRoute(ShipmentEditor()));
|
||||
}
|
||||
|
||||
Widget _upComing() {
|
||||
var pickupModel = Provider.of<PickUpModel>(context);
|
||||
var pickupModel = Provider.of<ShipmentModel>(context);
|
||||
return Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
@@ -115,7 +115,7 @@ class _PickUpListState extends State<PickUpList> {
|
||||
shrinkWrap: true,
|
||||
itemCount: pickupModel.upcoming.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return PickupListRow(pickUp: pickupModel.upcoming[index]);
|
||||
return ShipmentListRow(pickUp: pickupModel.upcoming[index]);
|
||||
}),
|
||||
),
|
||||
],
|
||||
@@ -123,7 +123,7 @@ class _PickUpListState extends State<PickUpList> {
|
||||
}
|
||||
|
||||
Widget _completed() {
|
||||
var pickupModel = Provider.of<PickUpModel>(context);
|
||||
var pickupModel = Provider.of<ShipmentModel>(context);
|
||||
return Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
@@ -136,7 +136,7 @@ class _PickUpListState extends State<PickUpList> {
|
||||
shrinkWrap: true,
|
||||
itemCount: pickupModel.completed.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return PickupListRow(pickUp: pickupModel.completed[index]);
|
||||
return ShipmentListRow(pickUp: pickupModel.completed[index]);
|
||||
}),
|
||||
),
|
||||
],
|
||||
@@ -144,7 +144,7 @@ class _PickUpListState extends State<PickUpList> {
|
||||
}
|
||||
|
||||
Widget _canceled() {
|
||||
var pickupModel = Provider.of<PickUpModel>(context);
|
||||
var pickupModel = Provider.of<ShipmentModel>(context);
|
||||
return Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
@@ -157,7 +157,7 @@ class _PickUpListState extends State<PickUpList> {
|
||||
shrinkWrap: true,
|
||||
itemCount: pickupModel.canceled.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return PickupListRow(pickUp: pickupModel.canceled[index]);
|
||||
return ShipmentListRow(pickUp: pickupModel.canceled[index]);
|
||||
}),
|
||||
),
|
||||
],
|
||||
@@ -5,19 +5,19 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_icons/flutter_icons.dart';
|
||||
|
||||
import '../main/util.dart';
|
||||
import 'pickup_editor.dart';
|
||||
import 'shipment_editor.dart';
|
||||
|
||||
class PickupListRow extends StatefulWidget {
|
||||
final PickUp pickUp;
|
||||
const PickupListRow({this.pickUp});
|
||||
class ShipmentListRow extends StatefulWidget {
|
||||
final Shipment pickUp;
|
||||
const ShipmentListRow({this.pickUp});
|
||||
|
||||
@override
|
||||
_PickupListRowState createState() => _PickupListRowState();
|
||||
_ShipmentListRowState createState() => _ShipmentListRowState();
|
||||
}
|
||||
|
||||
class _PickupListRowState extends State<PickupListRow> {
|
||||
class _ShipmentListRowState extends State<ShipmentListRow> {
|
||||
final double dotSize = 15.0;
|
||||
PickUp _pickUp = new PickUp();
|
||||
Shipment _pickUp = new Shipment();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -41,7 +41,7 @@ class _PickupListRowState extends State<PickupListRow> {
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Navigator.of(context)
|
||||
.push(BottomUpPageRoute(PickUpEditor(pickUp: _pickUp)));
|
||||
.push(BottomUpPageRoute(ShipmentEditor(pickUp: _pickUp)));
|
||||
},
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Reference in New Issue
Block a user