fix: ssh use SafeArea

This commit is contained in:
lollipopkit
2023-02-02 18:47:07 +08:00
parent 82a201d3dc
commit 7837fa4339
13 changed files with 44 additions and 36 deletions

View File

@@ -356,7 +356,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 212;
CURRENT_PROJECT_VERSION = 213;
DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
@@ -364,7 +364,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.212;
MARKETING_VERSION = 1.0.213;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
@@ -486,7 +486,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 212;
CURRENT_PROJECT_VERSION = 213;
DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
@@ -494,7 +494,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.212;
MARKETING_VERSION = 1.0.213;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
@@ -510,7 +510,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 212;
CURRENT_PROJECT_VERSION = 213;
DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
@@ -518,7 +518,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.212;
MARKETING_VERSION = 1.0.213;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";

View File

@@ -44,6 +44,7 @@ class MyApp extends StatelessWidget {
);
return MaterialApp(
debugShowCheckedModeBanner: false,
localizationsDelegates: const [
S.delegate,
...GlobalMaterialLocalizations.delegates,

View File

@@ -113,7 +113,7 @@ enum TerminalColorsPlatform {
case TerminalColorsPlatform.putty:
return 'PuTTY';
case TerminalColorsPlatform.xterm:
return 'xterm';
return 'XTerm';
case TerminalColorsPlatform.ubuntu:
return 'Ubuntu';
default:

View File

@@ -2,9 +2,9 @@
class BuildData {
static const String name = "ServerBox";
static const int build = 212;
static const int build = 213;
static const String engine =
"Flutter 3.7.0 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision b06b8b2710 (9 days ago) • 2023-01-23 16:55:55 -0800\nEngine • revision b24591ed32\nTools • Dart 2.19.0 • DevTools 2.20.1\n";
static const String buildAt = "2023-02-02 13:16:45.445785";
static const int modifications = 3;
static const String buildAt = "2023-02-02 16:57:16.480921";
static const int modifications = 5;
}

View File

@@ -1,6 +1,6 @@
const seperator = 'A====A';
const shellCmd = "export LANG=en_US.utf-8 \necho '$seperator' \n"
"cat /proc/net/dev && date +%s \necho $seperator \n "
"cat /proc/net/dev && date +%s \necho $seperator \n"
"cat /etc/os-release | grep PRETTY_NAME \necho $seperator \n"
"cat /proc/stat | grep cpu \necho $seperator \n"
"uptime \necho $seperator \n"

View File

@@ -23,5 +23,6 @@ class SettingStore extends PersistentStore {
StoreProperty<bool> get firstTimeUseSshTerm =>
property('firstTimeUseSshTerm', defaultValue: true);
StoreProperty<int> get termColorIdx => property('termColorIdx', defaultValue: 0);
StoreProperty<int> get termColorIdx =>
property('termColorIdx', defaultValue: 0);
}

View File

@@ -47,7 +47,7 @@ class MessageLookup extends MessageLookupByLibrary {
static String m11(time) => "Spent time: ${time}";
static String m12(url) =>
"This function is now in the experimental stage.\n\nSuch as Backspace on IME not working on iOS. Please use virtual keys above IME.\n\nPlease report bugs on ${url} or join our development.";
"This function is now in the experimental stage.\n\nPlease report bugs on ${url} or join our development.";
static String m13(name) => "Are you sure to delete [${name}]?";

View File

@@ -46,8 +46,7 @@ class MessageLookup extends MessageLookupByLibrary {
static String m11(time) => "耗时: ${time}";
static String m12(url) =>
"该功能目前处于测试阶段。\n\n例如iOS上输入法无法退格。请使用输入法上方的虚拟键。\n\n请在 ${url} 反馈问题,或者加入我们开发。";
static String m12(url) => "该功能目前处于测试阶段。\n\n请在 ${url} 反馈问题,或者加入我们开发。";
static String m13(name) => "确定删除[${name}]";

View File

@@ -1321,10 +1321,10 @@ class S {
);
}
/// `This function is now in the experimental stage.\n\nSuch as Backspace on IME not working on iOS. Please use virtual keys above IME.\n\nPlease report bugs on {url} or join our development.`
/// `This function is now in the experimental stage.\n\nPlease report bugs on {url} or join our development.`
String sshTip(Object url) {
return Intl.message(
'This function is now in the experimental stage.\n\nSuch as Backspace on IME not working on iOS. Please use virtual keys above IME.\n\nPlease report bugs on $url or join our development.',
'This function is now in the experimental stage.\n\nPlease report bugs on $url or join our development.',
name: 'sshTip',
desc: '',
args: [url],

View File

@@ -126,7 +126,7 @@
"showDistLogo": "Show distribution logo",
"snippet": "Snippet",
"spentTime": "Spent time: {time}",
"sshTip": "This function is now in the experimental stage.\n\nSuch as Backspace on IME not working on iOS. Please use virtual keys above IME.\n\nPlease report bugs on {url} or join our development.",
"sshTip": "This function is now in the experimental stage.\n\nPlease report bugs on {url} or join our development.",
"start": "Start",
"stop": "Stop",
"sureDelete": "Are you sure to delete [{name}]?",

View File

@@ -126,7 +126,7 @@
"showDistLogo": "显示发行版 Logo",
"snippet": "代码片段",
"spentTime": "耗时: {time}",
"sshTip": "该功能目前处于测试阶段。\n\n例如iOS上输入法无法退格。请使用输入法上方的虚拟键。\n\n请在 {url} 反馈问题,或者加入我们开发。",
"sshTip": "该功能目前处于测试阶段。\n\n请在 {url} 反馈问题,或者加入我们开发。",
"start": "开始",
"stop": "停止",
"sureDelete": "确定删除[{name}]",

View File

@@ -46,7 +46,8 @@ class _SSHPageState extends State<SSHPage> {
@override
void initState() {
super.initState();
_termColors = TerminalColorsPlatform.values[locator<SettingStore>().termColorIdx.fetch()!].colors;
final termColorIdx = locator<SettingStore>().termColorIdx.fetch()!;
_termColors = TerminalColorsPlatform.values[termColorIdx].colors;
initTerminal();
}
@@ -104,10 +105,13 @@ class _SSHPageState extends State<SSHPage> {
@override
Widget build(BuildContext context) {
final termTheme = _isDark ? termDarkTheme : termLightTheme;
return Scaffold(
backgroundColor: termTheme.background,
body: _buildBody(termTheme.toTerminalTheme(_termColors)),
bottomNavigationBar: _buildBottom(),
return AnnotatedRegion(
value: _isDark ? SystemUiOverlayStyle.light : SystemUiOverlayStyle.dark,
child: Scaffold(
backgroundColor: termTheme.background,
body: _buildBody(termTheme.toTerminalTheme(_termColors)),
bottomNavigationBar: _buildBottom(termTheme.background),
),
);
}
@@ -130,15 +134,18 @@ class _SSHPageState extends State<SSHPage> {
);
}
Widget _buildBottom() {
return AnimatedPadding(
padding: _media.viewInsets,
duration: const Duration(milliseconds: 23),
curve: Curves.fastOutSlowIn,
child: SizedBox(
height: _virtualKeyboardHeight,
child: Consumer<VirtualKeyboard>(
builder: (_, __, ___) => _buildVirtualKey(),
Widget _buildBottom(Color bgColor) {
return SafeArea(
child: AnimatedPadding(
padding: _media.viewInsets,
duration: const Duration(milliseconds: 23),
curve: Curves.fastOutSlowIn,
child: Container(
color: bgColor,
height: _virtualKeyboardHeight,
child: Consumer<VirtualKeyboard>(
builder: (_, __, ___) => _buildVirtualKey(),
),
),
),
);