CollActionteam / collaction_cms

This is the UI interface for the CMS API
6 stars 3 forks source link

Create a bloc, a repo and pertinent values, entities, interfaces and extra logic to handle assigning commitments, editing their values and adding blocks. #31

Closed dromerolovo closed 1 year ago

dromerolovo commented 1 year ago

The state of this bloc should be a List<Commitments> and its initial state should be empty.

Should implement the following events:

Consider that the state of the bloc should be immutable so instead of calling the following method to add commitments List.add() is better to add a commitment like this: [...state.commitments, event.commitment]

And to update a commitment:


      var newCommitments = commitments.map((commitment) {
        if(commitment.id == event.commitment.id) {
          return event.commitment;
        }  else {
          return commitment;
        }
      }).toList();
dromerolovo commented 1 year ago

Done in feat/commitments-form branch