A Flutter widget that renders a stream of characters with a Matrix-style green glow effect. Set the background to black for the authentic Matrix look.

- Stream-based character rendering with typing animation
- Matrix-style green glow effect with multiple shadow layers
- Animated blinking cursor
- Customizable text color and style
- Built-in Courier New font for authentic terminal appearance
Add this to your package's pubspec.yaml
file:
dependencies:
matrix_terminal: VERSION
import 'package:flutter/material.dart';
import 'package:matrix_terminal/matrix_terminal.dart';
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Container(
color: Colors.black, // Black background for authentic Matrix look
child: MatrixTerminal(
characterStream: yourCharacterStream(),
),
),
);
}
}
// Example character stream
Stream<String> yourCharacterStream() async* {
var text = "Welcome to the Matrix...";
for (int i = 0; i < text.length; i++) {
await Future.delayed(Duration(milliseconds: 50));
yield text[i];
}
}
characterStream
(required): AStream<String>
that provides characters to displaytextColor
: Color of the text (default: Matrix greenColor.fromARGB(255, 107, 255, 119)
)style
: OptionalTextStyle
to customize font properties
The example demonstrates a simple implementation with a mock AI response stream:
Stream<String> mockAiAnswser() async* {
var answer = 'Machine learning is a subset of artificial intelligence...';
for (int i = 0; i < answer.length; i++) {
await Future.delayed(Duration(milliseconds: 25));
yield answer[i];
}
}
This project is open source and available under the MIT License.