dart_console 1.2.0 copy "dart_console: ^1.2.0" to clipboard
dart_console: ^1.2.0 copied to clipboard

A helper library for command-line applications that need more control over input/output than the standard library provides.

example/main.dart

import 'package:dart_console/dart_console.dart';

void main() {
  final console = Console();
  console
    ..setBackgroundColor(ConsoleColor.blue)
    ..setForegroundColor(ConsoleColor.white)
    ..writeLine('Simple Demo', TextAlignment.center)
    ..resetColorAttributes()
    ..writeLine()
    ..writeLine('This console window has ${console.windowWidth} cols and '
        '${console.windowHeight} rows.')
    ..writeLine()
    ..writeLine('This text is left aligned.', TextAlignment.left)
    ..writeLine('This text is center aligned.', TextAlignment.center)
    ..writeLine('This text is right aligned.', TextAlignment.right);

  for (final color in ConsoleColor.values) {
    console
      ..setForegroundColor(color)
      ..writeLine(color.toString().split('.').last);
  }
  console.resetColorAttributes();
}
120
likes
120
pub points
99%
popularity

Publisher

verified publisheronepub-web.flutter-io.cn

A helper library for command-line applications that need more control over input/output than the standard library provides.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

characters, ffi, intl, win32

More

Packages that depend on dart_console