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

View File

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

View File

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

View File

@@ -2,9 +2,9 @@
class BuildData { class BuildData {
static const String name = "ServerBox"; static const String name = "ServerBox";
static const int build = 212; static const int build = 213;
static const String engine = 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"; "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 String buildAt = "2023-02-02 16:57:16.480921";
static const int modifications = 3; static const int modifications = 5;
} }

View File

@@ -1,6 +1,6 @@
const seperator = 'A====A'; const seperator = 'A====A';
const shellCmd = "export LANG=en_US.utf-8 \necho '$seperator' \n" 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 /etc/os-release | grep PRETTY_NAME \necho $seperator \n"
"cat /proc/stat | grep cpu \necho $seperator \n" "cat /proc/stat | grep cpu \necho $seperator \n"
"uptime \necho $seperator \n" "uptime \necho $seperator \n"

View File

@@ -23,5 +23,6 @@ class SettingStore extends PersistentStore {
StoreProperty<bool> get firstTimeUseSshTerm => StoreProperty<bool> get firstTimeUseSshTerm =>
property('firstTimeUseSshTerm', defaultValue: true); 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 m11(time) => "Spent time: ${time}";
static String m12(url) => 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}]?"; 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 m11(time) => "耗时: ${time}";
static String m12(url) => static String m12(url) => "该功能目前处于测试阶段。\n\n请在 ${url} 反馈问题,或者加入我们开发。";
"该功能目前处于测试阶段。\n\n例如iOS上输入法无法退格。请使用输入法上方的虚拟键。\n\n请在 ${url} 反馈问题,或者加入我们开发。";
static String m13(name) => "确定删除[${name}]"; 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) { String sshTip(Object url) {
return Intl.message( 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', name: 'sshTip',
desc: '', desc: '',
args: [url], args: [url],

View File

@@ -126,7 +126,7 @@
"showDistLogo": "Show distribution logo", "showDistLogo": "Show distribution logo",
"snippet": "Snippet", "snippet": "Snippet",
"spentTime": "Spent time: {time}", "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", "start": "Start",
"stop": "Stop", "stop": "Stop",
"sureDelete": "Are you sure to delete [{name}]?", "sureDelete": "Are you sure to delete [{name}]?",

View File

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

View File

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