I am trying to implement bloc pattern in rxdart . I am trying to build todo app type of app . I implemented showing all items in list but what I want is not to show completed and uncompleted items in different part . However I am not able to filter the items based on completed on rxdart .
import 'package:rxdart/rxdart.dart';
import '../models/ShoppingItem.dart';
class ShoppingItemBloc {
final _shoppingItems = BehaviorSubject<List<ShoppingItem>>
(seedValue: []);
Observable<List<ShoppingItem>> get allShoppingItems =>
_shoppingItems.stream;
//Getter to implement
Observable<List<ShoppingItem>> get completedShoppingItems =>
dispose() {
_shoppingItems.close();
}
}
What I wanted is to get the completed shoppingItems . The class ShoppingItem has a boolean property completed . I wanted to filter it on that basis .
Any help would be appricated thanks