# save method Null safety

dynamic save(

1. EditorBaseApplyChanges event

)
inherited

## Implementation

    Future<void> save(EditorBaseApplyChanges event) async {
      if (state is EditorBaseInitialised) {
        var theState = state as EditorBaseInitialised;
        var newModel = theState.model;
        if (await repository.get(newModel.documentID) == null) {
          await repository.add(newModel);
        } else {
          await repository.update(newModel);
        }
        feedback(true, newModel);
      }
    }