basic_console 1.0.0+dev.2 basic_console: ^1.0.0+dev.2 copied to clipboard
Very simple console not blocking input package, allows you to send async messages while getting user-input.
import 'dart:async';
import 'dart:io';
import 'package:basic_console/basic_console.dart';
final console = Console(stdin: stdin, stdout: stdout, prompt: '> ')..enable();
void main() {
Timer.periodic(const Duration(seconds: 2), (timer) {
console.log('Async message.');
});
console.onLine.listen((event) {
console.log('New line: $event');
});
}