buypeeb-mobile/lib/models/user_listings.dart

25 lines
No EOL
621 B
Dart

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 = [];
final Map<String, YahooAuctionsItem> _items = {};
UnmodifiableMapView<String, YahooAuctionsItem> get items => UnmodifiableMapView(_items);
void add (String key, YahooAuctionsItem item) {
_items[key] = item;
notifyListeners();
}
void remove(String key) {
_items.remove(key);
notifyListeners();
}
void removeAll() {
_items.clear();
notifyListeners();
}
}