FLUTTER ECOSYSTEM

mvitlov/cli_spin

동기 및 비동기 작업에 대해 세련된 터미널 스피너를 표시하여 사용자 경험을 향상시키는 Dart 패키지입니다.

cli_spin 프로젝트 이미지
Stars
9
Forks
0
최근 푸시(UTC)
2023. 10. 18.
프로젝트 상태
활성
Marin Vitlov GitHub avatar
GITHUB User

Marin Vitlov ↗

Flutter ❤️

ABOUT YOU SE & Co. KGZagreb공식 웹사이트 ↗
언어Dart

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 5 개
  • ansi_strip^0.1.1+1
  • string_width^0.1.5
  • lints개발 의존성^2.0.0
  • mocktail개발 의존성^1.0.1
  • test개발 의존성^1.21.0

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

README 펼치기 / 접기

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.