fix
This commit is contained in:
@@ -23,16 +23,19 @@ class _DiscountByWeightEditorState extends State<DiscountByWeightEditor> {
|
||||
TextEditingController _discountController = new TextEditingController();
|
||||
|
||||
bool _isLoading = false;
|
||||
bool _isNew = false;
|
||||
bool _isNew;
|
||||
DiscountByWeight _discountByWeight = new DiscountByWeight();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
if (widget.discountByWeight != null) {
|
||||
_discountByWeight = widget.discountByWeight;
|
||||
_discountByWeight = widget.discountByWeight;
|
||||
_weightController.text = _discountByWeight.weight.toString();
|
||||
_discountController.text = _discountByWeight.discount.toString();
|
||||
_isNew = false;
|
||||
} else {
|
||||
_isNew = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,7 +134,8 @@ class _DiscountByWeightEditorState extends State<DiscountByWeightEditor> {
|
||||
try {
|
||||
var shipmentRateModel =
|
||||
Provider.of<ShipmentRateModel>(context, listen: false);
|
||||
await shipmentRateModel.deleteDiscountByWeight(widget.discountByWeight.id);
|
||||
await shipmentRateModel
|
||||
.deleteDiscountByWeight(widget.discountByWeight.id);
|
||||
Navigator.pop(context);
|
||||
} catch (e) {
|
||||
showMsgDialog(context, "Error", e.toString());
|
||||
|
||||
Reference in New Issue
Block a user