# FaderListBloc constructor Null safety

FaderListBloc(

1. {FilterFaderModels? filter,
2. bool? paged,
3. String? orderBy,
4. bool? descending,
5. bool? detailed,
6. EliudQuery? eliudQuery,
7. required FaderRepository faderRepository,
8. int faderLimit = 5}

)

## Implementation

    FaderListBloc(
        {this.filter,
        this.paged,
        this.orderBy,
        this.descending,
        this.detailed,
        this.eliudQuery,
        required FaderRepository faderRepository,
        this.faderLimit = 5})
        : _faderRepository = faderRepository,
          super(FaderListLoading()) {
      on<LoadFaderList>((event, emit) {
        if ((detailed == null) || (!detailed!)) {
          _mapLoadFaderListToState();
        } else {
          _mapLoadFaderListWithDetailsToState();
        }
      });

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

      on<FaderChangeQuery>((event, emit) {
        eliudQuery = event.newQuery;
        if ((detailed == null) || (!detailed!)) {
          _mapLoadFaderListToState();
        } else {
          _mapLoadFaderListWithDetailsToState();
        }
      });

      on<AddFaderList>((event, emit) async {
        await _mapAddFaderListToState(event);
      });

      on<UpdateFaderList>((event, emit) async {
        await _mapUpdateFaderListToState(event);
      });

      on<DeleteFaderList>((event, emit) async {
        await _mapDeleteFaderListToState(event);
      });

      on<FaderListUpdated>((event, emit) {
        emit(_mapFaderListUpdatedToState(event));
      });
    }