onCancel method Null safety

void onCancel(
  1. FutureOr<void> action(
      )
    )

    取消事件

    Implementation

    void onCancel(FutureOr<void> action()) {
      if (!isComplete) {
        if (_onCancel == null) {
          _onCancel = [];
        }
        _onCancel!.add(action);
      }
    }