You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
736B

  1. import 'package:farm_tpf/custom_model/Supply.dart';
  2. import 'package:get/get.dart';
  3. class ChangeSupply extends GetxController {
  4. Supply currentSupply;
  5. int selectedSupplyId;
  6. String selectedSupplyName;
  7. String unit;
  8. void initValue() {
  9. currentSupply = Supply();
  10. selectedSupplyName = "";
  11. selectedSupplyId = -1;
  12. unit = "";
  13. update();
  14. }
  15. void change(Supply supply) {
  16. currentSupply = supply;
  17. selectedSupplyId = supply.id;
  18. selectedSupplyName = supply.tbSuppliesName;
  19. unit = supply.unit;
  20. update();
  21. }
  22. void changeByIdAndName(int supplyId, String supplyName, {String unitName}) {
  23. selectedSupplyId = supplyId;
  24. selectedSupplyName = supplyName;
  25. unit = unitName;
  26. update();
  27. }
  28. }