Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Data with ChangeNotifier {
- bool successDrop;
- List<CardItem> items;
- CardItem acceptedData;
- Data() {
- successDrop = false;
- items = Constants.initializeList(items);
- }
- bool get isSuccessDrop => successDrop;
- List<CardItem> get itemsList => items;
- CardItem get getAcceptedData => acceptedData;
- set setSuccessDrop(bool status) {
- successDrop = status;
- notifyListeners();
- }
- changeAcceptedData(CardItem data) {
- acceptedData = data;
- notifyListeners();
- }
- changeSuccessDrop(bool status) {
- setSuccessDrop = status;
- }
- removeLastItem() {
- items.removeLast();
- notifyListeners();
- }
- addItemToList(CardItem item) {
- items.add(item);
- notifyListeners();
- }
- initializeDraggableList() {
- items = Constants.initializeList(items);
- notifyListeners();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement