搜尋套件、儲存庫與 APP 分類

xterm 封面
套件詳情v4.0.0

xterm

xterm.dart 是一個適用於 Flutter 應用程式的快速且功能齊全的終端模擬器,支援行動與桌面平台。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
24.2萬
喜歡數
239
Pub 分數
140

安裝套件

flutter pub add xterm

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

xterm.dart 是一個高效率的終端模擬器,適用於 Flutter,讓開發者能在行動與桌面應用程式中嵌入完整功能的終端介面。它支援 ANSI 逸出序列、鍵盤輸入處理,以及跨平台的平順文字渲染。專為整合至 CLI 工具、開發環境或遠端 shell 客戶端而設計,可在 Flutter 應用中提供無縫的終端體驗。此套件持續維護,並相容於 Android、iOS、Web、macOS、Windows 與 Linux。

適用情境

  • 在程式碼編輯器應用中嵌入終端
  • 建構遠端 SSH 客戶端
  • 建立互動式命令列工具
  • 開發開發者控制台介面
  • 支援桌面應用程式中的終端工作流程

主要特色

  • 完整的 ANSI 轉義序列支援
  • 跨平台相容性
  • 高效的文字渲染
  • 鍵盤輸入處理
  • 可自訂主題
  • 滾動回溯與換行

適合對象

  • Flutter 開發人員建構基於終端的應用程式
  • 需要嵌入式 shell 存取權限的工具
  • 教育類應用程式,教授命令列使用
  • 遠端開發環境
  • CLI 工具整合

使用建議

  • 需要了解終端協議
  • 可能需要額外的樣式以保持UI一致性
  • 效能取決於終端內容的複雜度
  • 有限的內建命令執行(需要外部進程)
  • 未經優化,不適合用於重型終端模擬

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

xterm.dart

Actions Package version GitHub repo size GitHub issues GitHub pull requests

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 >=3.0.0

Screenshots

Features

  • 📦 Works out of the box No special configuration required.
  • 🚀 Fast Renders at 60fps.
  • 😀 Wide character support Supports CJK and emojis.
  • ✂️ 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:

dependencies:
  ...
  xterm: ^3.2.6

2. Create the terminal:

import 'package:xterm/xterm.dart';
...
terminal = Terminal();

Listen to user interaction with the terminal by simply adding a onOutput callback:

terminal = Terminal();

terminal.onOutput = (output) {
  print('output: $output');
}

3. Create the view, attach the terminal to the view:

import 'package:xterm/flutter.dart';
...
child: TerminalView(terminal),

4. Write something to the terminal:

terminal.write('Hello, world!');

Done!

More examples

  • Write a simple terminal in ~100 lines of code: https://github.com/TerminalStudio/xterm.dart/blob/master/example/lib/main.dart

  • Write a SSH client in ~100 lines of code with dartssh2: https://github.com/TerminalStudio/xterm.dart/blob/master/example/lib/ssh.dart

For a complete project built with xterm.dart, check out TerminalStudio.

Features and bugs

Please file feature requests and bugs at the issue tracker.

Contributions are always welcome!

License

This project is licensed under an MIT license.

所屬分類

依賴

依賴清單 5 項

原始碼儲存庫

使用此套件的專案