cli_menu 0.2.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 78

cli_menu Build Status #

Screencast of cli_menu in action

A library for adding simple menus to console (CLI) apps. It will print a list of options and then let user choose via keyboard up and down arrows (when ANSI is available), or via a prompt for a number.

This library is conservative – it prefers compatibility over fancy ANSI features and unicode glyphs.

Features and bugs #

Please file feature requests and bugs at the issue tracker.

Changelog #

0.2.1 #

  • Upgrade to Dart 2

0.2.0 #

  • Added option to select choices with modifier keys (instead of the usual enter or space keys).

0.1.0 #

  • First public version, with improved API.

0.0.1 #

  • Initial version.


import 'package:cli_menu/cli_menu.dart';

void main() {
  print("Pick favorite color:");
  final menu = Menu(["Red", "Green", "Orange", "Fuchsia"]);
  final result = menu.choose();
  print("You picked: $result");

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  cli_menu: ^0.2.2

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:cli_menu/cli_menu.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Mar 31, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6

Maintenance suggestions

The package description is too short. (-6 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.20.1 <3.0.0
cli_util ^0.1.3 0.1.3+2
Transitive dependencies
path 1.6.4