# DynamicWidgetListBloc constructor Null safety

DynamicWidgetListBloc(

1. {FilterDynamicWidgetModels? filter,
2. bool? paged,
3. String? orderBy,
4. bool? descending,
5. bool? detailed,
6. EliudQuery? eliudQuery,
7. required DynamicWidgetRepository dynamicWidgetRepository,
8. int dynamicWidgetLimit = 5}

)

## Implementation

    DynamicWidgetListBloc(
        {this.filter,
        this.paged,
        this.orderBy,
        this.descending,
        this.detailed,
        this.eliudQuery,
        required DynamicWidgetRepository dynamicWidgetRepository,
        this.dynamicWidgetLimit = 5})
        : _dynamicWidgetRepository = dynamicWidgetRepository,
          super(DynamicWidgetListLoading()) {
      on<LoadDynamicWidgetList>((event, emit) {
        if ((detailed == null) || (!detailed!)) {
          _mapLoadDynamicWidgetListToState();
        } else {
          _mapLoadDynamicWidgetListWithDetailsToState();
        }
      });

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

      on<DynamicWidgetChangeQuery>((event, emit) {
        eliudQuery = event.newQuery;
        if ((detailed == null) || (!detailed!)) {
          _mapLoadDynamicWidgetListToState();
        } else {
          _mapLoadDynamicWidgetListWithDetailsToState();
        }
      });

      on<AddDynamicWidgetList>((event, emit) async {
        await _mapAddDynamicWidgetListToState(event);
      });

      on<UpdateDynamicWidgetList>((event, emit) async {
        await _mapUpdateDynamicWidgetListToState(event);
      });

      on<DeleteDynamicWidgetList>((event, emit) async {
        await _mapDeleteDynamicWidgetListToState(event);
      });

      on<DynamicWidgetListUpdated>((event, emit) {
        emit(_mapDynamicWidgetListUpdatedToState(event));
      });
    }