add shipments
This commit is contained in:
@@ -84,6 +84,13 @@ class BoxRow extends StatelessWidget {
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8.0),
|
||||
child: new Text(
|
||||
"${box.cartonNumber ?? ""}",
|
||||
style: new TextStyle(fontSize: 15.0, color: Colors.black),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8.0),
|
||||
child: new Text(
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
import 'package:fcs/helpers/firebase_helper.dart';
|
||||
import 'package:path/path.dart' as Path;
|
||||
|
||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||
import 'package:fcs/data/services/services.dart';
|
||||
@@ -31,10 +34,10 @@ class ShipmentModel extends BaseModel {
|
||||
|
||||
get menuSelectedIndex => _menuSelectedIndex;
|
||||
|
||||
initData(bool forCustomer) {
|
||||
initData(bool forCustomer, {bool myPickup = false}) {
|
||||
logout();
|
||||
_menuSelectedIndex = 1;
|
||||
_loadShipments(forCustomer);
|
||||
_loadShipments(forCustomer, myPickup);
|
||||
_delivered = _getDeliveredExample(forCustomer);
|
||||
_delivered.load();
|
||||
}
|
||||
@@ -80,7 +83,7 @@ class ShipmentModel extends BaseModel {
|
||||
if (isCustomer) {
|
||||
pageQuery = pageQuery.where("user_id", isEqualTo: user.id);
|
||||
}
|
||||
pageQuery = pageQuery.orderBy("current_status_date", descending: true);
|
||||
pageQuery = pageQuery.orderBy("status_date", descending: true);
|
||||
var paginator = new Paginator(pageQuery, rowPerLoad: 20, toObj: (data, id) {
|
||||
return Shipment.fromMap(data, id);
|
||||
});
|
||||
@@ -99,14 +102,14 @@ class ShipmentModel extends BaseModel {
|
||||
return Shipment(
|
||||
id: m.id,
|
||||
shipmentNumber: m.message,
|
||||
currentStatus: m.senderName,
|
||||
status: m.senderName,
|
||||
pickupDate: m.date,
|
||||
);
|
||||
});
|
||||
return paginator;
|
||||
}
|
||||
|
||||
Future<void> _loadShipments(bool forCustomer) async {
|
||||
Future<void> _loadShipments(bool forCustomer, bool myPickup) async {
|
||||
if (user == null) return;
|
||||
if (!forCustomer && !user.hasShipment()) return;
|
||||
String path = "/$shipments_collection";
|
||||
@@ -123,6 +126,10 @@ class ShipmentModel extends BaseModel {
|
||||
if (forCustomer) {
|
||||
q = q.where("user_id", isEqualTo: user.id);
|
||||
}
|
||||
if (myPickup) {
|
||||
q = q.where("pickup_user_id", isEqualTo: user.id);
|
||||
}
|
||||
q = q.orderBy("created_at", descending: true);
|
||||
|
||||
listener = q.snapshots().listen((QuerySnapshot snapshot) {
|
||||
_shipments.clear();
|
||||
@@ -175,4 +182,39 @@ class ShipmentModel extends BaseModel {
|
||||
Future<void> cancelShipment(Shipment shipment) {
|
||||
return Services.instance.shipmentService.cancelShipment(shipment);
|
||||
}
|
||||
|
||||
Future<void> assignShipment(Shipment shipment) {
|
||||
return Services.instance.shipmentService.assignShipment(shipment);
|
||||
}
|
||||
|
||||
Future<void> completeAssignShipment(Shipment shipment) {
|
||||
return Services.instance.shipmentService.completeAssignShipment(shipment);
|
||||
}
|
||||
|
||||
Future<void> completePickupShipment(Shipment shipment) {
|
||||
return Services.instance.shipmentService.completePickupShipment(shipment);
|
||||
}
|
||||
|
||||
Future<void> completePackShipment(Shipment shipment) {
|
||||
return Services.instance.shipmentService.completePackShipment(shipment);
|
||||
}
|
||||
|
||||
Future<void> packShipment(Shipment shipment) {
|
||||
return Services.instance.shipmentService.packShipment(shipment);
|
||||
}
|
||||
|
||||
Future<void> confirmShipment(Shipment shipment) async {
|
||||
// String path = Path.join(shipment_labels_files_path);
|
||||
// String url = await uploadStorage(path, file);
|
||||
// shipment.shipmentLabelUrl = url;
|
||||
return Services.instance.shipmentService.confirmShipment(shipment);
|
||||
}
|
||||
|
||||
Future<void> completeConfirmShipment(Shipment shipment) {
|
||||
return Services.instance.shipmentService.completeConfirmShipment(shipment);
|
||||
}
|
||||
|
||||
Future<void> completeReceiveShipment(Shipment shipment) {
|
||||
return Services.instance.shipmentService.completeReceiveShipment(shipment);
|
||||
}
|
||||
}
|
||||
|
||||
167
lib/pages/shipment/shipment_assign.dart
Normal file
167
lib/pages/shipment/shipment_assign.dart
Normal file
@@ -0,0 +1,167 @@
|
||||
import 'package:fcs/domain/constants.dart';
|
||||
import 'package:fcs/domain/entities/shipment.dart';
|
||||
import 'package:fcs/domain/entities/user.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/shipment/model/shipment_model.dart';
|
||||
import 'package:fcs/pages/staff/model/staff_model.dart';
|
||||
import 'package:fcs/pages/widgets/input_text.dart';
|
||||
import 'package:fcs/pages/widgets/local_button.dart';
|
||||
import 'package:fcs/pages/widgets/local_dropdown.dart';
|
||||
import 'package:fcs/pages/widgets/local_radio_buttons.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:fcs/pages/widgets/local_title.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_icons/flutter_icons.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'widgets.dart';
|
||||
|
||||
class ShipmentAssign extends StatefulWidget {
|
||||
final Shipment shipment;
|
||||
ShipmentAssign({this.shipment});
|
||||
|
||||
@override
|
||||
_ShipmentAssignState createState() => _ShipmentAssignState();
|
||||
}
|
||||
|
||||
class _ShipmentAssignState extends State<ShipmentAssign> {
|
||||
var dateFormatter = new DateFormat('dd MMM yyyy');
|
||||
var timeFormatter = new DateFormat('jm');
|
||||
|
||||
TextEditingController _fromTimeEditingController =
|
||||
new TextEditingController();
|
||||
TextEditingController _toTimeEditingController = new TextEditingController();
|
||||
TextEditingController _pickupDate = new TextEditingController();
|
||||
TextEditingController _handlingFee = new TextEditingController();
|
||||
|
||||
Shipment _shipment;
|
||||
bool _isLoading = false;
|
||||
var now = new DateTime.now();
|
||||
|
||||
String _selectedShipmentType;
|
||||
User _user;
|
||||
List<User> _users;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
_shipment = widget.shipment;
|
||||
_loadUsers();
|
||||
|
||||
_selectedShipmentType = _shipment.shipmentType;
|
||||
_fromTimeEditingController.text = _shipment.pickupTimeStart;
|
||||
_toTimeEditingController.text = _shipment.pickupTimeEnd;
|
||||
_pickupDate.text = dateFormatter.format(_shipment.pickupDate ?? now);
|
||||
_handlingFee.text = _shipment.handlingFee?.toString() ?? "0";
|
||||
}
|
||||
|
||||
_loadUsers() async {
|
||||
StaffModel staffModel = Provider.of<StaffModel>(context, listen: false);
|
||||
var users = await staffModel.getPickupEmployees();
|
||||
var selectUser = users.firstWhere((e) => e.id == _shipment.pickupUserID,
|
||||
orElse: () => null);
|
||||
setState(() {
|
||||
_users = users;
|
||||
_user = selectUser;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ShipmentModel pickupModel = Provider.of<ShipmentModel>(context);
|
||||
final shipmentNumberBox = getShipmentNumberStatus(context, _shipment);
|
||||
bool isLocalPickup = _selectedShipmentType == shipment_local_pickup;
|
||||
bool isCourierPickup = _selectedShipmentType == shipment_courier_pickup;
|
||||
bool isLocalDropoff = _selectedShipmentType == shipment_local_dropoff;
|
||||
bool isCourierDropoff = _selectedShipmentType == shipment_courier_dropoff;
|
||||
|
||||
var usersBox = LocalDropdown<User>(
|
||||
callback: (v) {
|
||||
setState(() {
|
||||
_user = v;
|
||||
});
|
||||
},
|
||||
labelKey: "shipment.staff",
|
||||
iconData: MaterialCommunityIcons.worker,
|
||||
display: (u) => u.name,
|
||||
selectedValue: _user,
|
||||
values: _users,
|
||||
);
|
||||
|
||||
final assignBtn = LocalButton(
|
||||
textKey: "shipment.assign.btn",
|
||||
callBack: _save,
|
||||
);
|
||||
final handlingFeeBox = InputText(
|
||||
labelTextKey: "shipment.handling.fee",
|
||||
controller: _handlingFee,
|
||||
iconData: FontAwesome.truck,
|
||||
);
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
leading: new IconButton(
|
||||
icon: new Icon(
|
||||
CupertinoIcons.back,
|
||||
color: primaryColor,
|
||||
),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
shadowColor: Colors.transparent,
|
||||
backgroundColor: Colors.white,
|
||||
title: LocalText(
|
||||
context,
|
||||
"shipment.assign.title",
|
||||
fontSize: 20,
|
||||
color: primaryColor,
|
||||
),
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: ListView(
|
||||
children: <Widget>[
|
||||
Center(child: shipmentNumberBox),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
LocalTitle(textKey: "shipment.assign.for.pickup"),
|
||||
usersBox,
|
||||
handlingFeeBox,
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
assignBtn,
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_save() async {
|
||||
_shipment.pickupUserID = this._user.id;
|
||||
_shipment.handlingFee = double.tryParse(_handlingFee.text) ?? 0;
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
});
|
||||
try {
|
||||
ShipmentModel shipmentModel =
|
||||
Provider.of<ShipmentModel>(context, listen: false);
|
||||
await shipmentModel.assignShipment(_shipment);
|
||||
Navigator.pop(context, true);
|
||||
} catch (e) {
|
||||
showMsgDialog(context, "Error", e.toString());
|
||||
} finally {
|
||||
setState(() {
|
||||
_isLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
114
lib/pages/shipment/shipment_confirm.dart
Normal file
114
lib/pages/shipment/shipment_confirm.dart
Normal file
@@ -0,0 +1,114 @@
|
||||
import 'package:fcs/domain/entities/shipment.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/shipment/model/shipment_model.dart';
|
||||
import 'package:fcs/pages/widgets/input_text.dart';
|
||||
import 'package:fcs/pages/widgets/local_button.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_icons/flutter_icons.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'widgets.dart';
|
||||
|
||||
class ShipmentConfirm extends StatefulWidget {
|
||||
final Shipment shipment;
|
||||
ShipmentConfirm({this.shipment});
|
||||
|
||||
@override
|
||||
_ShipmentConfirmState createState() => _ShipmentConfirmState();
|
||||
}
|
||||
|
||||
class _ShipmentConfirmState extends State<ShipmentConfirm> {
|
||||
var dateFormatter = new DateFormat('dd MMM yyyy');
|
||||
var timeFormatter = new DateFormat('jm');
|
||||
TextEditingController _handlingFee = new TextEditingController();
|
||||
|
||||
Shipment _shipment;
|
||||
bool _isLoading = false;
|
||||
var now = new DateTime.now();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
_shipment = widget.shipment;
|
||||
_handlingFee.text = _shipment.handlingFee?.toString() ?? "0";
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final shipmentNumberBox = getShipmentNumberStatus(context, _shipment);
|
||||
|
||||
final handlingFeeBox = InputText(
|
||||
labelTextKey: "shipment.handling.fee",
|
||||
controller: _handlingFee,
|
||||
iconData: FontAwesome.truck,
|
||||
);
|
||||
final confirmbtn = LocalButton(
|
||||
textKey: "shipment.confirm.btn",
|
||||
callBack: _save,
|
||||
);
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
leading: new IconButton(
|
||||
icon: new Icon(
|
||||
CupertinoIcons.back,
|
||||
color: primaryColor,
|
||||
),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
shadowColor: Colors.transparent,
|
||||
backgroundColor: Colors.white,
|
||||
title: LocalText(
|
||||
context,
|
||||
"shipment.confirm.menuitem",
|
||||
fontSize: 20,
|
||||
color: primaryColor,
|
||||
),
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: ListView(
|
||||
children: <Widget>[
|
||||
Center(child: shipmentNumberBox),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
handlingFeeBox,
|
||||
confirmbtn,
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_save() async {
|
||||
_shipment.handlingFee = double.tryParse(_handlingFee.text) ?? 0;
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
});
|
||||
try {
|
||||
ShipmentModel shipmentModel =
|
||||
Provider.of<ShipmentModel>(context, listen: false);
|
||||
await shipmentModel.confirmShipment(_shipment);
|
||||
Navigator.pop(context, true);
|
||||
} catch (e) {
|
||||
showMsgDialog(context, "Error", e.toString());
|
||||
} finally {
|
||||
setState(() {
|
||||
_isLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,11 +6,11 @@ import 'package:fcs/pages/carton/model/carton_model.dart';
|
||||
import 'package:fcs/pages/main/model/main_model.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/shipment/model/shipment_model.dart';
|
||||
import 'package:fcs/pages/shipment/shipment_pack.dart';
|
||||
import 'package:fcs/pages/widgets/defalut_delivery_address.dart';
|
||||
import 'package:fcs/pages/widgets/display_text.dart';
|
||||
import 'package:fcs/pages/widgets/fcs_id_icon.dart';
|
||||
import 'package:fcs/pages/widgets/local_button.dart';
|
||||
import 'package:fcs/pages/widgets/local_dropdown.dart';
|
||||
import 'package:fcs/pages/widgets/local_popup_menu_button.dart';
|
||||
import 'package:fcs/pages/widgets/local_popupmenu.dart';
|
||||
import 'package:fcs/pages/widgets/local_radio_buttons.dart';
|
||||
@@ -21,18 +21,20 @@ import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_icons/flutter_icons.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
import 'box_row.dart';
|
||||
import 'shipment_assign.dart';
|
||||
import 'shipment_confirm.dart';
|
||||
import 'shipment_editor.dart';
|
||||
import 'widgets.dart';
|
||||
|
||||
class ShipmentInfo extends StatefulWidget {
|
||||
final bool isCustomer;
|
||||
final Shipment shipment;
|
||||
ShipmentInfo({this.shipment});
|
||||
ShipmentInfo({this.shipment, this.isCustomer});
|
||||
|
||||
@override
|
||||
_ShipmentInfoState createState() => _ShipmentInfoState();
|
||||
@@ -62,24 +64,22 @@ class _ShipmentInfoState extends State<ShipmentInfo> {
|
||||
|
||||
Shipment _shipment;
|
||||
bool _isLoading = false;
|
||||
bool _isCustomer;
|
||||
var now = new DateTime.now();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_shipment = widget.shipment;
|
||||
_isCustomer = widget.isCustomer;
|
||||
_loadCartons(_shipment.id);
|
||||
|
||||
if (widget.shipment != null) {
|
||||
_addressEditingController.text = _shipment.address;
|
||||
_fromTimeEditingController.text = _shipment.pickupTimeStart;
|
||||
_toTimeEditingController.text = _shipment.pickupTimeEnd;
|
||||
_noOfPackageEditingController.text = _shipment.numberOfPackage.toString();
|
||||
_weightEditingController.text = _shipment.weight.toString();
|
||||
_pickupDate.text = dateFormatter.format(_shipment.pickupDate ?? now);
|
||||
// _handlingFeeController.text =
|
||||
// numberFormatter.format(_shipment.handlingFee);
|
||||
}
|
||||
_addressEditingController.text = _shipment.address;
|
||||
_fromTimeEditingController.text = _shipment.pickupTimeStart;
|
||||
_toTimeEditingController.text = _shipment.pickupTimeEnd;
|
||||
_noOfPackageEditingController.text = _shipment.numberOfPackage.toString();
|
||||
_weightEditingController.text = _shipment.weight.toString();
|
||||
_pickupDate.text = dateFormatter.format(_shipment.pickupDate ?? now);
|
||||
}
|
||||
|
||||
_loadCartons(String shipmentID) async {
|
||||
@@ -90,6 +90,16 @@ class _ShipmentInfoState extends State<ShipmentInfo> {
|
||||
});
|
||||
}
|
||||
|
||||
_loadShipment(String id) async {
|
||||
ShipmentModel shipmentModel =
|
||||
Provider.of<ShipmentModel>(context, listen: false);
|
||||
Shipment s = await shipmentModel.getShipment(id);
|
||||
s.boxes = _shipment.boxes;
|
||||
setState(() {
|
||||
_shipment = s;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
@@ -103,7 +113,56 @@ class _ShipmentInfoState extends State<ShipmentInfo> {
|
||||
bool isCourierPickup = _shipment.shipmentType == shipment_courier_pickup;
|
||||
bool isLocalDropoff = _shipment.shipmentType == shipment_local_dropoff;
|
||||
bool isCourierDropoff = _shipment.shipmentType == shipment_courier_dropoff;
|
||||
bool isEditable = widget.isCustomer
|
||||
? (_shipment.isPending || _shipment.isAssigned)
|
||||
: (_shipment.isPending || _shipment.isAssigned || _shipment.isPickuped);
|
||||
bool canCancel =
|
||||
_shipment.isPending || _shipment.isConfirmed || _shipment.isAssigned;
|
||||
|
||||
final popupMenu = LocalPopupMenuButton(
|
||||
popmenus: [
|
||||
LocalPopupMenu(
|
||||
enabled: _shipment.isPending && isLocalPickup,
|
||||
id: 1,
|
||||
textKey: "shipment.assign.for.pickup",
|
||||
),
|
||||
LocalPopupMenu(
|
||||
enabled:
|
||||
(_shipment.isPickuped && isLocalPickup) || _shipment.isReceived,
|
||||
id: 3,
|
||||
textKey: "shipment.pack.menuitem",
|
||||
),
|
||||
LocalPopupMenu(
|
||||
enabled: _shipment.isPending && (isCourierPickup || isCourierDropoff),
|
||||
id: 4,
|
||||
textKey: "shipment.confirm.menuitem",
|
||||
),
|
||||
LocalPopupMenu(
|
||||
enabled: canCancel,
|
||||
id: 2,
|
||||
textKey: "btn.cancel",
|
||||
),
|
||||
],
|
||||
selectable: false,
|
||||
buttonIcon: Icons.more_vert,
|
||||
popupMenuCallback: (p) => p.id == 1
|
||||
? _gotoAssign()
|
||||
: p.id == 2
|
||||
? _cancel()
|
||||
: p.id == 3 ? _gotoPack() : p.id == 4 ? _gotoConfirm() : null,
|
||||
);
|
||||
final popupMenuCustomer = LocalPopupMenuButton(
|
||||
popmenus: [
|
||||
LocalPopupMenu(
|
||||
enabled: canCancel,
|
||||
id: 2,
|
||||
textKey: "btn.cancel",
|
||||
),
|
||||
],
|
||||
selectable: false,
|
||||
buttonIcon: Icons.more_vert,
|
||||
popupMenuCallback: (p) => p.id == 2 ? _cancel() : null,
|
||||
);
|
||||
final shipmentNumberBox = getShipmentNumberStatus(context, _shipment);
|
||||
|
||||
final fromTimeBox = DisplayText(
|
||||
@@ -136,7 +195,7 @@ class _ShipmentInfoState extends State<ShipmentInfo> {
|
||||
onPressed: _openCourierWebsite,
|
||||
icon: Icon(Icons.open_in_new, color: primaryColor),
|
||||
label: Text(
|
||||
'Visit courier websie \nfor nearest drop-off',
|
||||
'Visit courier website \nfor nearest drop-off',
|
||||
style: TextStyle(fontSize: 16, color: primaryColor),
|
||||
),
|
||||
backgroundColor: Colors.white,
|
||||
@@ -146,14 +205,40 @@ class _ShipmentInfoState extends State<ShipmentInfo> {
|
||||
iconData: Icons.location_on,
|
||||
labelKey: "shipment.location",
|
||||
);
|
||||
var boxModel = Provider.of<CartonModel>(context);
|
||||
var usersBox = DisplayText(
|
||||
labelTextKey: "shipment.staff",
|
||||
text: _shipment.pickupUserName,
|
||||
iconData: MaterialCommunityIcons.worker);
|
||||
var handlingFeeBox = DisplayText(
|
||||
labelTextKey: "shipment.handling.fee",
|
||||
text: "10",
|
||||
iconData: FontAwesomeIcons.moneyBill);
|
||||
final cancelBtn = LocalButton(
|
||||
textKey: "btn.cancel",
|
||||
callBack: _cancel,
|
||||
text: (_shipment.handlingFee ?? 0).toString(),
|
||||
iconData: FontAwesome.truck);
|
||||
|
||||
final assignCompleteBtn = LocalButton(
|
||||
textKey: "shipment.assign.complete.btn",
|
||||
callBack: _completeAssign,
|
||||
);
|
||||
final completePickupBtn = LocalButton(
|
||||
textKey: "shipment.pickup.complete.btn",
|
||||
callBack: _pickup,
|
||||
);
|
||||
final completePackBtn = LocalButton(
|
||||
textKey: "shipment.pack.complete.btn",
|
||||
callBack: _pack,
|
||||
);
|
||||
final confirmCompleteBtn = LocalButton(
|
||||
textKey: "shipment.confirm.complete.btn",
|
||||
callBack: _confirm,
|
||||
);
|
||||
|
||||
final fcsShipmentNumberBox = DisplayText(
|
||||
text: _shipment.fcsShipmentNumber,
|
||||
labelTextKey: "FCSshipment.number",
|
||||
iconData: Ionicons.ios_airplane,
|
||||
);
|
||||
final completeReceiveBtn = LocalButton(
|
||||
textKey: "shipment.receive.complete.btn",
|
||||
callBack: _receive,
|
||||
);
|
||||
|
||||
return LocalProgress(
|
||||
@@ -178,24 +263,23 @@ class _ShipmentInfoState extends State<ShipmentInfo> {
|
||||
),
|
||||
actions: <Widget>[
|
||||
IconButton(
|
||||
icon: Icon(Icons.edit, color: primaryColor),
|
||||
onPressed: _edit,
|
||||
icon: Icon(Icons.edit,
|
||||
color: isEditable ? primaryColor : Colors.grey),
|
||||
onPressed: isEditable ? _edit : null,
|
||||
),
|
||||
widget.isCustomer ? popupMenuCustomer : popupMenu,
|
||||
]),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: ListView(
|
||||
children: <Widget>[
|
||||
shipmentNumberBox,
|
||||
|
||||
LocalTitle(textKey: "shipment.type"),
|
||||
LocalRadioButtons(
|
||||
readOnly: true,
|
||||
values: pickupModel.shipmentTypes,
|
||||
selectedValue: _shipment.shipmentType,
|
||||
),
|
||||
// handlingFeeBox,
|
||||
// shipmentTypeBox,
|
||||
...(isLocalDropoff
|
||||
? [
|
||||
LocalTitle(textKey: "shipment.location.dropoff"),
|
||||
@@ -218,17 +302,48 @@ class _ShipmentInfoState extends State<ShipmentInfo> {
|
||||
toTimeBox,
|
||||
]
|
||||
: []),
|
||||
// localDropoffAddress,
|
||||
// curierDropoffAddress,
|
||||
LocalTitle(
|
||||
textKey: "boxes.name",
|
||||
trailing: Text(
|
||||
"${_shipment.totalCount} Cartons - ${_shipment.totalWeight} lb"),
|
||||
),
|
||||
Column(
|
||||
children: getBoxList(context, _shipment.boxes),
|
||||
),
|
||||
_shipment.currentStatus == shipment_pending_status
|
||||
? cancelBtn
|
||||
: Container()
|
||||
!_isCustomer ? fcsShipmentNumberBox : Container(),
|
||||
...(_shipment.isAssigned ||
|
||||
_shipment.isConfirmed ||
|
||||
_shipment.isPending
|
||||
? [
|
||||
handlingFeeBox,
|
||||
]
|
||||
: []),
|
||||
...(isLocalPickup
|
||||
? [
|
||||
LocalTitle(textKey: "shipment.assign.for.pickup"),
|
||||
usersBox,
|
||||
]
|
||||
: []),
|
||||
...(isLocalPickup && !_isCustomer
|
||||
? [
|
||||
_shipment.isPending ? assignCompleteBtn : Container(),
|
||||
_shipment.isAssigned ? completePickupBtn : Container(),
|
||||
_shipment.isPickuped ? completePackBtn : Container(),
|
||||
]
|
||||
: []),
|
||||
...((isCourierPickup || isCourierDropoff) && !_isCustomer
|
||||
? [
|
||||
_shipment.isPending ? confirmCompleteBtn : Container(),
|
||||
_shipment.isConfirmed ? completeReceiveBtn : Container(),
|
||||
_shipment.isReceived ? completePackBtn : Container(),
|
||||
]
|
||||
: []),
|
||||
...((isLocalDropoff) && !_isCustomer
|
||||
? [
|
||||
_shipment.isPending ? completeReceiveBtn : Container(),
|
||||
_shipment.isReceived ? completePackBtn : Container(),
|
||||
]
|
||||
: []),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -256,13 +371,8 @@ class _ShipmentInfoState extends State<ShipmentInfo> {
|
||||
)),
|
||||
);
|
||||
if (updated ?? false) {
|
||||
ShipmentModel shipmentModel =
|
||||
Provider.of<ShipmentModel>(context, listen: false);
|
||||
Shipment s = await shipmentModel.getShipment(_shipment.id);
|
||||
setState(() {
|
||||
_shipment = s;
|
||||
});
|
||||
await _loadCartons(s.id);
|
||||
await _loadShipment(_shipment.id);
|
||||
await _loadCartons(_shipment.id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -294,4 +404,164 @@ class _ShipmentInfoState extends State<ShipmentInfo> {
|
||||
MainModel mainModel = Provider.of<MainModel>(context, listen: false);
|
||||
launch("${mainModel.setting.courierWebsite}");
|
||||
}
|
||||
|
||||
_gotoAssign() async {
|
||||
bool assigned = await Navigator.push<bool>(
|
||||
context,
|
||||
CupertinoPageRoute(
|
||||
builder: (context) => ShipmentAssign(
|
||||
shipment: _shipment,
|
||||
)),
|
||||
);
|
||||
if (assigned ?? false) {
|
||||
await _loadShipment(_shipment.id);
|
||||
}
|
||||
}
|
||||
|
||||
_completeAssign() {
|
||||
showConfirmDialog(context, "shipment.assign.complete.confirm", () {
|
||||
_completeAssignShipment();
|
||||
});
|
||||
}
|
||||
|
||||
_completeAssignShipment() async {
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
});
|
||||
try {
|
||||
ShipmentModel shipmentModel =
|
||||
Provider.of<ShipmentModel>(context, listen: false);
|
||||
await shipmentModel.completeAssignShipment(_shipment);
|
||||
Navigator.pop(context, true);
|
||||
} catch (e) {
|
||||
showMsgDialog(context, "Error", e.toString());
|
||||
} finally {
|
||||
setState(() {
|
||||
_isLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
_pickup() {
|
||||
showConfirmDialog(context, "shipment.pickup.complete.confirm", () {
|
||||
_pickupShipment();
|
||||
});
|
||||
}
|
||||
|
||||
_pickupShipment() async {
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
});
|
||||
try {
|
||||
ShipmentModel shipmentModel =
|
||||
Provider.of<ShipmentModel>(context, listen: false);
|
||||
await shipmentModel.completePickupShipment(_shipment);
|
||||
Navigator.pop(context, true);
|
||||
} catch (e) {
|
||||
showMsgDialog(context, "Error", e.toString());
|
||||
} finally {
|
||||
setState(() {
|
||||
_isLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
_gotoPack() async {
|
||||
bool assigned = await Navigator.push<bool>(
|
||||
context,
|
||||
CupertinoPageRoute(
|
||||
builder: (context) => ShipmentPack(
|
||||
shipment: _shipment,
|
||||
)),
|
||||
);
|
||||
if (assigned ?? false) {
|
||||
await _loadShipment(_shipment.id);
|
||||
await _loadCartons(_shipment.id);
|
||||
}
|
||||
}
|
||||
|
||||
_pack() {
|
||||
showConfirmDialog(context, "shipment.pack.complete.confirm", () {
|
||||
_packShipment();
|
||||
});
|
||||
}
|
||||
|
||||
_packShipment() async {
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
});
|
||||
try {
|
||||
ShipmentModel shipmentModel =
|
||||
Provider.of<ShipmentModel>(context, listen: false);
|
||||
await shipmentModel.completePackShipment(_shipment);
|
||||
Navigator.pop(context, true);
|
||||
} catch (e) {
|
||||
showMsgDialog(context, "Error", e.toString());
|
||||
} finally {
|
||||
setState(() {
|
||||
_isLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
_gotoConfirm() async {
|
||||
bool assigned = await Navigator.push<bool>(
|
||||
context,
|
||||
CupertinoPageRoute(
|
||||
builder: (context) => ShipmentConfirm(
|
||||
shipment: _shipment,
|
||||
)),
|
||||
);
|
||||
if (assigned ?? false) {
|
||||
await _loadShipment(_shipment.id);
|
||||
}
|
||||
}
|
||||
|
||||
_confirm() {
|
||||
showConfirmDialog(context, "shipment.confirm.complete.confirm", () {
|
||||
_confirmShipment();
|
||||
});
|
||||
}
|
||||
|
||||
_confirmShipment() async {
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
});
|
||||
try {
|
||||
ShipmentModel shipmentModel =
|
||||
Provider.of<ShipmentModel>(context, listen: false);
|
||||
await shipmentModel.completeConfirmShipment(_shipment);
|
||||
Navigator.pop(context, true);
|
||||
} catch (e) {
|
||||
showMsgDialog(context, "Error", e.toString());
|
||||
} finally {
|
||||
setState(() {
|
||||
_isLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
_receive() {
|
||||
showConfirmDialog(context, "shipment.receive.complete.confirm", () {
|
||||
_receiveShipment();
|
||||
});
|
||||
}
|
||||
|
||||
_receiveShipment() async {
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
});
|
||||
try {
|
||||
ShipmentModel shipmentModel =
|
||||
Provider.of<ShipmentModel>(context, listen: false);
|
||||
await shipmentModel.completeReceiveShipment(_shipment);
|
||||
Navigator.pop(context, true);
|
||||
} catch (e) {
|
||||
showMsgDialog(context, "Error", e.toString());
|
||||
} finally {
|
||||
setState(() {
|
||||
_isLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,10 +25,12 @@ class ShipmentList extends StatefulWidget {
|
||||
class _ShipmentListState extends State<ShipmentList> {
|
||||
bool _isLoading = false;
|
||||
var _controller = ScrollController();
|
||||
bool _forCustomer = true;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_forCustomer = widget.forCustomer;
|
||||
_controller.addListener(() async {
|
||||
if (_controller.position.pixels == _controller.position.maxScrollExtent) {
|
||||
Provider.of<ShipmentModel>(context, listen: false)
|
||||
@@ -36,7 +38,8 @@ class _ShipmentListState extends State<ShipmentList> {
|
||||
}
|
||||
});
|
||||
|
||||
Provider.of<ShipmentModel>(context, listen: false).initData(false);
|
||||
Provider.of<ShipmentModel>(context, listen: false)
|
||||
.initData(widget.forCustomer);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -48,13 +51,27 @@ class _ShipmentListState extends State<ShipmentList> {
|
||||
Widget build(BuildContext context) {
|
||||
ShipmentModel shipmentModel = Provider.of<ShipmentModel>(context);
|
||||
final popupMenu = LocalPopupMenuButton(
|
||||
popmenus: [
|
||||
LocalPopupMenu(
|
||||
id: 1, textKey: "shipment.popupmenu.active", selected: true),
|
||||
LocalPopupMenu(id: 2, textKey: "shipment.popupmenu.delivered")
|
||||
],
|
||||
popmenus: _forCustomer
|
||||
? [
|
||||
LocalPopupMenu(
|
||||
id: 1, textKey: "shipment.popupmenu.active", selected: true),
|
||||
LocalPopupMenu(id: 2, textKey: "shipment.popupmenu.delivered"),
|
||||
]
|
||||
: [
|
||||
LocalPopupMenu(
|
||||
id: 1, textKey: "shipment.popupmenu.active", selected: true),
|
||||
LocalPopupMenu(id: 2, textKey: "shipment.popupmenu.delivered"),
|
||||
LocalPopupMenu(id: 3, textKey: "shipment.popupmenu.mypickup"),
|
||||
],
|
||||
popupMenuCallback: (p) => this.setState(() {
|
||||
shipmentModel.menuSelectedIndex = p.id;
|
||||
if (p.id == 3) {
|
||||
Provider.of<ShipmentModel>(context, listen: false)
|
||||
.initData(widget.forCustomer, myPickup: true);
|
||||
} else if (p.id == 1) {
|
||||
Provider.of<ShipmentModel>(context, listen: false)
|
||||
.initData(widget.forCustomer);
|
||||
}
|
||||
}),
|
||||
);
|
||||
return LocalProgress(
|
||||
@@ -72,18 +89,20 @@ class _ShipmentListState extends State<ShipmentList> {
|
||||
title: LocalText(context, "shipment",
|
||||
fontSize: 18, color: Colors.white),
|
||||
actions: <Widget>[
|
||||
IconButton(
|
||||
icon: Icon(
|
||||
Icons.search,
|
||||
color: Colors.white,
|
||||
),
|
||||
iconSize: 30,
|
||||
// onPressed: () => showPlacesSearch(context),
|
||||
),
|
||||
widget.forCustomer
|
||||
? Container()
|
||||
: IconButton(
|
||||
icon: Icon(
|
||||
Icons.search,
|
||||
color: Colors.white,
|
||||
),
|
||||
iconSize: 30,
|
||||
// onPressed: () => showPlacesSearch(context),
|
||||
),
|
||||
popupMenu
|
||||
],
|
||||
),
|
||||
floatingActionButton: shipmentModel.menuSelectedIndex == 1
|
||||
floatingActionButton: widget.forCustomer
|
||||
? FloatingActionButton.extended(
|
||||
onPressed: () {
|
||||
_newPickup();
|
||||
@@ -108,8 +127,10 @@ class _ShipmentListState extends State<ShipmentList> {
|
||||
itemCount: shipmentModel.shipments.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return ShipmentListRow(
|
||||
key: ValueKey(shipmentModel.shipments[index].id),
|
||||
pickUp: shipmentModel.shipments[index]);
|
||||
key: ValueKey(shipmentModel.shipments[index].id),
|
||||
pickUp: shipmentModel.shipments[index],
|
||||
isCustomer: widget.forCustomer,
|
||||
);
|
||||
}),
|
||||
onRefresh: () =>
|
||||
shipmentModel.refresh(isCustomer: widget.forCustomer),
|
||||
|
||||
@@ -9,14 +9,19 @@ import 'shipment_info.dart';
|
||||
|
||||
class ShipmentListRow extends StatelessWidget {
|
||||
final Shipment pickUp;
|
||||
const ShipmentListRow({Key key, this.pickUp}) : super(key: key);
|
||||
final bool isCustomer;
|
||||
const ShipmentListRow({Key key, this.pickUp, this.isCustomer})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
Navigator.of(context).push(CupertinoPageRoute(
|
||||
builder: (context) => ShipmentInfo(shipment: pickUp)));
|
||||
builder: (context) => ShipmentInfo(
|
||||
shipment: pickUp,
|
||||
isCustomer: isCustomer,
|
||||
)));
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(left: 15, right: 15),
|
||||
@@ -46,7 +51,7 @@ class ShipmentListRow extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 10.0, top: 10),
|
||||
padding: const EdgeInsets.only(left: 10.0, top: 3),
|
||||
child: new Text(
|
||||
pickUp.id == null
|
||||
? ''
|
||||
@@ -66,29 +71,25 @@ class ShipmentListRow extends StatelessWidget {
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(0),
|
||||
child: getStatus(pickUp.currentStatus),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8.0, top: 5, bottom: 5),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
new Text(
|
||||
pickUp.weight == null
|
||||
? ''
|
||||
: pickUp.weight.toString() + 'lb - ',
|
||||
style:
|
||||
new TextStyle(fontSize: 15.0, color: Colors.grey),
|
||||
),
|
||||
new Text(
|
||||
pickUp.numberOfPackage == null
|
||||
? ""
|
||||
: pickUp.numberOfPackage.toString() + ' packages',
|
||||
style:
|
||||
new TextStyle(fontSize: 15.0, color: Colors.grey),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: getStatus(pickUp.status),
|
||||
),
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.only(left: 8.0, top: 5, bottom: 5),
|
||||
// child: Row(
|
||||
// children: <Widget>[
|
||||
// new Text(
|
||||
// "(${pickUp.totalWeight ?? "0"}) lb ",
|
||||
// style:
|
||||
// new TextStyle(fontSize: 15.0, color: Colors.grey),
|
||||
// ),
|
||||
// new Text(
|
||||
// "(${pickUp.totalCount ?? "0"}) cartons ",
|
||||
// style:
|
||||
// new TextStyle(fontSize: 15.0, color: Colors.grey),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
)
|
||||
],
|
||||
|
||||
140
lib/pages/shipment/shipment_pack.dart
Normal file
140
lib/pages/shipment/shipment_pack.dart
Normal file
@@ -0,0 +1,140 @@
|
||||
import 'package:fcs/domain/entities/fcs_shipment.dart';
|
||||
import 'package:fcs/domain/entities/shipment.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/fcs_shipment/model/fcs_shipment_model.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/shipment/model/shipment_model.dart';
|
||||
import 'package:fcs/pages/widgets/local_button.dart';
|
||||
import 'package:fcs/pages/widgets/local_dropdown.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:fcs/pages/widgets/local_title.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_icons/flutter_icons.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'widgets.dart';
|
||||
|
||||
class ShipmentPack extends StatefulWidget {
|
||||
final Shipment shipment;
|
||||
ShipmentPack({this.shipment});
|
||||
|
||||
@override
|
||||
_ShipmentPackState createState() => _ShipmentPackState();
|
||||
}
|
||||
|
||||
class _ShipmentPackState extends State<ShipmentPack> {
|
||||
var dateFormatter = new DateFormat('dd MMM yyyy');
|
||||
var timeFormatter = new DateFormat('jm');
|
||||
|
||||
Shipment _shipment;
|
||||
bool _isLoading = false;
|
||||
var now = new DateTime.now();
|
||||
|
||||
FcsShipment _fcsShipment;
|
||||
List<FcsShipment> _fcsShipments;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
_shipment = widget.shipment;
|
||||
_loadFcsShipments();
|
||||
}
|
||||
|
||||
_loadFcsShipments() async {
|
||||
FcsShipmentModel fcsShipmentModel =
|
||||
Provider.of<FcsShipmentModel>(context, listen: false);
|
||||
var fcsShipments = await fcsShipmentModel.getActiveFcsShipments();
|
||||
var fcsShipment = fcsShipments
|
||||
.firstWhere((e) => e.id == _shipment.fcsShipmentID, orElse: () => null);
|
||||
setState(() {
|
||||
_fcsShipments = fcsShipments;
|
||||
_fcsShipment = fcsShipment;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final shipmentNumberBox = getShipmentNumberStatus(context, _shipment);
|
||||
|
||||
var fcsShipmentsBox = LocalDropdown<FcsShipment>(
|
||||
callback: (v) {
|
||||
setState(() {
|
||||
_fcsShipment = v;
|
||||
});
|
||||
},
|
||||
labelKey: "shipment.pack.fcs.shipment",
|
||||
iconData: MaterialCommunityIcons.worker,
|
||||
display: (u) => u.shipmentNumber,
|
||||
selectedValue: _fcsShipment,
|
||||
values: _fcsShipments,
|
||||
);
|
||||
|
||||
final packbtn = LocalButton(
|
||||
textKey: "shipment.pack.btn",
|
||||
callBack: _save,
|
||||
);
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
leading: new IconButton(
|
||||
icon: new Icon(
|
||||
CupertinoIcons.back,
|
||||
color: primaryColor,
|
||||
),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
shadowColor: Colors.transparent,
|
||||
backgroundColor: Colors.white,
|
||||
title: LocalText(
|
||||
context,
|
||||
"shipment.pack.menuitem",
|
||||
fontSize: 20,
|
||||
color: primaryColor,
|
||||
),
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: ListView(
|
||||
children: <Widget>[
|
||||
Center(child: shipmentNumberBox),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
LocalTitle(textKey: "shipment.pack.fcs.shipment"),
|
||||
fcsShipmentsBox,
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
packbtn,
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_save() async {
|
||||
_shipment.fcsShipmentID = this._fcsShipment.id;
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
});
|
||||
try {
|
||||
ShipmentModel shipmentModel =
|
||||
Provider.of<ShipmentModel>(context, listen: false);
|
||||
await shipmentModel.packShipment(_shipment);
|
||||
Navigator.pop(context, true);
|
||||
} catch (e) {
|
||||
showMsgDialog(context, "Error", e.toString());
|
||||
} finally {
|
||||
setState(() {
|
||||
_isLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
import 'package:fcs/domain/entities/shipment.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/widgets/local_popup_menu_button.dart';
|
||||
import 'package:fcs/pages/widgets/local_popupmenu.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
@@ -17,7 +19,7 @@ Widget getShipmentNumberStatus(BuildContext context, Shipment shipment) {
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8.0),
|
||||
child: Chip(label: Text(shipment.currentStatus ?? "")),
|
||||
child: Chip(label: Text(shipment.status ?? "")),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user