A Dart library to simulate print() without adding a trailing newline for both Native and Web.

Latest_Release License: GPL v3



  interactive_print: ^1.0.0

A simple usage example:

import 'package:interactive_print/interactive_print.dart';

void main() {
  write('General Kenobi');

Objective of this package

The print() function in Dart always adds a newline to the end, so you cannot print character by character. This is particularly useful if you want to have a delay between printing characters or if you want to construct a line dynamically using characters at runtime. Dart has 2 supported platforms namely Native and Web. On Native, you can use stdout.write() to print without a newline, however this breaks support for Web as this function is not supported. Web also doesn't have any method to print without a newline but this behaviour can be simulated like this. This Dart library provides its own write() and writeln() function which will dynamically use stdout.write() or the console.log() trick based on the platform you are running on. More discussion here.


  • May not work correctly if you run your application in debug mode.

  • If you face any issue or have suggestions then feel free to open an issue on GitHub.

  • Majority of the code was contributed by lrhn.