Lynnesbian
caf0d03e3b
- 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
24 lines
No EOL
559 B
Dart
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();
|
|
}
|
|
} |