Search packages, repositories and app categories

cli_spin cover
Package detailsv1.0.1

cli_spin

A Dart package that enhances the user experience by displaying a sleek terminal spinner for both sync and async operations.

AndroidiOSmacOSWindowsLinux
30-day downloads
9.9K
Likes
33
Pub points
150

Install package

flutter pub add cli_spin

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

cli_spin is a Dart package designed to improve terminal user experience by displaying smooth, animated spinners during synchronous and asynchronous operations. It integrates seamlessly into CLI applications, providing visual feedback to users during processing tasks. The spinner supports multiple platforms including Android, iOS, macOS, Windows, and Linux, ensuring consistent behavior across environments. With minimal setup via `flutter pub add cli_spin`, developers can enhance their command-line tools with professional-looking progress indicators. The package is lightweight and focused on simplicity and reliability.

Use cases

  • Displaying progress in CLI tools
  • Enhancing user feedback during async operations
  • Improving UX in command-line scripts
  • Providing visual cues for long-running tasks
  • Integrating smooth spinners in console apps

Key features

  • Supports sync and async operations
  • Cross-platform compatibility
  • Minimal API surface
  • Sleek terminal spinner animation
  • Easy integration with Flutter CLI apps

Suitable for

  • CLI developers
  • Command-line tool creators
  • Flutter developers building console utilities
  • Users seeking simple progress indicators
  • Projects requiring lightweight terminal UX enhancements

Considerations

  • Limited to terminal-based output
  • No customization for spinner styles
  • Does not support non-terminal environments
  • Requires manual control of spinner lifecycle
  • Depends on platform-specific terminal capabilities

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

A Dart package that enhances the user experience by displaying a sleek terminal spinner for both sync and async operations.

preview

Features

  • 80+ predefined spinners accessible via CliSpinners
  • Easily change color of spinners and/or text with use of CliSpinnerColor helper
  • Define your own character sets (frames) and intervals for your custom spinners
  • Custom spinner text (w/ separate suffix and prefix options)
  • Start/stop methods
  • Stop and persist the spinner with custom text and symbol
  • Predefiend success, fail, warn and info methods (cross-platform compatible)

Getting started

TODO: List prerequisites and provide or point to information on how to start using the package.

Usage example

import 'dart:async';
import 'package:cli_spin/cli_spin.dart';

void main() {
  // Instantiate spinner
  final spinner = CliSpin(
    text: 'Loading data...',
    spinner: CliSpinners.line,
  ).start(); // Chaining methods

  Timer(Duration(milliseconds: 1000), () {
    // Change spinner color
    spinner.color = CliSpinnerColor.yellow; 
    
    // Change spinner text
    spinner.text = 'Still loading, please wait...';

    Timer(Duration(milliseconds: 1000), () {
      // Alias for `stopAndPersist(...)` method
      spinner.success('Data loaded successfully.');
    });
  });
}

Additional information

Inspired by the ora library written in Javascript.

Categories

Dependencies

Dependency list 2 items

  • ansi_strip^0.1.1+1
  • string_width^0.1.5

Source repository

Projects using this package

No data available yet.