onRemoteBoardChanged method

  1. @override
void onRemoteBoardChanged(
  1. List<DrawModel> paints,
  2. DrawActionEnum action
)
override

Implementation

@override
void onRemoteBoardChanged(List<DrawModel> paints, DrawActionEnum action) {
  switch (action) {
    case DrawActionEnum.updateAdd:
      _remotePaints.addAll(paints);
      _emitWhiteBoard();
      break;
    case DrawActionEnum.updateRemove:
      _remotePaints.removeWhere((element) => paints.contains(element));
      _emitWhiteBoard();
      break;
    default:
      break;
  }
}