mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-18 07:44:26 +01:00
opt.: IME popup after opening drawer if ssh term is focusing
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -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),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user