mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 15:24:35 +01:00
new: compatibility of Chinese Android safe keyboard
This commit is contained in:
@@ -1,8 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:toolbox/core/persistant_store.dart';
|
import 'package:toolbox/core/persistant_store.dart';
|
||||||
import 'package:toolbox/core/utils/platform/base.dart';
|
import 'package:toolbox/core/utils/platform/base.dart';
|
||||||
import 'package:toolbox/data/model/app/menu/server_func.dart';
|
import 'package:toolbox/data/model/app/menu/server_func.dart';
|
||||||
import 'package:xterm/ui.dart';
|
|
||||||
|
|
||||||
import '../model/app/net_view.dart';
|
import '../model/app/net_view.dart';
|
||||||
import '../res/default.dart';
|
import '../res/default.dart';
|
||||||
@@ -128,10 +126,10 @@ class SettingStore extends PersistentStore {
|
|||||||
// 1,
|
// 1,
|
||||||
// );
|
// );
|
||||||
|
|
||||||
late final keyboardType = property(
|
// late final keyboardType = property(
|
||||||
'keyboardType',
|
// 'keyboardType',
|
||||||
TextInputType.text.index,
|
// TextInputType.text.index,
|
||||||
);
|
// );
|
||||||
|
|
||||||
late final sshVirtKeys = listProperty(
|
late final sshVirtKeys = listProperty(
|
||||||
'sshVirtKeys',
|
'sshVirtKeys',
|
||||||
@@ -251,10 +249,6 @@ class SettingStore extends PersistentStore {
|
|||||||
/// when building traffic view on server tab
|
/// when building traffic view on server tab
|
||||||
late final ignoreLocalNet = property('ignoreLocalNetIface', true);
|
late final ignoreLocalNet = property('ignoreLocalNetIface', true);
|
||||||
|
|
||||||
/// Index of terminal cursor type
|
|
||||||
late final termCursor =
|
|
||||||
property('termCursor', TerminalCursorType.block.index);
|
|
||||||
|
|
||||||
/// Remerber pwd in memory
|
/// Remerber pwd in memory
|
||||||
/// Used for [DialogX.showPwdDialog]
|
/// Used for [DialogX.showPwdDialog]
|
||||||
late final rememberPwdInMem = property('rememberPwdInMem', true);
|
late final rememberPwdInMem = property('rememberPwdInMem', true);
|
||||||
@@ -263,6 +257,10 @@ class SettingStore extends PersistentStore {
|
|||||||
/// 0: follow app theme, 1: light, 2: dark
|
/// 0: follow app theme, 1: light, 2: dark
|
||||||
late final termTheme = property('termTheme', 0);
|
late final termTheme = property('termTheme', 0);
|
||||||
|
|
||||||
|
/// Compatiablity for Chinese Android.
|
||||||
|
/// Set it to true, if you use Safe Keyboard on Chinese Android
|
||||||
|
late final cnKeyboardComp = property('cnKeyboardComp', false);
|
||||||
|
|
||||||
// Never show these settings for users
|
// Never show these settings for users
|
||||||
//
|
//
|
||||||
// ------BEGIN------
|
// ------BEGIN------
|
||||||
|
|||||||
@@ -37,6 +37,8 @@
|
|||||||
"clipboard": "Zwischenablage",
|
"clipboard": "Zwischenablage",
|
||||||
"close": "Schließen",
|
"close": "Schließen",
|
||||||
"cmd": "Command",
|
"cmd": "Command",
|
||||||
|
"cnKeyboardComp": "Kompatibilität mit chinesischem Android",
|
||||||
|
"cnKeyboardCompTip": "Wenn das Terminal ein sicheres Tastenfeld öffnet, können Sie es aktivieren.",
|
||||||
"collapseUI": "Zusammenbrechen",
|
"collapseUI": "Zusammenbrechen",
|
||||||
"collapseUITip": "Ob lange Listen in der Benutzeroberfläche standardmäßig eingeklappt werden sollen oder nicht",
|
"collapseUITip": "Ob lange Listen in der Benutzeroberfläche standardmäßig eingeklappt werden sollen oder nicht",
|
||||||
"conn": "Verbindung",
|
"conn": "Verbindung",
|
||||||
@@ -125,8 +127,6 @@
|
|||||||
"keepStatusWhenErr": "Den letzten Serverstatus beibehalten",
|
"keepStatusWhenErr": "Den letzten Serverstatus beibehalten",
|
||||||
"keepStatusWhenErrTip": "Nur im Fehlerfall während der Ausführung des Skripts",
|
"keepStatusWhenErrTip": "Nur im Fehlerfall während der Ausführung des Skripts",
|
||||||
"keyAuth": "Schlüsselauthentifzierung",
|
"keyAuth": "Schlüsselauthentifzierung",
|
||||||
"keyboardCompatibility": "Mögliche Verbesserungen bei der Kompatibilität der Eingabemethoden",
|
|
||||||
"keyboardType": "Tastatur Typ",
|
|
||||||
"language": "Sprache",
|
"language": "Sprache",
|
||||||
"languageName": "Deutsch",
|
"languageName": "Deutsch",
|
||||||
"lastTry": "Letzter Versuch",
|
"lastTry": "Letzter Versuch",
|
||||||
|
|||||||
@@ -37,6 +37,8 @@
|
|||||||
"clipboard": "Clipboard",
|
"clipboard": "Clipboard",
|
||||||
"close": "Close",
|
"close": "Close",
|
||||||
"cmd": "Command",
|
"cmd": "Command",
|
||||||
|
"cnKeyboardComp": "Compatibility with Chinese Android",
|
||||||
|
"cnKeyboardCompTip": "If the terminal pops up a secure keyboard, you can enable it.",
|
||||||
"collapseUI": "Collapse",
|
"collapseUI": "Collapse",
|
||||||
"collapseUITip": "Whether to collapse long lists present in the UI by default",
|
"collapseUITip": "Whether to collapse long lists present in the UI by default",
|
||||||
"conn": "Connection",
|
"conn": "Connection",
|
||||||
@@ -125,8 +127,6 @@
|
|||||||
"keepStatusWhenErr": "Preserve the last server state",
|
"keepStatusWhenErr": "Preserve the last server state",
|
||||||
"keepStatusWhenErrTip": "Only in the event of an error during script execution",
|
"keepStatusWhenErrTip": "Only in the event of an error during script execution",
|
||||||
"keyAuth": "Key Auth",
|
"keyAuth": "Key Auth",
|
||||||
"keyboardCompatibility": "Possible to improve input method compatibility",
|
|
||||||
"keyboardType": "Keyborad type",
|
|
||||||
"language": "Language",
|
"language": "Language",
|
||||||
"languageName": "English",
|
"languageName": "English",
|
||||||
"lastTry": "Last try",
|
"lastTry": "Last try",
|
||||||
|
|||||||
@@ -37,6 +37,8 @@
|
|||||||
"clipboard": "Portapapeles",
|
"clipboard": "Portapapeles",
|
||||||
"close": "Cerrar",
|
"close": "Cerrar",
|
||||||
"cmd": "Comando",
|
"cmd": "Comando",
|
||||||
|
"cnKeyboardComp": "Compatibilidad con Android chino",
|
||||||
|
"cnKeyboardCompTip": "Si el terminal muestra un teclado seguro, puedes activarlo.",
|
||||||
"collapseUI": "Colapsar",
|
"collapseUI": "Colapsar",
|
||||||
"collapseUITip": "¿Colapsar por defecto las listas largas en la UI?",
|
"collapseUITip": "¿Colapsar por defecto las listas largas en la UI?",
|
||||||
"conn": "Conectar",
|
"conn": "Conectar",
|
||||||
@@ -125,8 +127,6 @@
|
|||||||
"keepStatusWhenErr": "Mantener el estado anterior del servidor",
|
"keepStatusWhenErr": "Mantener el estado anterior del servidor",
|
||||||
"keepStatusWhenErrTip": "Solo aplica cuando hay errores al ejecutar scripts",
|
"keepStatusWhenErrTip": "Solo aplica cuando hay errores al ejecutar scripts",
|
||||||
"keyAuth": "Autenticación con llave",
|
"keyAuth": "Autenticación con llave",
|
||||||
"keyboardCompatibility": "Puede mejorar la compatibilidad del teclado",
|
|
||||||
"keyboardType": "Tipo de teclado",
|
|
||||||
"language": "Idioma",
|
"language": "Idioma",
|
||||||
"languageName": "Español",
|
"languageName": "Español",
|
||||||
"lastTry": "Último intento",
|
"lastTry": "Último intento",
|
||||||
|
|||||||
@@ -37,6 +37,8 @@
|
|||||||
"clipboard": "presse-papiers",
|
"clipboard": "presse-papiers",
|
||||||
"close": "Fermer",
|
"close": "Fermer",
|
||||||
"cmd": "Commande",
|
"cmd": "Commande",
|
||||||
|
"cnKeyboardComp": " Compatibilité avec Android chinois",
|
||||||
|
"cnKeyboardCompTip": "Si le terminal affiche un clavier sécurisé, vous pouvez l'activer.",
|
||||||
"collapseUI": "обвал",
|
"collapseUI": "обвал",
|
||||||
"collapseUITip": "Réduction ou non des longues listes présentes dans l'interface utilisateur par défaut",
|
"collapseUITip": "Réduction ou non des longues listes présentes dans l'interface utilisateur par défaut",
|
||||||
"conn": "Connexion",
|
"conn": "Connexion",
|
||||||
@@ -125,8 +127,6 @@
|
|||||||
"keepStatusWhenErr": "Conserver le dernier état du serveur",
|
"keepStatusWhenErr": "Conserver le dernier état du serveur",
|
||||||
"keepStatusWhenErrTip": "Uniquement en cas d'erreur lors de l'exécution du script",
|
"keepStatusWhenErrTip": "Uniquement en cas d'erreur lors de l'exécution du script",
|
||||||
"keyAuth": "Authentification par clé",
|
"keyAuth": "Authentification par clé",
|
||||||
"keyboardCompatibility": "Possibilité d'améliorer la compatibilité avec les méthodes de saisie",
|
|
||||||
"keyboardType": "Type de clavier",
|
|
||||||
"language": "Langue",
|
"language": "Langue",
|
||||||
"languageName": "Français",
|
"languageName": "Français",
|
||||||
"lastTry": "Dernier essai",
|
"lastTry": "Dernier essai",
|
||||||
|
|||||||
@@ -37,6 +37,8 @@
|
|||||||
"clipboard": "papan klip",
|
"clipboard": "papan klip",
|
||||||
"close": "Menutup",
|
"close": "Menutup",
|
||||||
"cmd": "Memerintah",
|
"cmd": "Memerintah",
|
||||||
|
"cnKeyboardComp": "Kompatibilitas dengan Android China",
|
||||||
|
"cnKeyboardCompTip": "Jika terminal munculkan keyboard aman, Anda bisa mengaktifkannya.",
|
||||||
"collapseUI": "Runtuh",
|
"collapseUI": "Runtuh",
|
||||||
"collapseUITip": "Apakah akan menciutkan daftar panjang yang ada di UI secara default atau tidak",
|
"collapseUITip": "Apakah akan menciutkan daftar panjang yang ada di UI secara default atau tidak",
|
||||||
"conn": "Koneksi",
|
"conn": "Koneksi",
|
||||||
@@ -125,8 +127,6 @@
|
|||||||
"keepStatusWhenErr": "Menyimpan status server terakhir",
|
"keepStatusWhenErr": "Menyimpan status server terakhir",
|
||||||
"keepStatusWhenErrTip": "Hanya ketika terjadi kesalahan saat menjalankan skrip",
|
"keepStatusWhenErrTip": "Hanya ketika terjadi kesalahan saat menjalankan skrip",
|
||||||
"keyAuth": "Auth kunci",
|
"keyAuth": "Auth kunci",
|
||||||
"keyboardCompatibility": "Mungkin untuk meningkatkan kompatibilitas metode input",
|
|
||||||
"keyboardType": "Tipe Keyborad",
|
|
||||||
"language": "Bahasa",
|
"language": "Bahasa",
|
||||||
"languageName": "Indonesia",
|
"languageName": "Indonesia",
|
||||||
"lastTry": "Percobaan terakhir",
|
"lastTry": "Percobaan terakhir",
|
||||||
|
|||||||
@@ -37,6 +37,8 @@
|
|||||||
"clipboard": "クリップボード",
|
"clipboard": "クリップボード",
|
||||||
"close": "閉じる",
|
"close": "閉じる",
|
||||||
"cmd": "コマンド",
|
"cmd": "コマンド",
|
||||||
|
"cnKeyboardComp": "中国のAndroidとの互換性",
|
||||||
|
"cnKeyboardCompTip": "ターミナルがセキュアキーボードを表示した場合、それを有効にできます。",
|
||||||
"collapseUI": "UIを折りたたむ",
|
"collapseUI": "UIを折りたたむ",
|
||||||
"collapseUITip": "UIの長いリストをデフォルトで折りたたむかどうか",
|
"collapseUITip": "UIの長いリストをデフォルトで折りたたむかどうか",
|
||||||
"conn": "接続",
|
"conn": "接続",
|
||||||
@@ -125,8 +127,6 @@
|
|||||||
"keepStatusWhenErr": "エラー時に前回のサーバーステータスを保持",
|
"keepStatusWhenErr": "エラー時に前回のサーバーステータスを保持",
|
||||||
"keepStatusWhenErrTip": "スクリプトの実行エラーに限ります",
|
"keepStatusWhenErrTip": "スクリプトの実行エラーに限ります",
|
||||||
"keyAuth": "キー認証",
|
"keyAuth": "キー認証",
|
||||||
"keyboardCompatibility": "入力法の互換性を向上させる可能性があります",
|
|
||||||
"keyboardType": "キーボードタイプ",
|
|
||||||
"language": "言語",
|
"language": "言語",
|
||||||
"languageName": "日本語",
|
"languageName": "日本語",
|
||||||
"lastTry": "最後の試み",
|
"lastTry": "最後の試み",
|
||||||
|
|||||||
@@ -37,6 +37,8 @@
|
|||||||
"clipboard": "Área de transferência",
|
"clipboard": "Área de transferência",
|
||||||
"close": "Fechar",
|
"close": "Fechar",
|
||||||
"cmd": "Comando",
|
"cmd": "Comando",
|
||||||
|
"cnKeyboardComp": "Compatibilidade com Android chinês",
|
||||||
|
"cnKeyboardCompTip": "Se o terminal abrir um teclado seguro, você pode ativá-lo.",
|
||||||
"collapseUI": "Colapsar",
|
"collapseUI": "Colapsar",
|
||||||
"collapseUITip": "Deve colapsar listas longas na UI por padrão?",
|
"collapseUITip": "Deve colapsar listas longas na UI por padrão?",
|
||||||
"conn": "Conectar",
|
"conn": "Conectar",
|
||||||
@@ -125,8 +127,6 @@
|
|||||||
"keepStatusWhenErr": "Manter o status anterior do servidor",
|
"keepStatusWhenErr": "Manter o status anterior do servidor",
|
||||||
"keepStatusWhenErrTip": "Limitado a erros de execução de scripts",
|
"keepStatusWhenErrTip": "Limitado a erros de execução de scripts",
|
||||||
"keyAuth": "Autenticação por chave",
|
"keyAuth": "Autenticação por chave",
|
||||||
"keyboardCompatibility": "Pode melhorar a compatibilidade do teclado",
|
|
||||||
"keyboardType": "Tipo de teclado",
|
|
||||||
"language": "Idioma",
|
"language": "Idioma",
|
||||||
"languageName": "Português",
|
"languageName": "Português",
|
||||||
"lastTry": "Última tentativa",
|
"lastTry": "Última tentativa",
|
||||||
|
|||||||
@@ -37,6 +37,8 @@
|
|||||||
"clipboard": "буфер обмена",
|
"clipboard": "буфер обмена",
|
||||||
"close": "закрыть",
|
"close": "закрыть",
|
||||||
"cmd": "команда",
|
"cmd": "команда",
|
||||||
|
"cnKeyboardComp": "Совместимость с китайским Android",
|
||||||
|
"cnKeyboardCompTip": "Если терминал отображает безопасную клавиатуру, вы можете ее активировать.",
|
||||||
"collapseUI": "свернуть",
|
"collapseUI": "свернуть",
|
||||||
"collapseUITip": "Свернуть длинные списки в UI по умолчанию",
|
"collapseUITip": "Свернуть длинные списки в UI по умолчанию",
|
||||||
"conn": "подключение",
|
"conn": "подключение",
|
||||||
@@ -125,8 +127,6 @@
|
|||||||
"keepStatusWhenErr": "Сохранять статус сервера при ошибке",
|
"keepStatusWhenErr": "Сохранять статус сервера при ошибке",
|
||||||
"keepStatusWhenErrTip": "Применимо только в случае ошибки выполнения скрипта",
|
"keepStatusWhenErrTip": "Применимо только в случае ошибки выполнения скрипта",
|
||||||
"keyAuth": "аутентификация по ключу",
|
"keyAuth": "аутентификация по ключу",
|
||||||
"keyboardCompatibility": "может улучшить совместимость с клавиатурой",
|
|
||||||
"keyboardType": "тип клавиатуры",
|
|
||||||
"language": "язык",
|
"language": "язык",
|
||||||
"languageName": "Русский",
|
"languageName": "Русский",
|
||||||
"lastTry": "последняя попытка",
|
"lastTry": "последняя попытка",
|
||||||
|
|||||||
@@ -37,6 +37,8 @@
|
|||||||
"clipboard": "剪切板",
|
"clipboard": "剪切板",
|
||||||
"close": "关闭",
|
"close": "关闭",
|
||||||
"cmd": "命令",
|
"cmd": "命令",
|
||||||
|
"cnKeyboardComp": "中国Android兼容性",
|
||||||
|
"cnKeyboardCompTip": "如果终端弹出安全键盘,可以开启",
|
||||||
"collapseUI": "折叠",
|
"collapseUI": "折叠",
|
||||||
"collapseUITip": "是否默认折叠UI中存在的长列表",
|
"collapseUITip": "是否默认折叠UI中存在的长列表",
|
||||||
"conn": "连接",
|
"conn": "连接",
|
||||||
@@ -125,8 +127,6 @@
|
|||||||
"keepStatusWhenErr": "保留上次的服务器状态",
|
"keepStatusWhenErr": "保留上次的服务器状态",
|
||||||
"keepStatusWhenErrTip": "仅限于执行脚本出错",
|
"keepStatusWhenErrTip": "仅限于执行脚本出错",
|
||||||
"keyAuth": "密钥认证",
|
"keyAuth": "密钥认证",
|
||||||
"keyboardCompatibility": "可能会改善输入法兼容性",
|
|
||||||
"keyboardType": "键盘类型",
|
|
||||||
"language": "语言",
|
"language": "语言",
|
||||||
"languageName": "简体中文",
|
"languageName": "简体中文",
|
||||||
"lastTry": "最后尝试",
|
"lastTry": "最后尝试",
|
||||||
|
|||||||
@@ -37,6 +37,8 @@
|
|||||||
"clipboard": "剪切板",
|
"clipboard": "剪切板",
|
||||||
"close": "關閉",
|
"close": "關閉",
|
||||||
"cmd": "命令",
|
"cmd": "命令",
|
||||||
|
"cnKeyboardComp": "中國Android兼容性",
|
||||||
|
"cnKeyboardCompTip": "如果終端彈出安全鍵盤,您可以啟用它。",
|
||||||
"collapseUI": "折疊",
|
"collapseUI": "折疊",
|
||||||
"collapseUITip": "是否預設折疊UI中存在的長列表",
|
"collapseUITip": "是否預設折疊UI中存在的長列表",
|
||||||
"conn": "連接",
|
"conn": "連接",
|
||||||
@@ -125,8 +127,6 @@
|
|||||||
"keepStatusWhenErr": "保留上次的伺服器狀態",
|
"keepStatusWhenErr": "保留上次的伺服器狀態",
|
||||||
"keepStatusWhenErrTip": "仅在执行脚本时出错时",
|
"keepStatusWhenErrTip": "仅在执行脚本时出错时",
|
||||||
"keyAuth": "密鑰認證",
|
"keyAuth": "密鑰認證",
|
||||||
"keyboardCompatibility": "可能會改善輸入法兼容性",
|
|
||||||
"keyboardType": "鍵盤類型",
|
|
||||||
"language": "語言",
|
"language": "語言",
|
||||||
"languageName": "繁體中文",
|
"languageName": "繁體中文",
|
||||||
"lastTry": "最後嘗試",
|
"lastTry": "最後嘗試",
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import 'package:toolbox/core/extension/colorx.dart';
|
|||||||
import 'package:toolbox/core/extension/context/common.dart';
|
import 'package:toolbox/core/extension/context/common.dart';
|
||||||
import 'package:toolbox/core/extension/context/locale.dart';
|
import 'package:toolbox/core/extension/context/locale.dart';
|
||||||
import 'package:toolbox/core/extension/context/snackbar.dart';
|
import 'package:toolbox/core/extension/context/snackbar.dart';
|
||||||
import 'package:toolbox/core/extension/enum.dart';
|
|
||||||
import 'package:toolbox/core/extension/locale.dart';
|
import 'package:toolbox/core/extension/locale.dart';
|
||||||
import 'package:toolbox/core/extension/context/dialog.dart';
|
import 'package:toolbox/core/extension/context/dialog.dart';
|
||||||
import 'package:toolbox/core/extension/stringx.dart';
|
import 'package:toolbox/core/extension/stringx.dart';
|
||||||
@@ -18,7 +17,6 @@ import 'package:toolbox/data/res/provider.dart';
|
|||||||
import 'package:toolbox/data/res/rebuild.dart';
|
import 'package:toolbox/data/res/rebuild.dart';
|
||||||
import 'package:toolbox/data/res/store.dart';
|
import 'package:toolbox/data/res/store.dart';
|
||||||
import 'package:toolbox/view/widget/expand_tile.dart';
|
import 'package:toolbox/view/widget/expand_tile.dart';
|
||||||
import 'package:xterm/ui.dart';
|
|
||||||
|
|
||||||
import '../../../core/persistant_store.dart';
|
import '../../../core/persistant_store.dart';
|
||||||
import '../../../core/route.dart';
|
import '../../../core/route.dart';
|
||||||
@@ -173,10 +171,9 @@ class _SettingPageState extends State<SettingPage> {
|
|||||||
_buildTermTheme(),
|
_buildTermTheme(),
|
||||||
_buildFont(),
|
_buildFont(),
|
||||||
_buildTermFontSize(),
|
_buildTermFontSize(),
|
||||||
_buildTermCursor(),
|
|
||||||
_buildSSHVirtualKeyAutoOff(),
|
_buildSSHVirtualKeyAutoOff(),
|
||||||
// Use hardware keyboard on desktop, so there is no need to set it
|
// Use hardware keyboard on desktop, so there is no need to set it
|
||||||
if (isMobile) _buildKeyboardType(),
|
if (isAndroid) _buildCNKeyboardComp(),
|
||||||
if (isMobile) _buildSSHVirtKeys(),
|
if (isMobile) _buildSSHVirtKeys(),
|
||||||
].map((e) => CardX(child: e)).toList(),
|
].map((e) => CardX(child: e)).toList(),
|
||||||
);
|
);
|
||||||
@@ -656,43 +653,11 @@ class _SettingPageState extends State<SettingPage> {
|
|||||||
// );
|
// );
|
||||||
// }
|
// }
|
||||||
|
|
||||||
Widget _buildKeyboardType() {
|
Widget _buildCNKeyboardComp() {
|
||||||
const List<String> names = <String>[
|
|
||||||
'text',
|
|
||||||
'multiline',
|
|
||||||
'number',
|
|
||||||
'phone',
|
|
||||||
'datetime',
|
|
||||||
'emailAddress',
|
|
||||||
'url',
|
|
||||||
'visiblePassword',
|
|
||||||
'name',
|
|
||||||
'address',
|
|
||||||
'none',
|
|
||||||
];
|
|
||||||
return ListTile(
|
return ListTile(
|
||||||
title: Text(l10n.keyboardType),
|
title: Text(l10n.cnKeyboardComp),
|
||||||
subtitle: Text(l10n.keyboardCompatibility, style: UIs.textGrey),
|
subtitle: Text(l10n.cnKeyboardCompTip, style: UIs.textGrey),
|
||||||
trailing: ValueListenableBuilder(
|
trailing: StoreSwitch(prop: _setting.cnKeyboardComp),
|
||||||
valueListenable: _setting.keyboardType.listenable(),
|
|
||||||
builder: (_, val, __) => Text(
|
|
||||||
names[val],
|
|
||||||
style: UIs.text15,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
onTap: () async {
|
|
||||||
if (names.length != TextInputType.values.length) {
|
|
||||||
// This notify me to update the code
|
|
||||||
context.showSnackBar('names.length != TextInputType.values.length');
|
|
||||||
}
|
|
||||||
final selected = await context.showPickSingleDialog(
|
|
||||||
items: names,
|
|
||||||
initial: names.fromIndex(_setting.keyboardType.fetch()),
|
|
||||||
);
|
|
||||||
if (selected != null) {
|
|
||||||
_setting.keyboardType.put(names.indexOf(selected));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1060,30 +1025,6 @@ class _SettingPageState extends State<SettingPage> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildTermCursor() {
|
|
||||||
return ListTile(
|
|
||||||
title: Text(l10n.cursorType),
|
|
||||||
trailing: ValueListenableBuilder(
|
|
||||||
valueListenable: _setting.termCursor.listenable(),
|
|
||||||
builder: (_, val, __) => Text(
|
|
||||||
TerminalCursorType.values.fromIndex(val).name,
|
|
||||||
style: UIs.text15,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
onTap: () async {
|
|
||||||
final selected = await context.showPickSingleDialog(
|
|
||||||
items: TerminalCursorType.values,
|
|
||||||
name: (p0) => p0.name,
|
|
||||||
initial:
|
|
||||||
TerminalCursorType.values.fromIndex(_setting.termCursor.fetch()),
|
|
||||||
);
|
|
||||||
if (selected != null) {
|
|
||||||
_setting.termCursor.put(selected.index);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget _buildRememberPwdInMem() {
|
Widget _buildRememberPwdInMem() {
|
||||||
return ListTile(
|
return ListTile(
|
||||||
title: Text(l10n.rememberPwdInMem),
|
title: Text(l10n.rememberPwdInMem),
|
||||||
|
|||||||
@@ -58,10 +58,8 @@ class _SSHPageState extends State<SSHPage> with AutomaticKeepAliveClientMixin {
|
|||||||
late MediaQueryData _media;
|
late MediaQueryData _media;
|
||||||
late TerminalStyle _terminalStyle;
|
late TerminalStyle _terminalStyle;
|
||||||
late TerminalTheme _terminalTheme;
|
late TerminalTheme _terminalTheme;
|
||||||
late TextInputType _keyboardType;
|
|
||||||
double _virtKeyWidth = 0;
|
double _virtKeyWidth = 0;
|
||||||
double _virtKeysHeight = 0;
|
double _virtKeysHeight = 0;
|
||||||
late final TerminalCursorType _termCursor;
|
|
||||||
|
|
||||||
bool _isDark = false;
|
bool _isDark = false;
|
||||||
Timer? _virtKeyLongPressTimer;
|
Timer? _virtKeyLongPressTimer;
|
||||||
@@ -138,13 +136,13 @@ class _SSHPageState extends State<SSHPage> with AutomaticKeepAliveClientMixin {
|
|||||||
child: TerminalView(
|
child: TerminalView(
|
||||||
_terminal,
|
_terminal,
|
||||||
controller: _terminalController,
|
controller: _terminalController,
|
||||||
keyboardType: _keyboardType,
|
keyboardType: TextInputType.emailAddress,
|
||||||
|
enableSuggestions: Stores.setting.cnKeyboardComp.fetch(),
|
||||||
textStyle: _terminalStyle,
|
textStyle: _terminalStyle,
|
||||||
theme: _terminalTheme,
|
theme: _terminalTheme,
|
||||||
deleteDetection: false,
|
deleteDetection: isMobile,
|
||||||
autofocus: true,
|
autofocus: true,
|
||||||
keyboardAppearance: _isDark ? Brightness.dark : Brightness.light,
|
keyboardAppearance: _isDark ? Brightness.dark : Brightness.light,
|
||||||
cursorType: _termCursor,
|
|
||||||
showToolbar: isMobile,
|
showToolbar: isMobile,
|
||||||
viewOffset: Offset(
|
viewOffset: Offset(
|
||||||
2 * _horizonPadding,
|
2 * _horizonPadding,
|
||||||
@@ -484,16 +482,6 @@ class _SSHPageState extends State<SSHPage> with AutomaticKeepAliveClientMixin {
|
|||||||
);
|
);
|
||||||
|
|
||||||
_terminalStyle = TerminalStyle.fromTextStyle(textStyle);
|
_terminalStyle = TerminalStyle.fromTextStyle(textStyle);
|
||||||
_keyboardType = TextInputType.values[Stores.setting.keyboardType.fetch()];
|
|
||||||
|
|
||||||
final termCursor = Stores.setting.termCursor.fetch();
|
|
||||||
_termCursor = () {
|
|
||||||
try {
|
|
||||||
return TerminalCursorType.values[termCursor];
|
|
||||||
} catch (_) {
|
|
||||||
return TerminalCursorType.block;
|
|
||||||
}
|
|
||||||
}();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1259,7 +1259,7 @@ packages:
|
|||||||
description:
|
description:
|
||||||
path: "."
|
path: "."
|
||||||
ref: master
|
ref: master
|
||||||
resolved-ref: b81b303040729b866f844dd46b25c9f6be582962
|
resolved-ref: ee64dc1541a18f513856de0f554d8227fdbf29da
|
||||||
url: "https://github.com/lollipopkit/xterm.dart"
|
url: "https://github.com/lollipopkit/xterm.dart"
|
||||||
source: git
|
source: git
|
||||||
version: "4.0.0"
|
version: "4.0.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user