Search packages, repositories and app categories

Package detailsv0.14.1

malison

A little terminal UI package for the browser.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
521
Likes
11
Pub points
140

Install package

flutter pub add malison

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Malison is a lightweight terminal-style user interface package designed for web applications, enabling developers to create retro-inspired text-based interfaces directly in the browser. Built with Flutter, it supports interactive command-line experiences and is ideal for games or tools that benefit from a terminal aesthetic. The package integrates seamlessly across multiple platforms, including mobile and desktop, making it versatile for cross-platform development. It leverages Dart's capabilities to render and manage console-like output and input efficiently.

Use cases

  • Creating browser-based text adventure games
  • Building terminal emulators for web apps
  • Developing interactive command-line tools
  • Simulating retro computing environments
  • Implementing debug consoles in web applications

Key features

  • Terminal-style UI rendering
  • Cross-platform compatibility
  • Simple command input handling
  • Lightweight and fast performance
  • Supports ANSI escape codes
  • Built-in text formatting and styling

Suitable for

  • Game developers targeting web browsers
  • Creators of interactive educational tools
  • Builders of CLI-like web interfaces
  • Fans of retro game aesthetics
  • Developers seeking minimal UI frameworks

Considerations

  • Limited to terminal-style design patterns
  • Not suitable for complex graphical interfaces
  • Requires familiarity with console/terminal concepts
  • Best for niche use cases rather than general UI needs
  • May need additional logic for advanced interactivity

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Malison is a small Dart library for drawing old school ASCII terminals in the browser. I harvested it from my roguelike game, Hauberk and it's aimed primarily at web games ASCII graphics. Think of it like curses for the web.

Using it

Add it to your package's pubspec:

dependencies:
  malison: any

Then use the library:

import 'dart:html';

import 'package:malison/malison.dart';

void main() {
  // Create or query a <canvas> element to bind it to.
  var canvas = new CanvasElement();
  document.body.children.add(canvas);

  // Create a new terminal. CanvasTerminal uses your browser's fonts.
  // RetroTerminal uses a built in DOS-style Code Page 437 font.
  var terminal = new RetroTerminal.dos(80, 40, canvas);

  // You can draw strings at given positions.
  terminal.writeAt(0, 0, "This is a terminal!");

  // You can control the foreground and background color.
  terminal.writeAt(0, 1, "This is blue on green", Color.blue, Color.green);

  // You can also draw individual glyphs -- character+color units.
  terminal.drawGlyph(3, 4, new Glyph.fromCharCode(CharCode.blackHeartSuit,
      Color.red, Color.white));

  // When you're done drawing, tell it to render all of the changes. It renders
  // in batches for performance.
  terminal.render();
}

Example

The repo includes a little example web application so you can see it in action. From the root of repo, run:

$ dart run build_runner serve

Then in your browser of choice, navigate to http://localhost:8080.

Categories

Dependencies

Dependency list 2 items

Source repository

Projects using this package

No data available yet.