import 'package:flutter/material.dart'; import 'package:provider_state/model/products.dart'; class CardProvider extends ChangeNotifier { int count = 0; List localStorage = []; bool get isLocal => localStorage.isNotEmpty; void increase() { count++; notifyListeners(); } void addCard(ProductModel data) { if (data.select != true) { data.setSelected(); localStorage.add(data); notifyListeners(); } else { data.setSelected(); localStorage.remove(data); notifyListeners(); } } }