|
|
@@ -16,7 +16,7 @@
|
|
|
|
|
|
**xterm.dart** is a fast and fully-featured terminal emulator for Flutter applications, with support for mobile and desktop platforms.
|
|
|
|
|
|
-> This package requires Flutter version >=2.0.0
|
|
|
+> This package requires Flutter version >=3.0.0
|
|
|
|
|
|
## Screenshots
|
|
|
|
|
|
@@ -47,6 +47,14 @@
|
|
|
- ✂️ **Customizable**
|
|
|
- ✔ **Frontend independent**: The terminal core can work without flutter frontend.
|
|
|
|
|
|
+**What's new in 3.0.0:**
|
|
|
+
|
|
|
+- 📱 Enhanced support for **mobile** platforms.
|
|
|
+- ⌨️ Integrates with Flutter's **shortcut** system.
|
|
|
+- 🎨 Allows changing **theme** at runtime.
|
|
|
+- 💪 Better **performance**. No tree rebuilds anymore.
|
|
|
+- 🈂️ Works with **IMEs**.
|
|
|
+
|
|
|
## Getting Started
|
|
|
|
|
|
**1.** Add this to your package's pubspec.yaml file:
|
|
|
@@ -54,7 +62,7 @@
|
|
|
```yml
|
|
|
dependencies:
|
|
|
...
|
|
|
- xterm: ^2.2.0-pre
|
|
|
+ xterm: ^3.2.6
|
|
|
```
|
|
|
|
|
|
**2.** Create the terminal:
|
|
|
@@ -65,17 +73,17 @@ import 'package:xterm/xterm.dart';
|
|
|
terminal = Terminal();
|
|
|
```
|
|
|
|
|
|
-To listen for input, add an onInput handler:
|
|
|
+Listen to user interaction with the terminal by simply adding a `onOutput` callback:
|
|
|
|
|
|
```dart
|
|
|
-terminal = Terminal(onInput: onInput);
|
|
|
+terminal = Terminal();
|
|
|
|
|
|
-void onInput(String input) {
|
|
|
- print('input: $input');
|
|
|
+terminal.onOutput = (output) {
|
|
|
+ print('output: $output');
|
|
|
}
|
|
|
```
|
|
|
|
|
|
-**3.** Create the view, then attach the terminal to the view:
|
|
|
+**3.** Create the view, attach the terminal to the view:
|
|
|
|
|
|
```dart
|
|
|
import 'package:xterm/flutter.dart';
|
|
|
@@ -91,12 +99,17 @@ terminal.write('Hello, world!');
|
|
|
|
|
|
**Done!**
|
|
|
|
|
|
-## Example
|
|
|
+## More examples
|
|
|
|
|
|
-- **local pty example**: [Terminal Lite](https://github.com/TerminalStudio/xterm.dart)
|
|
|
+- Write a simple terminal in ~100 lines of code:
|
|
|
+ https://github.com/TerminalStudio/xterm.dart/blob/master/example/lib/main.dart
|
|
|
|
|
|
-- **ssh example**: https://github.com/TerminalStudio/xterm.dart/blob/master/example/lib/ssh.dart
|
|
|
-<img width="400px" src="https://raw.githubusercontent.com/TerminalStudio/xterm.dart/master/media/example-ssh.png">
|
|
|
+- Write a SSH client in ~100 lines of code with [dartssh2]:
|
|
|
+ https://github.com/TerminalStudio/xterm.dart/blob/master/example/lib/ssh.dart
|
|
|
+
|
|
|
+ <img width="400px" src="https://raw.githubusercontent.com/TerminalStudio/xterm.dart/master/media/example-ssh.png">
|
|
|
+
|
|
|
+For a complete project built with xterm.dart, check out [TerminalStudio].
|
|
|
|
|
|
## Features and bugs
|
|
|
|
|
|
@@ -106,4 +119,7 @@ Contributions are always welcome!
|
|
|
|
|
|
## License
|
|
|
|
|
|
-This project is licensed under an MIT license.
|
|
|
+This project is licensed under an MIT license.
|
|
|
+
|
|
|
+[dartssh2]: https://pub.dev/packages/dartssh2
|
|
|
+[TerminalStudio]: https://github.com/TerminalStudio/studio
|