# SimpleImageListBloc constructor Null safety

SimpleImageListBloc(

1. {FilterSimpleImageModels? filter,
2. bool? paged,
3. String? orderBy,
4. bool? descending,
5. bool? detailed,
6. EliudQuery? eliudQuery,
7. required SimpleImageRepository simpleImageRepository,
8. int simpleImageLimit = 5}

)

## Implementation

    SimpleImageListBloc(
        {this.filter,
        this.paged,
        this.orderBy,
        this.descending,
        this.detailed,
        this.eliudQuery,
        required SimpleImageRepository simpleImageRepository,
        this.simpleImageLimit = 5})
        : _simpleImageRepository = simpleImageRepository,
          super(SimpleImageListLoading()) {
      on<LoadSimpleImageList>((event, emit) {
        if ((detailed == null) || (!detailed!)) {
          _mapLoadSimpleImageListToState();
        } else {
          _mapLoadSimpleImageListWithDetailsToState();
        }
      });

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

      on<SimpleImageChangeQuery>((event, emit) {
        eliudQuery = event.newQuery;
        if ((detailed == null) || (!detailed!)) {
          _mapLoadSimpleImageListToState();
        } else {
          _mapLoadSimpleImageListWithDetailsToState();
        }
      });

      on<AddSimpleImageList>((event, emit) async {
        await _mapAddSimpleImageListToState(event);
      });

      on<UpdateSimpleImageList>((event, emit) async {
        await _mapUpdateSimpleImageListToState(event);
      });

      on<DeleteSimpleImageList>((event, emit) async {
        await _mapDeleteSimpleImageListToState(event);
      });

      on<SimpleImageListUpdated>((event, emit) {
        emit(_mapSimpleImageListUpdatedToState(event));
      });
    }