buypeeb-mobile/lib/models/user_listings.dart

25 lines
622 B
Dart
Raw Normal View History

import 'dart:collection';
2020-09-30 07:36:51 +00:00
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();
}
}