opt.: IME popup after opening drawer if ssh term is focusing

This commit is contained in:
lollipopkit
2024-06-08 13:53:23 +08:00
parent b167287c5b
commit da48d1f66c
6 changed files with 36 additions and 31 deletions

View File

@@ -2,9 +2,9 @@
class BuildData {
static const String name = "ServerBox";
static const int build = 940;
static const int build = 941;
static const String engine = "3.22.1";
static const String buildAt = "2024-06-07 21:51:18";
static const int modifications = 2;
static const String buildAt = "2024-06-07 23:57:38";
static const int modifications = 4;
static const int script = 48;
}

View File

@@ -17,6 +17,7 @@ import 'package:toolbox/data/res/misc.dart';
import 'package:toolbox/data/res/provider.dart';
import 'package:toolbox/data/res/store.dart';
import 'package:toolbox/data/res/url.dart';
import 'package:toolbox/view/page/ssh/page.dart';
import 'package:wakelock_plus/wakelock_plus.dart';
part 'appbar.dart';
@@ -151,6 +152,7 @@ class _HomePageState extends State<HomePage>
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (_, index) => AppTab.values[index].page,
onPageChanged: (value) {
SSHPage.focusNode.unfocus();
if (!_switchingPage) {
_selectIndex.value = value;
}

View File

@@ -41,6 +41,8 @@ class SSHPage extends StatefulWidget {
this.terminalKey,
});
static final focusNode = FocusNode();
@override
State<SSHPage> createState() => SSHPageState();
}
@@ -159,6 +161,7 @@ class SSHPageState extends State<SSHPage> with AutomaticKeepAliveClientMixin {
CustomAppBar.barHeight ?? _media.padding.top,
),
hideScrollBar: false,
focusNode: SSHPage.focusNode,
),
),
);

View File

@@ -1,5 +1,6 @@
import 'package:fl_lib/fl_lib.dart';
import 'package:flutter/material.dart';
import 'package:icons_plus/icons_plus.dart';
import 'package:provider/provider.dart';
import 'package:toolbox/core/extension/context/locale.dart';
import 'package:toolbox/core/route.dart';
@@ -224,14 +225,13 @@ final class _TabBar extends StatelessWidget implements PreferredSizeWidget {
Widget _buillItem(int idx) {
final name = names[idx];
final selected = idxVN.value == idx;
final color =
selected ? const Color.fromARGB(240, 255, 255, 255) : Colors.grey;
final color = selected ? null : Colors.grey;
final Widget child;
if (idx == 0) {
child = Padding(
padding: const EdgeInsets.symmetric(horizontal: 13),
child: Icon(Icons.add, size: 17, color: color),
child: Icon(MingCute.add_circle_fill, size: 17, color: color),
);
} else {
final text = Text(
@@ -256,7 +256,7 @@ final class _TabBar extends StatelessWidget implements PreferredSizeWidget {
if (selected)
FadeIn(
child: IconBtn(
icon: Icons.close,
icon: MingCute.close_circle_fill,
color: color,
onTap: () => onClose(name),
),