# DecoratedContentListBloc constructor Null safety

DecoratedContentListBloc(

1. {FilterDecoratedContentModels? filter,
2. bool? paged,
3. String? orderBy,
4. bool? descending,
5. bool? detailed,
6. EliudQuery? eliudQuery,
7. required DecoratedContentRepository decoratedContentRepository,
8. int decoratedContentLimit = 5}

)

## Implementation

    DecoratedContentListBloc(
        {this.filter,
        this.paged,
        this.orderBy,
        this.descending,
        this.detailed,
        this.eliudQuery,
        required DecoratedContentRepository decoratedContentRepository,
        this.decoratedContentLimit = 5})
        : _decoratedContentRepository = decoratedContentRepository,
          super(DecoratedContentListLoading()) {
      on<LoadDecoratedContentList>((event, emit) {
        if ((detailed == null) || (!detailed!)) {
          _mapLoadDecoratedContentListToState();
        } else {
          _mapLoadDecoratedContentListWithDetailsToState();
        }
      });

      on<NewPage>((event, emit) {
        pages = pages +
            1; // it doesn't matter so much if we increase pages beyond the end
        _mapLoadDecoratedContentListWithDetailsToState();
      });

      on<DecoratedContentChangeQuery>((event, emit) {
        eliudQuery = event.newQuery;
        if ((detailed == null) || (!detailed!)) {
          _mapLoadDecoratedContentListToState();
        } else {
          _mapLoadDecoratedContentListWithDetailsToState();
        }
      });

      on<AddDecoratedContentList>((event, emit) async {
        await _mapAddDecoratedContentListToState(event);
      });

      on<UpdateDecoratedContentList>((event, emit) async {
        await _mapUpdateDecoratedContentListToState(event);
      });

      on<DeleteDecoratedContentList>((event, emit) async {
        await _mapDeleteDecoratedContentListToState(event);
      });

      on<DecoratedContentListUpdated>((event, emit) {
        emit(_mapDecoratedContentListUpdatedToState(event));
      });
    }