# LinkListBloc constructor Null safety

LinkListBloc(

1. {FilterLinkModels? filter,
2. bool? paged,
3. String? orderBy,
4. bool? descending,
5. bool? detailed,
6. EliudQuery? eliudQuery,
7. required LinkRepository linkRepository,
8. int linkLimit = 5}

)

## Implementation

    LinkListBloc(
        {this.filter,
        this.paged,
        this.orderBy,
        this.descending,
        this.detailed,
        this.eliudQuery,
        required LinkRepository linkRepository,
        this.linkLimit = 5})
        : _linkRepository = linkRepository,
          super(LinkListLoading()) {
      on<LoadLinkList>((event, emit) {
        if ((detailed == null) || (!detailed!)) {
          _mapLoadLinkListToState();
        } else {
          _mapLoadLinkListWithDetailsToState();
        }
      });

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

      on<LinkChangeQuery>((event, emit) {
        eliudQuery = event.newQuery;
        if ((detailed == null) || (!detailed!)) {
          _mapLoadLinkListToState();
        } else {
          _mapLoadLinkListWithDetailsToState();
        }
      });

      on<AddLinkList>((event, emit) async {
        await _mapAddLinkListToState(event);
      });

      on<UpdateLinkList>((event, emit) async {
        await _mapUpdateLinkListToState(event);
      });

      on<DeleteLinkList>((event, emit) async {
        await _mapDeleteLinkListToState(event);
      });

      on<LinkListUpdated>((event, emit) {
        emit(_mapLinkListUpdatedToState(event));
      });
    }