update carton form ,info and filter

This commit is contained in:
tzw
2024-10-01 18:15:53 +06:30
parent 02e079c514
commit 41fdc3ef43
13 changed files with 123 additions and 109 deletions

View File

@@ -84,12 +84,12 @@ class _CargoEditorState extends State<CargoEditor> {
controller: _displayIndexController,
textInputType: TextInputType.number,
autovalidateMode: AutovalidateMode.onUserInteraction,
validator: (value) {
if (value == null || value.isEmpty) {
return "Please insert display index";
}
return null;
},
// validator: (value) {
// if (value == null || value.isEmpty) {
// return "Please insert display index";
// }
// return null;
// },
);
final defaultBox = Padding(
@@ -189,7 +189,9 @@ class _CargoEditorState extends State<CargoEditor> {
CargoType _cargo = CargoType(
name: _descController.text,
rate: double.parse(_rateController.text),
displayIndex: int.parse(_displayIndexController.text),
displayIndex: _displayIndexController.text == ''
? 0
: int.parse(_displayIndexController.text),
isDefault: _isDefault);
if (_isNew) {
await shipmentRateModel.addCargoType(_cargo);