mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
opt.: no Tag Switcher on desktop (#932)
This commit is contained in:
Submodule flutter_server_box.wiki deleted from f440010313
@@ -126,6 +126,7 @@ abstract final class GithubIds {
|
|||||||
'cnen2018',
|
'cnen2018',
|
||||||
'xiaomeng9597',
|
'xiaomeng9597',
|
||||||
'mingzhao2019',
|
'mingzhao2019',
|
||||||
|
'HHXXYY123',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
part of 'tab.dart';
|
part of 'tab.dart';
|
||||||
|
|
||||||
final class _TopBar extends StatelessWidget implements PreferredSizeWidget {
|
final class _TopBar extends ConsumerWidget implements PreferredSizeWidget {
|
||||||
final ValueNotifier<Set<String>> tags;
|
final ValueNotifier<Set<String>> tags;
|
||||||
final void Function(String) onTagChanged;
|
final void Function(String) onTagChanged;
|
||||||
final String initTag;
|
final String initTag;
|
||||||
@@ -8,33 +8,53 @@ final class _TopBar extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
const _TopBar({required this.initTag, required this.onTagChanged, required this.tags});
|
const _TopBar({required this.initTag, required this.onTagChanged, required this.tags});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
final isMobile = ResponsiveBreakpoints.of(context).isMobile;
|
final breakpoints = ResponsiveBreakpoints.of(context);
|
||||||
if (!isMobile) return UIs.placeholder;
|
final isMobile = breakpoints.isMobile;
|
||||||
|
final padding = EdgeInsets.only(left: isMobile ? 10 : 16, right: isMobile ? 0 : 16);
|
||||||
|
|
||||||
|
final Widget leading;
|
||||||
|
if (isMobile) {
|
||||||
|
// Keep this btn. For issue #657.
|
||||||
|
leading = InkWell(
|
||||||
|
borderRadius: BorderRadius.circular(13),
|
||||||
|
onTap: () {
|
||||||
|
SettingsPage.route.go(context);
|
||||||
|
},
|
||||||
|
child: const Padding(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 7, vertical: 3),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Text(BuildData.name, style: TextStyle(fontSize: 19)),
|
||||||
|
SizedBox(width: 5),
|
||||||
|
Icon(Icons.settings, size: 17),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
final servers = ref.watch(serversProvider);
|
||||||
|
final order = servers.serverOrder;
|
||||||
|
var connected = 0;
|
||||||
|
for (final id in order) {
|
||||||
|
final conn = ref.watch(serverProvider(id).select((value) => value.conn));
|
||||||
|
if (conn.index >= ServerConn.connected.index) connected++;
|
||||||
|
}
|
||||||
|
final total = order.length;
|
||||||
|
final connectionText = '$connected/$total ${context.l10n.conn}';
|
||||||
|
leading = Text(
|
||||||
|
connectionText,
|
||||||
|
style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w600),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.only(left: 10),
|
padding: padding,
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
// Keep this btn. For issue #657.
|
leading,
|
||||||
InkWell(
|
SizedBox(width: isMobile ? 30 : 16),
|
||||||
borderRadius: BorderRadius.circular(13),
|
|
||||||
onTap: () {
|
|
||||||
SettingsPage.route.go(context);
|
|
||||||
},
|
|
||||||
child: const Padding(
|
|
||||||
padding: EdgeInsets.symmetric(horizontal: 7, vertical: 3),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Text(BuildData.name, style: TextStyle(fontSize: 19)),
|
|
||||||
SizedBox(width: 5),
|
|
||||||
Icon(Icons.settings, size: 17),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 30),
|
|
||||||
TagSwitcher(
|
TagSwitcher(
|
||||||
tags: tags,
|
tags: tags,
|
||||||
onTagChanged: onTagChanged,
|
onTagChanged: onTagChanged,
|
||||||
|
|||||||
@@ -113,11 +113,13 @@ class _ServerOrderPageState extends ConsumerState<ServerOrderPage> {
|
|||||||
return const SizedBox();
|
return const SizedBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final name = spi.name.characters.firstOrNull ?? '?';
|
||||||
|
|
||||||
return ListTile(
|
return ListTile(
|
||||||
title: Text(spi.name, style: const TextStyle(fontWeight: FontWeight.w500)),
|
title: Text(spi.name, style: const TextStyle(fontWeight: FontWeight.w500)),
|
||||||
subtitle: Text(spi.oldId, style: UIs.textGrey),
|
subtitle: Text(spi.oldId, style: UIs.textGrey),
|
||||||
leading: CircleAvatar(
|
leading: CircleAvatar(
|
||||||
child: Text(spi.name[0]),
|
child: Text(name),
|
||||||
),
|
),
|
||||||
trailing: ReorderableDragStartListener(index: index, child: const Icon(Icons.drag_handle)),
|
trailing: ReorderableDragStartListener(index: index, child: const Icon(Icons.drag_handle)),
|
||||||
);
|
);
|
||||||
|
|||||||
16
pubspec.lock
16
pubspec.lock
@@ -504,9 +504,11 @@ packages:
|
|||||||
fl_lib:
|
fl_lib:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
path: "../fl_lib"
|
path: "."
|
||||||
relative: true
|
ref: "v1.0.351"
|
||||||
source: path
|
resolved-ref: "98d480eb0128805b5b3361bcfb07c3b46b9f1391"
|
||||||
|
url: "https://github.com/lppcg/fl_lib"
|
||||||
|
source: git
|
||||||
version: "0.0.1"
|
version: "0.0.1"
|
||||||
flutter:
|
flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
@@ -646,14 +648,6 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.1.2"
|
version: "3.1.2"
|
||||||
flutter_staggered_grid_view:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: flutter_staggered_grid_view
|
|
||||||
sha256: "19e7abb550c96fbfeb546b23f3ff356ee7c59a019a651f8f102a4ba9b7349395"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.7.0"
|
|
||||||
flutter_svg:
|
flutter_svg:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ dependencies:
|
|||||||
fl_lib:
|
fl_lib:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/lppcg/fl_lib
|
url: https://github.com/lppcg/fl_lib
|
||||||
ref: v1.0.349
|
ref: v1.0.351
|
||||||
flutter_gbk2utf8: ^1.0.1
|
flutter_gbk2utf8: ^1.0.1
|
||||||
get_it: ^8.2.0
|
get_it: ^8.2.0
|
||||||
|
|
||||||
@@ -74,8 +74,8 @@ dependency_overrides:
|
|||||||
# path: ../dartssh2
|
# path: ../dartssh2
|
||||||
# xterm:
|
# xterm:
|
||||||
# path: ../xterm.dart
|
# path: ../xterm.dart
|
||||||
fl_lib:
|
# fl_lib:
|
||||||
path: ../fl_lib
|
# path: ../fl_lib
|
||||||
# fl_build:
|
# fl_build:
|
||||||
# path: ../fl_build
|
# path: ../fl_build
|
||||||
gtk: # TODO: remove it after fixed in upstream
|
gtk: # TODO: remove it after fixed in upstream
|
||||||
|
|||||||
Reference in New Issue
Block a user