stopSpinner function

void stopSpinner()

Stops current spinner animation by killing the isolate instance, and clears current line.

Implementation

void stopSpinner() {
  _spinnerIsolate.kill(priority: Isolate.immediate);
  _spinnerIsolate = null;
  stdout.write('\x1B[2K\x1B[1G'); // Clear current line, and move to first col.
  stdout.write('\x1B[?25h'); // Unhide the cursor.
}