add carton editor to update
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
// ignore_for_file: deprecated_member_use
|
||||
|
||||
import 'package:fcs/pages/fcs_shipment/model/fcs_shipment_model.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
@@ -50,10 +51,26 @@ class _MixCartonEditorState extends State<MixCartonEditor> {
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
context.read<CartonSelectionModel>().clearSelection();
|
||||
_init();
|
||||
super.initState();
|
||||
}
|
||||
|
||||
_init() async {
|
||||
var s = await context
|
||||
.read<FcsShipmentModel>()
|
||||
.getFcsShipment(widget.carton.fcsShipmentID ?? "");
|
||||
_shipment = s;
|
||||
_cartonSizeType = customCarton;
|
||||
_length = widget.carton.length;
|
||||
_width = widget.carton.width;
|
||||
_height = widget.carton.height;
|
||||
|
||||
context.read<CartonSelectionModel>().clearSelection();
|
||||
if (mounted) {
|
||||
setState(() {});
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return WillPopScope(
|
||||
@@ -90,7 +107,7 @@ class _MixCartonEditorState extends State<MixCartonEditor> {
|
||||
},
|
||||
),
|
||||
backgroundColor: Colors.white,
|
||||
title: LocalText(context, 'boxes.new',
|
||||
title: LocalText(context, 'box.update_title',
|
||||
color: primaryColor, fontSize: 20),
|
||||
),
|
||||
body: Column(
|
||||
@@ -163,6 +180,7 @@ class _MixCartonEditorState extends State<MixCartonEditor> {
|
||||
} else {
|
||||
return Expanded(
|
||||
child: MixCartonSubmit(
|
||||
isNew: false,
|
||||
cartonSizeType: _cartonSizeType,
|
||||
standardSize: _standardSize,
|
||||
length: _length,
|
||||
@@ -171,7 +189,7 @@ class _MixCartonEditorState extends State<MixCartonEditor> {
|
||||
shipment: _shipment!,
|
||||
cartons: _cartons,
|
||||
onCreate: () {
|
||||
_create();
|
||||
_update();
|
||||
},
|
||||
onPrevious: () {
|
||||
setState(() {
|
||||
@@ -183,7 +201,7 @@ class _MixCartonEditorState extends State<MixCartonEditor> {
|
||||
}
|
||||
}
|
||||
|
||||
_create() async {
|
||||
_update() async {
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user