import 'package:nour_dev/models/course/course.dart'; import 'package:nour_dev/models/order/order.dart'; import 'package:nour_dev/models/user/customer.dart'; class CustomerController{ Customer customer; CustomerController(this.customer); void addToOrders(Order order){ this.customer.history.add(order); } void addToWatchlist(Course course){ this.customer.watchList.add(course); } bool orderInHystory(Order order){ return this.customer.history.contains(order); } bool courseInwatchlist(Course course){ return this.customer.watchList.contains(course); } bool removeCourseFromWatchlist(Course course){ if(courseInwatchlist(course)){ return this.customer.watchList.remove(course);} else print ('course doesnt exist'); } }