termlib 0.2.0 copy "termlib: ^0.2.0" to clipboard
termlib: ^0.2.0 copied to clipboard

Library that provides a set of utilities for terminal applications.

example/example.dart

import 'dart:io';

import 'package:termlib/termlib.dart';

Future<void> main() async {
  final t = TermLib();
  final color = await t.isBackgroundDark() ? Color('yellow') : Color('blue');

  t
    ..enableAlternateScreen()
    ..eraseClear()
    ..cursorHide()
    ..setTerminalTitle('My Terminal Application')
    ..writeAt(5, 5, t.style('Hello, World!')..fg(color));

  sleep(const Duration(seconds: 2));

  t
    ..disableAlternateScreen()
    ..cursorShow();
  await t.flushThenExit(0);
}
4
likes
0
pub points
39%
popularity

Publisher

verified publishernetflux.com.ar

Library that provides a set of utilities for terminal applications.

Homepage
Repository (GitHub)
View/report issues

Topics

#console #terminal #tui #ansi

Documentation

Documentation

License

unknown (license)

Dependencies

equatable, ffi, meta, termansi, termparser, win32

More

Packages that depend on termlib