mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
new: setting of default collapse
This commit is contained in:
@@ -298,6 +298,18 @@ abstract class S {
|
|||||||
/// **'Command'**
|
/// **'Command'**
|
||||||
String get cmd;
|
String get cmd;
|
||||||
|
|
||||||
|
/// No description provided for @collapseUI.
|
||||||
|
///
|
||||||
|
/// In en, this message translates to:
|
||||||
|
/// **'Collapse'**
|
||||||
|
String get collapseUI;
|
||||||
|
|
||||||
|
/// No description provided for @collapseUITip.
|
||||||
|
///
|
||||||
|
/// In en, this message translates to:
|
||||||
|
/// **'Whether to collapse long lists present in the UI by default'**
|
||||||
|
String get collapseUITip;
|
||||||
|
|
||||||
/// No description provided for @conn.
|
/// No description provided for @conn.
|
||||||
///
|
///
|
||||||
/// In en, this message translates to:
|
/// In en, this message translates to:
|
||||||
|
|||||||
@@ -105,6 +105,12 @@ class SDe extends S {
|
|||||||
@override
|
@override
|
||||||
String get cmd => 'Command';
|
String get cmd => 'Command';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get collapseUI => 'Zusammenbrechen';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get collapseUITip => 'Ob lange Listen in der Benutzeroberfläche standardmäßig eingeklappt werden sollen oder nicht';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get conn => 'Verbindung';
|
String get conn => 'Verbindung';
|
||||||
|
|
||||||
|
|||||||
@@ -105,6 +105,12 @@ class SEn extends S {
|
|||||||
@override
|
@override
|
||||||
String get cmd => 'Command';
|
String get cmd => 'Command';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get collapseUI => 'Collapse';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get collapseUITip => 'Whether to collapse long lists present in the UI by default';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get conn => 'Connection';
|
String get conn => 'Connection';
|
||||||
|
|
||||||
|
|||||||
@@ -105,6 +105,12 @@ class SFr extends S {
|
|||||||
@override
|
@override
|
||||||
String get cmd => 'Commande';
|
String get cmd => 'Commande';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get collapseUI => 'обвал';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get collapseUITip => 'Réduction ou non des longues listes présentes dans l\'interface utilisateur par défaut';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get conn => 'Connexion';
|
String get conn => 'Connexion';
|
||||||
|
|
||||||
|
|||||||
@@ -105,6 +105,12 @@ class SId extends S {
|
|||||||
@override
|
@override
|
||||||
String get cmd => 'Memerintah';
|
String get cmd => 'Memerintah';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get collapseUI => 'Runtuh';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get collapseUITip => 'Apakah akan menciutkan daftar panjang yang ada di UI secara default atau tidak';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get conn => 'Koneksi';
|
String get conn => 'Koneksi';
|
||||||
|
|
||||||
|
|||||||
@@ -105,6 +105,12 @@ class SZh extends S {
|
|||||||
@override
|
@override
|
||||||
String get cmd => '命令';
|
String get cmd => '命令';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get collapseUI => '折叠';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get collapseUITip => '是否默认折叠UI中存在的长列表';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get conn => '连接';
|
String get conn => '连接';
|
||||||
|
|
||||||
@@ -918,6 +924,12 @@ class SZhTw extends SZh {
|
|||||||
@override
|
@override
|
||||||
String get cmd => '命令';
|
String get cmd => '命令';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get collapseUI => '折疊';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get collapseUITip => '是否預設折疊UI中存在的長列表';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get conn => '連接';
|
String get conn => '連接';
|
||||||
|
|
||||||
|
|||||||
23
lib/app.dart
23
lib/app.dart
@@ -1,23 +1,24 @@
|
|||||||
import 'package:dynamic_color/dynamic_color.dart';
|
import 'package:dynamic_color/dynamic_color.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||||
|
import 'package:toolbox/core/analysis.dart';
|
||||||
import 'package:toolbox/core/extension/context/common.dart';
|
import 'package:toolbox/core/extension/context/common.dart';
|
||||||
import 'package:toolbox/core/extension/locale.dart';
|
import 'package:toolbox/core/extension/locale.dart';
|
||||||
|
import 'package:toolbox/core/update.dart';
|
||||||
|
import 'package:toolbox/core/utils/ui.dart';
|
||||||
|
import 'package:toolbox/data/res/build_data.dart';
|
||||||
|
import 'package:toolbox/data/res/color.dart';
|
||||||
import 'package:toolbox/data/res/rebuild.dart';
|
import 'package:toolbox/data/res/rebuild.dart';
|
||||||
import 'package:toolbox/data/res/store.dart';
|
import 'package:toolbox/data/res/store.dart';
|
||||||
|
import 'package:toolbox/view/page/full_screen.dart';
|
||||||
import 'core/utils/ui.dart';
|
import 'package:toolbox/view/page/home.dart';
|
||||||
import 'data/res/build_data.dart';
|
|
||||||
import 'data/res/color.dart';
|
|
||||||
import 'view/page/full_screen.dart';
|
|
||||||
import 'view/page/home.dart';
|
|
||||||
|
|
||||||
class MyApp extends StatelessWidget {
|
class MyApp extends StatelessWidget {
|
||||||
const MyApp({super.key});
|
const MyApp({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
setTransparentNavigationBar(context);
|
_setup(context);
|
||||||
return ListenableBuilder(
|
return ListenableBuilder(
|
||||||
listenable: RebuildNodes.app,
|
listenable: RebuildNodes.app,
|
||||||
builder: (_, __) {
|
builder: (_, __) {
|
||||||
@@ -83,6 +84,14 @@ class MyApp extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _setup(BuildContext context) async {
|
||||||
|
setTransparentNavigationBar(context);
|
||||||
|
if (Stores.setting.autoCheckAppUpdate.fetch()) {
|
||||||
|
doUpdate(context);
|
||||||
|
}
|
||||||
|
Analysis.init();
|
||||||
|
}
|
||||||
|
|
||||||
ThemeData _getAmoledTheme(ThemeData darkTheme) => darkTheme.copyWith(
|
ThemeData _getAmoledTheme(ThemeData darkTheme) => darkTheme.copyWith(
|
||||||
scaffoldBackgroundColor: Colors.black,
|
scaffoldBackgroundColor: Colors.black,
|
||||||
dialogBackgroundColor: Colors.black,
|
dialogBackgroundColor: Colors.black,
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ class Analysis {
|
|||||||
static bool enabled = false;
|
static bool enabled = false;
|
||||||
|
|
||||||
static Future<void> init() async {
|
static Future<void> init() async {
|
||||||
|
if (enabled) return;
|
||||||
if (!BuildMode.isRelease) {
|
if (!BuildMode.isRelease) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:toolbox/data/res/misc.dart';
|
import 'package:toolbox/data/res/misc.dart';
|
||||||
|
import 'package:toolbox/data/res/store.dart';
|
||||||
|
|
||||||
abstract final class HomeWidgetMC {
|
abstract final class HomeWidgetMC {
|
||||||
static const _channel = MethodChannel('${Miscs.pkgName}/home_widget');
|
static const _channel = MethodChannel('${Miscs.pkgName}/home_widget');
|
||||||
|
|
||||||
static void update() {
|
static void update() {
|
||||||
|
if (!Stores.setting.autoUpdateHomeWidget.fetch()) return;
|
||||||
_channel.invokeMethod('update');
|
_channel.invokeMethod('update');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -205,6 +205,9 @@ class SettingStore extends PersistentStore {
|
|||||||
late final webdavUser = property('webdavUser', '');
|
late final webdavUser = property('webdavUser', '');
|
||||||
late final webdavPwd = property('webdavPwd', '');
|
late final webdavPwd = property('webdavPwd', '');
|
||||||
|
|
||||||
|
/// Whether collapse UI items by default
|
||||||
|
late final collapseUIDefault = property('collapseUIDefault', true);
|
||||||
|
|
||||||
// Never show these settings for users
|
// Never show these settings for users
|
||||||
//
|
//
|
||||||
// ------BEGIN------
|
// ------BEGIN------
|
||||||
|
|||||||
@@ -33,6 +33,8 @@
|
|||||||
"clear": "Entfernen",
|
"clear": "Entfernen",
|
||||||
"close": "Schließen",
|
"close": "Schließen",
|
||||||
"cmd": "Command",
|
"cmd": "Command",
|
||||||
|
"collapseUI": "Zusammenbrechen",
|
||||||
|
"collapseUITip": "Ob lange Listen in der Benutzeroberfläche standardmäßig eingeklappt werden sollen oder nicht",
|
||||||
"conn": "Verbindung",
|
"conn": "Verbindung",
|
||||||
"connected": "in Verbindung gebracht",
|
"connected": "in Verbindung gebracht",
|
||||||
"containerName": "Container Name",
|
"containerName": "Container Name",
|
||||||
|
|||||||
@@ -33,6 +33,8 @@
|
|||||||
"clear": "Clear",
|
"clear": "Clear",
|
||||||
"close": "Close",
|
"close": "Close",
|
||||||
"cmd": "Command",
|
"cmd": "Command",
|
||||||
|
"collapseUI": "Collapse",
|
||||||
|
"collapseUITip": "Whether to collapse long lists present in the UI by default",
|
||||||
"conn": "Connection",
|
"conn": "Connection",
|
||||||
"connected": "Connected",
|
"connected": "Connected",
|
||||||
"containerName": "Container name",
|
"containerName": "Container name",
|
||||||
|
|||||||
@@ -33,6 +33,8 @@
|
|||||||
"clear": "Effacer",
|
"clear": "Effacer",
|
||||||
"close": "Fermer",
|
"close": "Fermer",
|
||||||
"cmd": "Commande",
|
"cmd": "Commande",
|
||||||
|
"collapseUI": "обвал",
|
||||||
|
"collapseUITip": "Réduction ou non des longues listes présentes dans l'interface utilisateur par défaut",
|
||||||
"conn": "Connexion",
|
"conn": "Connexion",
|
||||||
"connected": "Connecté",
|
"connected": "Connecté",
|
||||||
"containerName": "Nom du conteneur",
|
"containerName": "Nom du conteneur",
|
||||||
|
|||||||
@@ -33,6 +33,8 @@
|
|||||||
"clear": "Jernih",
|
"clear": "Jernih",
|
||||||
"close": "Menutup",
|
"close": "Menutup",
|
||||||
"cmd": "Memerintah",
|
"cmd": "Memerintah",
|
||||||
|
"collapseUI": "Runtuh",
|
||||||
|
"collapseUITip": "Apakah akan menciutkan daftar panjang yang ada di UI secara default atau tidak",
|
||||||
"conn": "Koneksi",
|
"conn": "Koneksi",
|
||||||
"connected": "Terhubung",
|
"connected": "Terhubung",
|
||||||
"containerName": "Nama kontainer",
|
"containerName": "Nama kontainer",
|
||||||
|
|||||||
@@ -33,6 +33,8 @@
|
|||||||
"clear": "清除",
|
"clear": "清除",
|
||||||
"close": "关闭",
|
"close": "关闭",
|
||||||
"cmd": "命令",
|
"cmd": "命令",
|
||||||
|
"collapseUI": "折叠",
|
||||||
|
"collapseUITip": "是否默认折叠UI中存在的长列表",
|
||||||
"conn": "连接",
|
"conn": "连接",
|
||||||
"connected": "已连接",
|
"connected": "已连接",
|
||||||
"containerName": "容器名",
|
"containerName": "容器名",
|
||||||
|
|||||||
@@ -33,6 +33,8 @@
|
|||||||
"clear": "清除",
|
"clear": "清除",
|
||||||
"close": "關閉",
|
"close": "關閉",
|
||||||
"cmd": "命令",
|
"cmd": "命令",
|
||||||
|
"collapseUI": "折疊",
|
||||||
|
"collapseUITip": "是否預設折疊UI中存在的長列表",
|
||||||
"conn": "連接",
|
"conn": "連接",
|
||||||
"connected": "已連接",
|
"connected": "已連接",
|
||||||
"containerName": "容器名稱",
|
"containerName": "容器名稱",
|
||||||
|
|||||||
@@ -16,9 +16,7 @@ import 'package:toolbox/data/res/logger.dart';
|
|||||||
import 'package:toolbox/data/res/provider.dart';
|
import 'package:toolbox/data/res/provider.dart';
|
||||||
import 'package:toolbox/data/res/store.dart';
|
import 'package:toolbox/data/res/store.dart';
|
||||||
|
|
||||||
import '../../core/analysis.dart';
|
|
||||||
import '../../core/route.dart';
|
import '../../core/route.dart';
|
||||||
import '../../core/update.dart';
|
|
||||||
import '../../core/utils/ui.dart';
|
import '../../core/utils/ui.dart';
|
||||||
import '../../data/model/app/github_id.dart';
|
import '../../data/model/app/github_id.dart';
|
||||||
import '../../data/model/app/tab.dart';
|
import '../../data/model/app/tab.dart';
|
||||||
@@ -87,7 +85,7 @@ class _HomePageState extends State<HomePage>
|
|||||||
if (!Pros.server.isAutoRefreshOn) {
|
if (!Pros.server.isAutoRefreshOn) {
|
||||||
Pros.server.startAutoRefresh();
|
Pros.server.startAutoRefresh();
|
||||||
}
|
}
|
||||||
updateHomeWidget();
|
HomeWidgetMC.update();
|
||||||
break;
|
break;
|
||||||
case AppLifecycleState.paused:
|
case AppLifecycleState.paused:
|
||||||
// Keep running in background on Android device
|
// Keep running in background on Android device
|
||||||
@@ -323,22 +321,10 @@ class _HomePageState extends State<HomePage>
|
|||||||
Future<void> afterFirstLayout(BuildContext context) async {
|
Future<void> afterFirstLayout(BuildContext context) async {
|
||||||
// Auth required for first launch
|
// Auth required for first launch
|
||||||
_auth();
|
_auth();
|
||||||
if (Stores.setting.autoCheckAppUpdate.fetch()) {
|
HomeWidgetMC.update();
|
||||||
doUpdate(context);
|
|
||||||
}
|
|
||||||
updateHomeWidget();
|
|
||||||
await GetIt.I.allReady();
|
await GetIt.I.allReady();
|
||||||
await Pros.server.load();
|
await Pros.server.load();
|
||||||
await Pros.server.refreshData();
|
await Pros.server.refreshData();
|
||||||
if (!Analysis.enabled) {
|
|
||||||
Analysis.init();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void updateHomeWidget() {
|
|
||||||
if (Stores.setting.autoUpdateHomeWidget.fetch()) {
|
|
||||||
HomeWidgetMC.update();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _onLongPressSetting() async {
|
Future<void> _onLongPressSetting() async {
|
||||||
|
|||||||
@@ -38,11 +38,6 @@ class ServerDetailPage extends StatefulWidget {
|
|||||||
|
|
||||||
class _ServerDetailPageState extends State<ServerDetailPage>
|
class _ServerDetailPageState extends State<ServerDetailPage>
|
||||||
with SingleTickerProviderStateMixin {
|
with SingleTickerProviderStateMixin {
|
||||||
late MediaQueryData _media;
|
|
||||||
final Order<String> _cardsOrder = [];
|
|
||||||
|
|
||||||
late final _textFactor = TextScaler.linear(Stores.setting.textFactor.fetch());
|
|
||||||
|
|
||||||
late final _cardBuildMap = Map.fromIterables(
|
late final _cardBuildMap = Map.fromIterables(
|
||||||
Defaults.detailCardOrder,
|
Defaults.detailCardOrder,
|
||||||
[
|
[
|
||||||
@@ -58,7 +53,12 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
var _netSortType = _NetSortType.device;
|
late MediaQueryData _media;
|
||||||
|
final Order<String> _cardsOrder = [];
|
||||||
|
|
||||||
|
final _netSortType = ValueNotifier(_NetSortType.device);
|
||||||
|
late final _collapse = Stores.setting.collapseUIDefault.fetch();
|
||||||
|
late final _textFactor = TextScaler.linear(Stores.setting.textFactor.fetch());
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void didChangeDependencies() {
|
void didChangeDependencies() {
|
||||||
@@ -127,7 +127,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
|||||||
return CardX(
|
return CardX(
|
||||||
child: ExpandTile(
|
child: ExpandTile(
|
||||||
leading: const Icon(Icons.computer),
|
leading: const Icon(Icons.computer),
|
||||||
initiallyExpanded: ss.more.entries.length < 7,
|
initiallyExpanded: _getInitExpand(ss.more.entries.length),
|
||||||
title: Text(l10n.about),
|
title: Text(l10n.about),
|
||||||
childrenPadding: const EdgeInsets.symmetric(
|
childrenPadding: const EdgeInsets.symmetric(
|
||||||
horizontal: 17,
|
horizontal: 17,
|
||||||
@@ -175,7 +175,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
childrenPadding: const EdgeInsets.symmetric(vertical: 13),
|
childrenPadding: const EdgeInsets.symmetric(vertical: 13),
|
||||||
initiallyExpanded: ss.cpu.coresCount <= 8,
|
initiallyExpanded: _getInitExpand(ss.cpu.coresCount),
|
||||||
trailing: Row(
|
trailing: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: details,
|
children: details,
|
||||||
@@ -319,7 +319,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
|||||||
child: ExpandTile(
|
child: ExpandTile(
|
||||||
title: const Text('GPU'),
|
title: const Text('GPU'),
|
||||||
leading: const Icon(Icons.memory, size: 17),
|
leading: const Icon(Icons.memory, size: 17),
|
||||||
initiallyExpanded: children.length <= 3,
|
initiallyExpanded: _getInitExpand(children.length, 3),
|
||||||
children: children,
|
children: children,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -453,7 +453,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
|||||||
title: Text(l10n.disk),
|
title: Text(l10n.disk),
|
||||||
childrenPadding: const EdgeInsets.only(bottom: 7),
|
childrenPadding: const EdgeInsets.only(bottom: 7),
|
||||||
leading: const Icon(Icons.storage, size: 17),
|
leading: const Icon(Icons.storage, size: 17),
|
||||||
initiallyExpanded: children.length <= 7,
|
initiallyExpanded: _getInitExpand(children.length),
|
||||||
children: children,
|
children: children,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -518,7 +518,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
|||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
final devices = ns.devices;
|
final devices = ns.devices;
|
||||||
devices.sort(_netSortType.getSortFunc(ns));
|
devices.sort(_netSortType.value.getSortFunc(ns));
|
||||||
children.addAll(devices.map((e) => _buildNetSpeedItem(ns, e)));
|
children.addAll(devices.map((e) => _buildNetSpeedItem(ns, e)));
|
||||||
}
|
}
|
||||||
return CardX(
|
return CardX(
|
||||||
@@ -527,36 +527,31 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
|||||||
children: [
|
children: [
|
||||||
Text(l10n.net),
|
Text(l10n.net),
|
||||||
UIs.width13,
|
UIs.width13,
|
||||||
IconButton(
|
ValueListenableBuilder(
|
||||||
onPressed: () {
|
valueListenable: _netSortType,
|
||||||
setState(() {
|
builder: (_, val, __) => AnimatedSwitcher(
|
||||||
_netSortType = _netSortType.next;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
icon: AnimatedSwitcher(
|
|
||||||
duration: const Duration(milliseconds: 377),
|
duration: const Duration(milliseconds: 377),
|
||||||
transitionBuilder: (child, animation) => FadeTransition(
|
transitionBuilder: (child, animation) => FadeTransition(
|
||||||
opacity: animation,
|
opacity: animation,
|
||||||
child: child,
|
child: child,
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
key: ValueKey(_netSortType),
|
|
||||||
children: [
|
children: [
|
||||||
const Icon(Icons.sort, size: 17),
|
const Icon(Icons.sort, size: 17),
|
||||||
UIs.width7,
|
UIs.width7,
|
||||||
Text(
|
Text(
|
||||||
_netSortType.name,
|
val.name,
|
||||||
style: UIs.text13Grey,
|
style: UIs.text13Grey,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
).tap(onTap: () => _netSortType.value = val.next),
|
||||||
),
|
),
|
||||||
)
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
childrenPadding: const EdgeInsets.only(bottom: 11),
|
childrenPadding: const EdgeInsets.only(bottom: 11),
|
||||||
leading: const Icon(Icons.device_hub, size: 17),
|
leading: const Icon(Icons.device_hub, size: 17),
|
||||||
initiallyExpanded: children.length <= 7,
|
initiallyExpanded: _getInitExpand(children.length),
|
||||||
children: children,
|
children: children,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -589,7 +584,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
width: 170,
|
width: 170,
|
||||||
child: Text(
|
child: Text(
|
||||||
'↑ ${ns.speedOut(device: device)}\n↓ ${ns.speedIn(device: device)}',
|
'${ns.speedOut(device: device)} ↑\n${ns.speedIn(device: device)} ↓',
|
||||||
textAlign: TextAlign.end,
|
textAlign: TextAlign.end,
|
||||||
style: UIs.text13Grey,
|
style: UIs.text13Grey,
|
||||||
),
|
),
|
||||||
@@ -607,7 +602,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
|||||||
child: ExpandTile(
|
child: ExpandTile(
|
||||||
title: Text(l10n.temperature),
|
title: Text(l10n.temperature),
|
||||||
leading: const Icon(Icons.ac_unit, size: 17),
|
leading: const Icon(Icons.ac_unit, size: 17),
|
||||||
initiallyExpanded: ss.temps.devices.length <= 7,
|
initiallyExpanded: _getInitExpand(ss.temps.devices.length),
|
||||||
childrenPadding: const EdgeInsets.only(bottom: 7),
|
childrenPadding: const EdgeInsets.only(bottom: 7),
|
||||||
children: ss.temps.devices
|
children: ss.temps.devices
|
||||||
.map((key) => _buildTemperatureItem(key, ss.temps.get(key)))
|
.map((key) => _buildTemperatureItem(key, ss.temps.get(key)))
|
||||||
@@ -638,6 +633,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
|||||||
title: Text(l10n.battery),
|
title: Text(l10n.battery),
|
||||||
leading: const Icon(Icons.battery_charging_full, size: 17),
|
leading: const Icon(Icons.battery_charging_full, size: 17),
|
||||||
childrenPadding: const EdgeInsets.only(bottom: 7),
|
childrenPadding: const EdgeInsets.only(bottom: 7),
|
||||||
|
initiallyExpanded: _getInitExpand(ss.batteries.length),
|
||||||
children: ss.batteries.map(_buildBatteryItem).toList(),
|
children: ss.batteries.map(_buildBatteryItem).toList(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -684,6 +680,11 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool _getInitExpand(int len, [int? max]) {
|
||||||
|
if (_collapse && len <= (max ?? 7)) return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enum _NetSortType {
|
enum _NetSortType {
|
||||||
|
|||||||
@@ -139,6 +139,7 @@ class _SettingPageState extends State<SettingPage> {
|
|||||||
body: ListView(
|
body: ListView(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 17),
|
padding: const EdgeInsets.symmetric(horizontal: 17),
|
||||||
children: [
|
children: [
|
||||||
|
/// TODO: Remember add new items in front of the each list, so the user can easily find the new items
|
||||||
_buildTitle('App'),
|
_buildTitle('App'),
|
||||||
_buildApp(),
|
_buildApp(),
|
||||||
_buildTitle(l10n.server),
|
_buildTitle(l10n.server),
|
||||||
@@ -203,6 +204,7 @@ class _SettingPageState extends State<SettingPage> {
|
|||||||
Widget _buildServer() {
|
Widget _buildServer() {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
|
_buildCollapseUI(),
|
||||||
_buildServerFuncBtns(),
|
_buildServerFuncBtns(),
|
||||||
_buildSequence(),
|
_buildSequence(),
|
||||||
_buildNetViewType(),
|
_buildNetViewType(),
|
||||||
@@ -1104,4 +1106,12 @@ class _SettingPageState extends State<SettingPage> {
|
|||||||
trailing: StoreSwitch(prop: _setting.editorHighlight),
|
trailing: StoreSwitch(prop: _setting.editorHighlight),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _buildCollapseUI() {
|
||||||
|
return ListTile(
|
||||||
|
title: Text(l10n.collapseUI),
|
||||||
|
subtitle: Text(l10n.collapseUITip, style: UIs.textGrey),
|
||||||
|
trailing: StoreSwitch(prop: _setting.collapseUIDefault),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ class _InputState extends State<Input> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return CardX(
|
return CardX(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 17),
|
padding: const EdgeInsets.symmetric(horizontal: 7),
|
||||||
child: TextField(
|
child: TextField(
|
||||||
controller: widget.controller,
|
controller: widget.controller,
|
||||||
maxLines: widget.maxLines,
|
maxLines: widget.maxLines,
|
||||||
|
|||||||
Reference in New Issue
Block a user