update pin editor

This commit is contained in:
tzw
2024-02-21 17:05:20 +06:30
parent 968a42362a
commit c77874d72c
9 changed files with 199 additions and 51 deletions

View File

@@ -150,10 +150,12 @@ class _FcsShipmentEditorState extends State<FcsShipmentEditor> {
return null;
},
),
const SizedBox(height: 20),
DropdownButtonFormField(
value:
_currentShipmentType == "" ? null : _currentShipmentType,
decoration: InputDecoration(
contentPadding: EdgeInsets.zero,
enabledBorder: UnderlineInputBorder(
borderSide: BorderSide(color: primaryColor)),
focusedBorder: UnderlineInputBorder(
@@ -175,6 +177,7 @@ class _FcsShipmentEditorState extends State<FcsShipmentEditor> {
})
},
),
const SizedBox(height: 5),
InputText(
labelTextKey: 'FCSshipment.consignee',
iconData: Icons.work,

View File

@@ -135,21 +135,21 @@ class _FcsShipmentInfoState extends State<FcsShipmentInfo> {
padding: const EdgeInsets.symmetric(horizontal: 30),
child: LocalButton(
textKey: "FCSshipment.process.btn",
callBack: _ship,
callBack: () {},
),
);
final arriveBtn = Padding(
padding: const EdgeInsets.symmetric(horizontal: 30),
child: LocalButton(
textKey: "FCSshipment.arrive.btn",
callBack: _ship,
callBack: () {},
),
);
final invoiceBtn = Padding(
padding: const EdgeInsets.symmetric(horizontal: 30),
child: LocalButton(
textKey: "FCSshipment.invoice.btn",
callBack: _ship,
callBack: () {},
),
);
@@ -226,9 +226,7 @@ class _FcsShipmentInfoState extends State<FcsShipmentInfo> {
_fcsShipment?.status == fcs_shipment_arrived_status
? invoiceBtn
: Container(),
SizedBox(
height: 20,
)
SizedBox(height: 20)
]),
),
),
@@ -296,7 +294,7 @@ class _FcsShipmentInfoState extends State<FcsShipmentInfo> {
try {
FcsShipmentModel fcsShipmentModel =
Provider.of<FcsShipmentModel>(context, listen: false);
await fcsShipmentModel.ship(_fcsShipment!);
await fcsShipmentModel.ship(_fcsShipment!.id!);
Navigator.pop(context, true);
} catch (e) {
showMsgDialog(context, "Error", e.toString());

View File

@@ -147,8 +147,20 @@ class FcsShipmentModel extends BaseModel {
return Services.instance.fcsShipmentService.updateFcsShipment(fcsShipment);
}
Future<void> ship(FcsShipment fcsShipment) {
return Services.instance.fcsShipmentService.ship(fcsShipment);
Future<void> process(String id) {
return Services.instance.fcsShipmentService.processFcsShipment(id);
}
Future<void> ship(String id) {
return Services.instance.fcsShipmentService.shipFcsShipment(id);
}
Future<void> arrive(String id) {
return Services.instance.fcsShipmentService.arriveFcsShipment(id);
}
Future<void> invoice(String id) {
return Services.instance.fcsShipmentService.invoiceFcsShipment(id);
}
Future<String> report(FcsShipment fcsShipment) {