25 lines
No EOL
622 B
Dart
25 lines
No EOL
622 B
Dart
import 'dart:collection';
|
|
import 'package:buypeeb_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();
|
|
}
|
|
} |