deleteStateFile method

void deleteStateFile({
  1. dynamic onDoesntExists()? = onStateDoesntExist,
  2. dynamic onSuccessfullyDeleted()? = onSuccessfullyStateDeleted,
})

Deletes the current stateFile

Implementation

void deleteStateFile({
  Function()? onDoesntExists = onStateDoesntExist,
  Function()? onSuccessfullyDeleted = onSuccessfullyStateDeleted,
}) {
  if (!stateFile.existsSync()) {
    onDoesntExists?.call();
    return;
  }

  stateFile.deleteSync(recursive: true);
  onSuccessfullyDeleted?.call();
}