buypeeb-mobile/lib/models/user_listings.dart
Lynnesbian caf0d03e3b
a lot of boo things
- split app into separate pages/routes
- put models in their own folder
- use provider to sync state between pages
- generate a preset list of items instead of an infinite amount
- added a splash screen
2020-09-30 11:45:57 +10:00

24 lines
No EOL
559 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 = [];
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();
}
}