interact
2.2.0, released 4 years ago by frenco.dev
Customizable interactive command-line components for Dart
What it does
Provides a collection of command-line components like text and password inputs, radio or select lists, checkboxes, spinners, and progress bars. Supports customizable themes and exception handling to restore terminal defaults.
AI-written summary of version 2.2.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- Building command-line applications in Dart that require user interaction
- Displaying spinners and progress bars in terminal scripts
Skip it when
- Developing graphical user interfaces for Flutter apps
- Writing code for platforms other than desktop/CLI environments
Strengths
- Easy to use and customizable CLI components
- Supports validation for inputs
- Provides multi-spinner and multi-progress utilities
Weaknesses
- Limited to command-line and terminal use cases
- Using multiple spinners concurrently requires special care via MultiSpinner to avoid breaking rendering
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 3
not documented
final languages = ['Rust', 'Dart', 'TypeScript'];
final selection = Select(
prompt: 'Your favorite programming language',
options: languages,
).interact();
print('${languages[selection]}');Alternatives
Packages that do the same job and could replace interact.
- cli_util
Utilities to help build Dart command-line apps, find the SDK, and display progress.
88Compare - cli_tools
Utilities for building command‑line interfaces, including argument parsing, analytics, and progress reporting.
83Compare - git
Git command line wrapper for inspecting and manipulating local Git repositories.
89Compare - cli_completion
Completion functionality for Dart Command-Line Interfaces built using CommandRunner.
85Compare
Works with
Packages commonly used together with interact: ones it builds on, ones built on it, and its own family.
- tintinteract depends on itTerminal string styling as an extension on String.
- dart_consoleinteract depends on itA helper library for command-line applications requiring advanced control over input/output.
- derrySame familyA script manager to define and run shortcut scripts inside your pubspec.yaml file.
- fvmBuilt on interactCLI to manage Flutter SDK versions per project
- flutterfire_cliBuilt on interactCLI to configure Firebase services in Flutter projects