doCancel method

Future<bool> doCancel()

Implementation

Future<bool> doCancel() {
  var actionCtrl = AsyncActionController<bool>();
  _cancelController.add(actionCtrl.action);
  _activeSaveCancelAction = true;
  _changeDetector.markForCheck();
  final stateWasInitialized = initialized;
  actionCtrl.execute(() {
    _isExpanded.value = false;
    _isExpandedChangeByUserAction.add(false);
    _changeDetector.markForCheck();
    if (stateWasInitialized) _transitionHeightChange(false);
    return true;
  }, valueOnCancel: false);
  return actionCtrl.action!.onDone.then((result) {
    _activeSaveCancelAction = false;
    _changeDetector.markForCheck();
    return result;
  });
}