buypeeb-mobile/lib/models/user_listings.dart

24 lines
559 B
Dart
Raw Normal View History

import 'dart:collection';
import 'package:buyeeb_mobile/models/yahoo_auctions_item.dart';
import 'package:flutter/foundation.dart';
class UserListings extends ChangeNotifier {
final List<YahooAuctionsItem> _items = [];
UnmodifiableListView<YahooAuctionsItem> get items => UnmodifiableListView(_items);
void add (YahooAuctionsItem item) {
_items.add(item);
notifyListeners();
}
void remove(YahooAuctionsItem item) {
_items.remove(item);
notifyListeners();
}
void removeAll() {
_items.clear();
notifyListeners();
}
}