update ui
This commit is contained in:
@@ -147,19 +147,15 @@ class _PackageEditorState extends State<PackageEditor> {
|
||||
),
|
||||
img,
|
||||
Divider(),
|
||||
SizedBox(
|
||||
height: 15,
|
||||
),
|
||||
SizedBox(height: 15),
|
||||
marketDropdown(),
|
||||
SizedBox(height: 5),
|
||||
descBox,
|
||||
SizedBox(height: 5),
|
||||
remarkBox,
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
SizedBox(height: 20),
|
||||
selectBtn,
|
||||
SizedBox(
|
||||
height: 20,
|
||||
)
|
||||
SizedBox(height: 20)
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -179,7 +175,7 @@ class _PackageEditorState extends State<PackageEditor> {
|
||||
return Row(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 0, right: 10),
|
||||
padding: const EdgeInsets.only(right: 15),
|
||||
child: Icon(Icons.store, color: primaryColor),
|
||||
),
|
||||
Expanded(
|
||||
@@ -199,10 +195,7 @@ class _PackageEditorState extends State<PackageEditor> {
|
||||
isDense: true,
|
||||
value: selectedMarket,
|
||||
style: TextStyle(color: Colors.black, fontSize: 14),
|
||||
underline: Container(
|
||||
height: 1,
|
||||
color: Colors.grey,
|
||||
),
|
||||
underline: Container(height: 1, color: primaryColor),
|
||||
onChanged: (String? newValue) {
|
||||
setState(() {
|
||||
if (newValue == MANAGE_MARKET) {
|
||||
@@ -222,7 +215,7 @@ class _PackageEditorState extends State<PackageEditor> {
|
||||
style: TextStyle(
|
||||
color: value == MANAGE_MARKET
|
||||
? secondaryColor
|
||||
: primaryColor)),
|
||||
: Colors.black)),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
|
||||
@@ -36,8 +36,8 @@ class ProcessingEditEditor extends StatefulWidget {
|
||||
class _ProcessingEditEditorState extends State<ProcessingEditEditor> {
|
||||
final DateFormat dateFormat = DateFormat("d MMM yyyy");
|
||||
|
||||
TextEditingController _remarkCtl = TextEditingController();
|
||||
TextEditingController _descCtl = TextEditingController();
|
||||
final TextEditingController _remarkCtl = TextEditingController();
|
||||
final TextEditingController _descCtl = TextEditingController();
|
||||
|
||||
Package? _package;
|
||||
User? _consignee;
|
||||
@@ -72,9 +72,10 @@ class _ProcessingEditEditorState extends State<ProcessingEditEditor> {
|
||||
var fcsShipments =
|
||||
await context.read<FcsShipmentModel>().getActiveFcsShipments();
|
||||
_shipments = fcsShipments;
|
||||
|
||||
|
||||
var s = FcsShipment(
|
||||
id: widget.package.fcsShipmentId, shipmentNumber: widget.package.fcsShipmentNumber);
|
||||
id: widget.package.fcsShipmentId,
|
||||
shipmentNumber: widget.package.fcsShipmentNumber);
|
||||
|
||||
if (_shipments.contains(s)) {
|
||||
_shipment = s;
|
||||
@@ -183,10 +184,13 @@ class _ProcessingEditEditorState extends State<ProcessingEditEditor> {
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
fcsShipmentsBox,
|
||||
SizedBox(height: 10),
|
||||
marketDropdown(),
|
||||
SizedBox(height: 5),
|
||||
descBox,
|
||||
SizedBox(height: 5),
|
||||
remarkBox,
|
||||
const SizedBox(height: 10),
|
||||
const SizedBox(height: 15),
|
||||
img,
|
||||
SizedBox(height: 20),
|
||||
completeProcessingBtn,
|
||||
@@ -207,63 +211,57 @@ class _ProcessingEditEditorState extends State<ProcessingEditEditor> {
|
||||
markets.insert(0, selectedMarket);
|
||||
}
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(left: 5.0, right: 0, top: 10),
|
||||
child: Row(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 0, right: 10),
|
||||
child: Icon(Icons.store, color: primaryColor),
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 18.0),
|
||||
child: LocalText(
|
||||
context,
|
||||
"processing.market",
|
||||
color: Colors.black54,
|
||||
fontSize: 16,
|
||||
),
|
||||
return Row(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 0, right: 15),
|
||||
child: Icon(Icons.store, color: primaryColor),
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 18.0),
|
||||
child: LocalText(
|
||||
context,
|
||||
"processing.market",
|
||||
color: Colors.black54,
|
||||
fontSize: 16,
|
||||
),
|
||||
DropdownButton<String>(
|
||||
isDense: true,
|
||||
value: selectedMarket,
|
||||
style: TextStyle(color: Colors.black, fontSize: 14),
|
||||
underline: Container(
|
||||
height: 1,
|
||||
color: Colors.grey,
|
||||
),
|
||||
onChanged: (String? newValue) {
|
||||
setState(() {
|
||||
if (newValue == MANAGE_MARKET) {
|
||||
selectedMarket = null;
|
||||
_manageMarket();
|
||||
return;
|
||||
}
|
||||
selectedMarket = newValue;
|
||||
});
|
||||
},
|
||||
isExpanded: true,
|
||||
items: markets.map<DropdownMenuItem<String>>((String? value) {
|
||||
return DropdownMenuItem<String>(
|
||||
value: value,
|
||||
child: Text(value ?? "",
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
color: value == MANAGE_MARKET
|
||||
? secondaryColor
|
||||
: primaryColor)),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
DropdownButton<String>(
|
||||
isDense: true,
|
||||
value: selectedMarket,
|
||||
style: TextStyle(color: Colors.black, fontSize: 14),
|
||||
underline: Container(height: 1, color: primaryColor),
|
||||
onChanged: (String? newValue) {
|
||||
setState(() {
|
||||
if (newValue == MANAGE_MARKET) {
|
||||
selectedMarket = null;
|
||||
_manageMarket();
|
||||
return;
|
||||
}
|
||||
selectedMarket = newValue;
|
||||
});
|
||||
},
|
||||
isExpanded: true,
|
||||
items: markets.map<DropdownMenuItem<String>>((String? value) {
|
||||
return DropdownMenuItem<String>(
|
||||
value: value,
|
||||
child: Text(value ?? "",
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
color: value == MANAGE_MARKET
|
||||
? secondaryColor
|
||||
: Colors.black)),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -293,7 +291,7 @@ class _ProcessingEditEditorState extends State<ProcessingEditEditor> {
|
||||
_package!.fcsShipmentId = _shipment?.id;
|
||||
await packageModel.updateProcessing(_package!,
|
||||
multiImgController.getAddedFile, multiImgController.getDeletedUrl);
|
||||
Navigator.pop(context,true);
|
||||
Navigator.pop(context, true);
|
||||
} catch (e) {
|
||||
showMsgDialog(context, "Error", e.toString());
|
||||
} finally {
|
||||
@@ -311,7 +309,7 @@ class _ProcessingEditEditorState extends State<ProcessingEditEditor> {
|
||||
desc: _descCtl.text,
|
||||
remark: _remarkCtl.text,
|
||||
photoUrls: widget.package.photoUrls,
|
||||
fcsShipmentId: _shipment?.id);
|
||||
fcsShipmentId: _shipment?.id ?? "");
|
||||
return widget.package.isChangedForEditProcessing(package) ||
|
||||
multiImgController.getAddedFile.isNotEmpty ||
|
||||
multiImgController.getDeletedUrl.isNotEmpty;
|
||||
|
||||
Reference in New Issue
Block a user