Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. class Data with ChangeNotifier {
  2. bool successDrop;
  3. List<CardItem> items;
  4. CardItem acceptedData;
  5.  
  6. Data() {
  7. successDrop = false;
  8.  
  9. items = Constants.initializeList(items);
  10. }
  11.  
  12. bool get isSuccessDrop => successDrop;
  13. List<CardItem> get itemsList => items;
  14. CardItem get getAcceptedData => acceptedData;
  15.  
  16. set setSuccessDrop(bool status) {
  17. successDrop = status;
  18. notifyListeners();
  19. }
  20.  
  21. changeAcceptedData(CardItem data) {
  22. acceptedData = data;
  23. notifyListeners();
  24. }
  25.  
  26. changeSuccessDrop(bool status) {
  27. setSuccessDrop = status;
  28. }
  29.  
  30. removeLastItem() {
  31. items.removeLast();
  32. notifyListeners();
  33. }
  34.  
  35. addItemToList(CardItem item) {
  36. items.add(item);
  37. notifyListeners();
  38. }
  39.  
  40. initializeDraggableList() {
  41. items = Constants.initializeList(items);
  42. notifyListeners();
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement