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.

28 lines
597B

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