mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
new: hideTitlebar & cupertinoRoute
This commit is contained in:
@@ -1,7 +1,9 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:toolbox/core/analysis.dart';
|
import 'package:toolbox/core/analysis.dart';
|
||||||
import 'package:toolbox/data/model/server/private_key_info.dart';
|
import 'package:toolbox/data/model/server/private_key_info.dart';
|
||||||
import 'package:toolbox/data/model/server/server_private_info.dart';
|
import 'package:toolbox/data/model/server/server_private_info.dart';
|
||||||
|
import 'package:toolbox/data/res/store.dart';
|
||||||
import 'package:toolbox/view/page/backup.dart';
|
import 'package:toolbox/view/page/backup.dart';
|
||||||
import 'package:toolbox/view/page/container.dart';
|
import 'package:toolbox/view/page/container.dart';
|
||||||
import 'package:toolbox/view/page/home/home.dart';
|
import 'package:toolbox/view/page/home/home.dart';
|
||||||
@@ -43,7 +45,9 @@ class AppRoute {
|
|||||||
Analysis.recordView(title);
|
Analysis.recordView(title);
|
||||||
return Navigator.push<T>(
|
return Navigator.push<T>(
|
||||||
context,
|
context,
|
||||||
MaterialPageRoute(builder: (context) => page),
|
Stores.setting.cupertinoRoute.fetch()
|
||||||
|
? CupertinoPageRoute(builder: (context) => page)
|
||||||
|
: MaterialPageRoute(builder: (context) => page),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -67,15 +67,21 @@ class Cpus extends TimeSeq<List<SingleCpuCore>> {
|
|||||||
double get idle => _idle;
|
double get idle => _idle;
|
||||||
double _getIdle() => 100 - usedPercent();
|
double _getIdle() => 100 - usedPercent();
|
||||||
|
|
||||||
|
void _coresLoop(void Function(int i) callback) {
|
||||||
|
/// Only update the entire core when [coresCount] > 4, or the chart will be too crowded
|
||||||
|
final onlyCalcSingle = coresCount > 4;
|
||||||
|
final maxIdx = onlyCalcSingle ? 1 : coresCount;
|
||||||
|
for (var i = onlyCalcSingle ? 0 : 1; i < maxIdx; i++) {
|
||||||
|
callback(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// [core1, core2]
|
/// [core1, core2]
|
||||||
/// core1: [FlSpot(0, 10), FlSpot(1, 20), FlSpot(2, 30)]
|
/// core1: [FlSpot(0, 10), FlSpot(1, 20), FlSpot(2, 30)]
|
||||||
final _spots = <Fifo<FlSpot>>[];
|
final _spots = <Fifo<FlSpot>>[];
|
||||||
List<Fifo<FlSpot>> get spots => _spots;
|
List<Fifo<FlSpot>> get spots => _spots;
|
||||||
void _updateSpots() {
|
void _updateSpots() {
|
||||||
/// Only update the entire core when [coresCount] > 4, or the chart will be too crowded
|
_coresLoop((i) {
|
||||||
final onlyCalcSingle = coresCount > 4;
|
|
||||||
final maxIdx = onlyCalcSingle ? 1 : coresCount;
|
|
||||||
for (var i = onlyCalcSingle ? 0 : 1; i < maxIdx; i++) {
|
|
||||||
if (i >= _spots.length) {
|
if (i >= _spots.length) {
|
||||||
_spots.add(Fifo(capacity: _kCap));
|
_spots.add(Fifo(capacity: _kCap));
|
||||||
} else {
|
} else {
|
||||||
@@ -83,7 +89,7 @@ class Cpus extends TimeSeq<List<SingleCpuCore>> {
|
|||||||
final spot = FlSpot(item.count.toDouble(), usedPercent(coreIdx: i));
|
final spot = FlSpot(item.count.toDouble(), usedPercent(coreIdx: i));
|
||||||
item.add(spot);
|
item.add(spot);
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var _rangeX = Range<double>(0.0, _kCap.toDouble());
|
var _rangeX = Range<double>(0.0, _kCap.toDouble());
|
||||||
@@ -91,16 +97,17 @@ class Cpus extends TimeSeq<List<SingleCpuCore>> {
|
|||||||
// var _rangeY = Range<double>(0.0, 100.0);
|
// var _rangeY = Range<double>(0.0, 100.0);
|
||||||
// Range<double> get rangeY => _rangeY;
|
// Range<double> get rangeY => _rangeY;
|
||||||
void _updateRange() {
|
void _updateRange() {
|
||||||
double? minX, maxX;
|
double minX = 0;
|
||||||
for (var i = 1; i < now.length; i++) {
|
double maxX = 0;
|
||||||
final item = _spots[i];
|
_coresLoop((i) {
|
||||||
if (item.isEmpty) continue;
|
final fifo = _spots[i];
|
||||||
final first = item.first.x;
|
if (fifo.isEmpty) return;
|
||||||
final last = item.last.x;
|
final first = fifo.first.x;
|
||||||
if (minX == null || first < minX) minX = first;
|
final last = fifo.last.x;
|
||||||
if (maxX == null || last > maxX) maxX = last;
|
if (first > minX) minX = first;
|
||||||
}
|
if (last > maxX) maxX = last;
|
||||||
if (minX != null && maxX != null) _rangeX = Range(minX, maxX);
|
});
|
||||||
|
_rangeX = Range(minX, maxX);
|
||||||
|
|
||||||
// double? minY, maxY;
|
// double? minY, maxY;
|
||||||
// for (var i = 1; i < now.length; i++) {
|
// for (var i = 1; i < now.length; i++) {
|
||||||
|
|||||||
@@ -256,6 +256,12 @@ class SettingStore extends PersistentStore {
|
|||||||
|
|
||||||
late final lastVer = property('lastVer', 0);
|
late final lastVer = property('lastVer', 0);
|
||||||
|
|
||||||
|
/// Use CupertinoPageRoute for all routes
|
||||||
|
late final cupertinoRoute = property('cupertinoRoute', isIOS);
|
||||||
|
|
||||||
|
/// Hide title bar on desktop
|
||||||
|
late final hideTitleBar = property('hideTitleBar', isDesktop);
|
||||||
|
|
||||||
// Never show these settings for users
|
// Never show these settings for users
|
||||||
//
|
//
|
||||||
// ------BEGIN------
|
// ------BEGIN------
|
||||||
|
|||||||
@@ -113,6 +113,7 @@
|
|||||||
"gettingToken": "Getting token...",
|
"gettingToken": "Getting token...",
|
||||||
"goBackQ": "Zurückkommen?",
|
"goBackQ": "Zurückkommen?",
|
||||||
"goto": "Pfad öffnen",
|
"goto": "Pfad öffnen",
|
||||||
|
"hideTitleBar": "Titelleiste ausblenden",
|
||||||
"highlight": "Code highlight",
|
"highlight": "Code highlight",
|
||||||
"homeWidgetUrlConfig": "Home-Widget-Link konfigurieren",
|
"homeWidgetUrlConfig": "Home-Widget-Link konfigurieren",
|
||||||
"host": "Host",
|
"host": "Host",
|
||||||
@@ -221,6 +222,7 @@
|
|||||||
"restoreSuccess": "Wiederherstellung erfolgreich. App neustarten um Änderungen anzuwenden.",
|
"restoreSuccess": "Wiederherstellung erfolgreich. App neustarten um Änderungen anzuwenden.",
|
||||||
"result": "Result",
|
"result": "Result",
|
||||||
"rotateAngel": "Rotationswinkel",
|
"rotateAngel": "Rotationswinkel",
|
||||||
|
"route": "Routen",
|
||||||
"run": "Ausführen",
|
"run": "Ausführen",
|
||||||
"running": "läuft",
|
"running": "läuft",
|
||||||
"save": "Speichern",
|
"save": "Speichern",
|
||||||
|
|||||||
@@ -113,6 +113,7 @@
|
|||||||
"gettingToken": "Getting token...",
|
"gettingToken": "Getting token...",
|
||||||
"goBackQ": "Go back?",
|
"goBackQ": "Go back?",
|
||||||
"goto": "Go to",
|
"goto": "Go to",
|
||||||
|
"hideTitleBar": "Hide title bar",
|
||||||
"highlight": "Code highlight",
|
"highlight": "Code highlight",
|
||||||
"homeWidgetUrlConfig": "Config home widget url",
|
"homeWidgetUrlConfig": "Config home widget url",
|
||||||
"host": "Host",
|
"host": "Host",
|
||||||
@@ -221,6 +222,7 @@
|
|||||||
"restoreSuccess": "Restore success. Restart app to apply.",
|
"restoreSuccess": "Restore success. Restart app to apply.",
|
||||||
"result": "Result",
|
"result": "Result",
|
||||||
"rotateAngel": "Rotation angle",
|
"rotateAngel": "Rotation angle",
|
||||||
|
"route": "Routing",
|
||||||
"run": "Run",
|
"run": "Run",
|
||||||
"running": "Running",
|
"running": "Running",
|
||||||
"save": "Save",
|
"save": "Save",
|
||||||
|
|||||||
@@ -113,6 +113,7 @@
|
|||||||
"gettingToken": "Obteniendo Token...",
|
"gettingToken": "Obteniendo Token...",
|
||||||
"goBackQ": "¿Regresar?",
|
"goBackQ": "¿Regresar?",
|
||||||
"goto": "Ir a",
|
"goto": "Ir a",
|
||||||
|
"hideTitleBar": "Ocultar barra de título",
|
||||||
"highlight": "Resaltar código",
|
"highlight": "Resaltar código",
|
||||||
"homeWidgetUrlConfig": "Configuración de URL del widget de inicio",
|
"homeWidgetUrlConfig": "Configuración de URL del widget de inicio",
|
||||||
"host": "Anfitrión",
|
"host": "Anfitrión",
|
||||||
@@ -221,6 +222,7 @@
|
|||||||
"restoreSuccess": "Restauración exitosa, necesitas reiniciar la App para aplicar cambios",
|
"restoreSuccess": "Restauración exitosa, necesitas reiniciar la App para aplicar cambios",
|
||||||
"result": "Resultado",
|
"result": "Resultado",
|
||||||
"rotateAngel": "Ángulo de rotación",
|
"rotateAngel": "Ángulo de rotación",
|
||||||
|
"route": "Enrutamiento",
|
||||||
"run": "Ejecutar",
|
"run": "Ejecutar",
|
||||||
"running": "En ejecución",
|
"running": "En ejecución",
|
||||||
"save": "Guardar",
|
"save": "Guardar",
|
||||||
|
|||||||
@@ -113,6 +113,7 @@
|
|||||||
"gettingToken": "Récupération du jeton...",
|
"gettingToken": "Récupération du jeton...",
|
||||||
"goBackQ": "Revenir en arrière ?",
|
"goBackQ": "Revenir en arrière ?",
|
||||||
"goto": "Aller à",
|
"goto": "Aller à",
|
||||||
|
"hideTitleBar": "Masquer la barre de titre",
|
||||||
"highlight": "Coloration syntaxique",
|
"highlight": "Coloration syntaxique",
|
||||||
"homeWidgetUrlConfig": "Configurer l'URL du widget d'accueil",
|
"homeWidgetUrlConfig": "Configurer l'URL du widget d'accueil",
|
||||||
"host": "Hôte",
|
"host": "Hôte",
|
||||||
@@ -221,6 +222,7 @@
|
|||||||
"restoreSuccess": "Restauration réussie. Redémarrez l'application pour l'appliquer.",
|
"restoreSuccess": "Restauration réussie. Redémarrez l'application pour l'appliquer.",
|
||||||
"result": "Résultat",
|
"result": "Résultat",
|
||||||
"rotateAngel": "Angle de rotation",
|
"rotateAngel": "Angle de rotation",
|
||||||
|
"route": "Routage",
|
||||||
"run": "Exécuter",
|
"run": "Exécuter",
|
||||||
"running": "en cours d'exécution",
|
"running": "en cours d'exécution",
|
||||||
"save": "Enregistrer",
|
"save": "Enregistrer",
|
||||||
|
|||||||
@@ -113,6 +113,7 @@
|
|||||||
"gettingToken": "Mendapatkan token ...",
|
"gettingToken": "Mendapatkan token ...",
|
||||||
"goBackQ": "Datang kembali?",
|
"goBackQ": "Datang kembali?",
|
||||||
"goto": "Pergi ke",
|
"goto": "Pergi ke",
|
||||||
|
"hideTitleBar": "Sembunyikan bilah judul",
|
||||||
"highlight": "Sorotan kode",
|
"highlight": "Sorotan kode",
|
||||||
"homeWidgetUrlConfig": "Konfigurasi URL Widget Rumah",
|
"homeWidgetUrlConfig": "Konfigurasi URL Widget Rumah",
|
||||||
"host": "Host",
|
"host": "Host",
|
||||||
@@ -221,6 +222,7 @@
|
|||||||
"restoreSuccess": "Kembalikan kesuksesan. Mulai ulang aplikasi untuk diterapkan.",
|
"restoreSuccess": "Kembalikan kesuksesan. Mulai ulang aplikasi untuk diterapkan.",
|
||||||
"result": "Hasil",
|
"result": "Hasil",
|
||||||
"rotateAngel": "Sudut rotasi",
|
"rotateAngel": "Sudut rotasi",
|
||||||
|
"route": "Routing",
|
||||||
"run": "Berlari",
|
"run": "Berlari",
|
||||||
"running": "berlari",
|
"running": "berlari",
|
||||||
"save": "Menyimpan",
|
"save": "Menyimpan",
|
||||||
|
|||||||
@@ -113,6 +113,7 @@
|
|||||||
"gettingToken": "トークンを取得しています...",
|
"gettingToken": "トークンを取得しています...",
|
||||||
"goBackQ": "戻りますか?",
|
"goBackQ": "戻りますか?",
|
||||||
"goto": "移動",
|
"goto": "移動",
|
||||||
|
"hideTitleBar": "タイトルバーを非表示にする",
|
||||||
"highlight": "コードハイライト",
|
"highlight": "コードハイライト",
|
||||||
"homeWidgetUrlConfig": "ホームウィジェットURL設定",
|
"homeWidgetUrlConfig": "ホームウィジェットURL設定",
|
||||||
"host": "ホスト",
|
"host": "ホスト",
|
||||||
@@ -221,6 +222,7 @@
|
|||||||
"restoreSuccess": "復元に成功しました。変更を適用するためにアプリを再起動する必要があります",
|
"restoreSuccess": "復元に成功しました。変更を適用するためにアプリを再起動する必要があります",
|
||||||
"result": "結果",
|
"result": "結果",
|
||||||
"rotateAngel": "回転角度",
|
"rotateAngel": "回転角度",
|
||||||
|
"route": "ルーティング",
|
||||||
"run": "実行",
|
"run": "実行",
|
||||||
"running": "実行中",
|
"running": "実行中",
|
||||||
"save": "保存",
|
"save": "保存",
|
||||||
|
|||||||
@@ -113,6 +113,7 @@
|
|||||||
"gettingToken": "Obtendo Token...",
|
"gettingToken": "Obtendo Token...",
|
||||||
"goBackQ": "Voltar?",
|
"goBackQ": "Voltar?",
|
||||||
"goto": "Ir para",
|
"goto": "Ir para",
|
||||||
|
"hideTitleBar": "Ocultar barra de título",
|
||||||
"highlight": "Destaque de código",
|
"highlight": "Destaque de código",
|
||||||
"homeWidgetUrlConfig": "Configuração de URL do widget da tela inicial",
|
"homeWidgetUrlConfig": "Configuração de URL do widget da tela inicial",
|
||||||
"host": "Host",
|
"host": "Host",
|
||||||
@@ -221,6 +222,7 @@
|
|||||||
"restoreSuccess": "Restauração bem-sucedida, é necessário reiniciar o app para aplicar as mudanças",
|
"restoreSuccess": "Restauração bem-sucedida, é necessário reiniciar o app para aplicar as mudanças",
|
||||||
"result": "Resultado",
|
"result": "Resultado",
|
||||||
"rotateAngel": "Ângulo de rotação",
|
"rotateAngel": "Ângulo de rotação",
|
||||||
|
"route": "Roteamento",
|
||||||
"run": "Executar",
|
"run": "Executar",
|
||||||
"running": "Executando",
|
"running": "Executando",
|
||||||
"save": "Salvar",
|
"save": "Salvar",
|
||||||
|
|||||||
@@ -113,6 +113,7 @@
|
|||||||
"gettingToken": "Получение токена...",
|
"gettingToken": "Получение токена...",
|
||||||
"goBackQ": "Вернуться?",
|
"goBackQ": "Вернуться?",
|
||||||
"goto": "перейти к",
|
"goto": "перейти к",
|
||||||
|
"hideTitleBar": "Скрыть заголовок",
|
||||||
"highlight": "подсветка кода",
|
"highlight": "подсветка кода",
|
||||||
"homeWidgetUrlConfig": "конфигурация URL виджета домашнего экрана",
|
"homeWidgetUrlConfig": "конфигурация URL виджета домашнего экрана",
|
||||||
"host": "хост",
|
"host": "хост",
|
||||||
@@ -221,6 +222,7 @@
|
|||||||
"restoreSuccess": "Восстановление успешно, требуется перезапуск приложения для применения изменений",
|
"restoreSuccess": "Восстановление успешно, требуется перезапуск приложения для применения изменений",
|
||||||
"result": "результат",
|
"result": "результат",
|
||||||
"rotateAngel": "угол поворота",
|
"rotateAngel": "угол поворота",
|
||||||
|
"route": "Маршрутизация",
|
||||||
"run": "запустить",
|
"run": "запустить",
|
||||||
"running": "работает",
|
"running": "работает",
|
||||||
"save": "сохранить",
|
"save": "сохранить",
|
||||||
|
|||||||
@@ -113,6 +113,7 @@
|
|||||||
"gettingToken": "正在获取Token...",
|
"gettingToken": "正在获取Token...",
|
||||||
"goBackQ": "返回?",
|
"goBackQ": "返回?",
|
||||||
"goto": "前往",
|
"goto": "前往",
|
||||||
|
"hideTitleBar": "隐藏标题栏",
|
||||||
"highlight": "代码高亮",
|
"highlight": "代码高亮",
|
||||||
"homeWidgetUrlConfig": "桌面部件链接配置",
|
"homeWidgetUrlConfig": "桌面部件链接配置",
|
||||||
"host": "主机",
|
"host": "主机",
|
||||||
@@ -221,6 +222,7 @@
|
|||||||
"restoreSuccess": "恢复成功,需要重启App来应用更改",
|
"restoreSuccess": "恢复成功,需要重启App来应用更改",
|
||||||
"result": "结果",
|
"result": "结果",
|
||||||
"rotateAngel": "旋转角度",
|
"rotateAngel": "旋转角度",
|
||||||
|
"route": "路由",
|
||||||
"run": "运行",
|
"run": "运行",
|
||||||
"running": "运行中",
|
"running": "运行中",
|
||||||
"save": "保存",
|
"save": "保存",
|
||||||
|
|||||||
@@ -113,6 +113,7 @@
|
|||||||
"gettingToken": "正在獲取Token...",
|
"gettingToken": "正在獲取Token...",
|
||||||
"goBackQ": "返回?",
|
"goBackQ": "返回?",
|
||||||
"goto": "前往",
|
"goto": "前往",
|
||||||
|
"hideTitleBar": "隱藏標題欄",
|
||||||
"highlight": "代碼高亮",
|
"highlight": "代碼高亮",
|
||||||
"homeWidgetUrlConfig": "桌面部件鏈接配置",
|
"homeWidgetUrlConfig": "桌面部件鏈接配置",
|
||||||
"host": "主機",
|
"host": "主機",
|
||||||
@@ -221,6 +222,7 @@
|
|||||||
"restoreSuccess": "恢復成功,需要重啓App來應用更改",
|
"restoreSuccess": "恢復成功,需要重啓App來應用更改",
|
||||||
"result": "結果",
|
"result": "結果",
|
||||||
"rotateAngel": "旋轉角度",
|
"rotateAngel": "旋轉角度",
|
||||||
|
"route": "路由",
|
||||||
"run": "運行",
|
"run": "運行",
|
||||||
"running": "運作中",
|
"running": "運作中",
|
||||||
"save": "保存",
|
"save": "保存",
|
||||||
|
|||||||
@@ -142,11 +142,11 @@ Future<void> _initDesktopWindow() async {
|
|||||||
await windowManager.ensureInitialized();
|
await windowManager.ensureInitialized();
|
||||||
await CustomAppBar.updateTitlebarHeight();
|
await CustomAppBar.updateTitlebarHeight();
|
||||||
|
|
||||||
const windowOptions = WindowOptions(
|
final windowOptions = WindowOptions(
|
||||||
center: true,
|
center: true,
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
skipTaskbar: false,
|
skipTaskbar: false,
|
||||||
titleBarStyle: TitleBarStyle.hidden,
|
titleBarStyle: CustomAppBar.barHeight != 0 ? TitleBarStyle.hidden : null,
|
||||||
);
|
);
|
||||||
windowManager.waitUntilReadyToShow(windowOptions, () async {
|
windowManager.waitUntilReadyToShow(windowOptions, () async {
|
||||||
await windowManager.show();
|
await windowManager.show();
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ import 'package:toolbox/view/widget/appbar.dart';
|
|||||||
import 'package:toolbox/view/widget/cardx.dart';
|
import 'package:toolbox/view/widget/cardx.dart';
|
||||||
import 'package:toolbox/view/widget/markdown.dart';
|
import 'package:toolbox/view/widget/markdown.dart';
|
||||||
|
|
||||||
|
|
||||||
part 'appbar.dart';
|
part 'appbar.dart';
|
||||||
|
|
||||||
class HomePage extends StatefulWidget {
|
class HomePage extends StatefulWidget {
|
||||||
@@ -332,6 +331,7 @@ ${GithubIds.participants.map((e) => '[$e](${e.url})').join(' ')}
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _reqNotiPerm() async {
|
Future<void> _reqNotiPerm() async {
|
||||||
|
if (!isAndroid) return;
|
||||||
final suc = await PermUtils.request(Permission.notification);
|
final suc = await PermUtils.request(Permission.notification);
|
||||||
if (!suc) {
|
if (!suc) {
|
||||||
final noNotiPerm = Stores.setting.noNotiPerm;
|
final noNotiPerm = Stores.setting.noNotiPerm;
|
||||||
|
|||||||
@@ -42,13 +42,13 @@ Widget _buildLineChart(
|
|||||||
Range<double> x, {
|
Range<double> x, {
|
||||||
String? tooltipPrefix,
|
String? tooltipPrefix,
|
||||||
bool curve = false,
|
bool curve = false,
|
||||||
|
int verticalInterval = 20,
|
||||||
}) {
|
}) {
|
||||||
return LineChart(LineChartData(
|
return LineChart(LineChartData(
|
||||||
lineTouchData: LineTouchData(
|
lineTouchData: LineTouchData(
|
||||||
touchTooltipData: LineTouchTooltipData(
|
touchTooltipData: LineTouchTooltipData(
|
||||||
tooltipPadding: const EdgeInsets.all(5),
|
tooltipPadding: const EdgeInsets.all(5),
|
||||||
tooltipRoundedRadius: 8,
|
tooltipRoundedRadius: 8,
|
||||||
tooltipMargin: 3,
|
|
||||||
getTooltipItems: (List<LineBarSpot> touchedSpots) {
|
getTooltipItems: (List<LineBarSpot> touchedSpots) {
|
||||||
return touchedSpots.map((e) {
|
return touchedSpots.map((e) {
|
||||||
return LineTooltipItem(
|
return LineTooltipItem(
|
||||||
@@ -66,11 +66,12 @@ Widget _buildLineChart(
|
|||||||
gridData: FlGridData(
|
gridData: FlGridData(
|
||||||
show: true,
|
show: true,
|
||||||
drawVerticalLine: false,
|
drawVerticalLine: false,
|
||||||
horizontalInterval: 20,
|
horizontalInterval: verticalInterval.toDouble(),
|
||||||
getDrawingHorizontalLine: (value) {
|
getDrawingHorizontalLine: (value) {
|
||||||
return const FlLine(
|
return const FlLine(
|
||||||
color: Color(0xff37434d),
|
color: Color(0xff37434d),
|
||||||
strokeWidth: 1,
|
strokeWidth: 1,
|
||||||
|
dashArray: [5, 17],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -90,21 +91,22 @@ Widget _buildLineChart(
|
|||||||
showTitles: true,
|
showTitles: true,
|
||||||
interval: 1,
|
interval: 1,
|
||||||
getTitlesWidget: (val, meta) {
|
getTitlesWidget: (val, meta) {
|
||||||
if (val % 20 != 0) return UIs.placeholder;
|
if (val % verticalInterval != 0) return UIs.placeholder;
|
||||||
|
if (val == 0) return const Text('0 %', style: UIs.text12Grey);
|
||||||
return Text(
|
return Text(
|
||||||
val.toInt().toString(),
|
val.toInt().toString(),
|
||||||
style: UIs.text12Grey,
|
style: UIs.text12Grey,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
reservedSize: 42,
|
reservedSize: 27,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
borderData: FlBorderData(show: false),
|
borderData: FlBorderData(show: false),
|
||||||
minX: x.start,
|
minX: x.start,
|
||||||
maxX: x.end,
|
maxX: x.end,
|
||||||
minY: 0,
|
minY: -1,
|
||||||
maxY: 100,
|
maxY: 101,
|
||||||
lineBarsData: spots
|
lineBarsData: spots
|
||||||
.map((e) => LineChartBarData(
|
.map((e) => LineChartBarData(
|
||||||
spots: e,
|
spots: e,
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
childrenPadding: const EdgeInsets.symmetric(vertical: 13),
|
childrenPadding: const EdgeInsets.symmetric(vertical: 13),
|
||||||
initiallyExpanded: true,
|
initiallyExpanded: _getInitExpand(1),
|
||||||
trailing: Row(
|
trailing: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: details,
|
children: details,
|
||||||
@@ -201,7 +201,6 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
|||||||
ss.cpu.spots,
|
ss.cpu.spots,
|
||||||
ss.cpu.rangeX,
|
ss.cpu.rangeX,
|
||||||
tooltipPrefix: 'CPU',
|
tooltipPrefix: 'CPU',
|
||||||
curve: true,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ class _SettingPageState extends State<SettingPage> {
|
|||||||
_buildAppColor(),
|
_buildAppColor(),
|
||||||
//_buildLaunchPage(),
|
//_buildLaunchPage(),
|
||||||
_buildCheckUpdate(),
|
_buildCheckUpdate(),
|
||||||
_buildCollapseUI(),
|
_buildAppMore(),
|
||||||
];
|
];
|
||||||
|
|
||||||
/// Platform specific settings
|
/// Platform specific settings
|
||||||
@@ -1065,4 +1065,29 @@ class _SettingPageState extends State<SettingPage> {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _buildAppMore() {
|
||||||
|
return ExpandTile(
|
||||||
|
title: Text(l10n.more),
|
||||||
|
children: [
|
||||||
|
_buildCollapseUI(),
|
||||||
|
_buildCupertinoRoute(),
|
||||||
|
if (isDesktop) _buildHideTitleBar(),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildCupertinoRoute() {
|
||||||
|
return ListTile(
|
||||||
|
title: Text('Cupertino ${l10n.route}'),
|
||||||
|
trailing: StoreSwitch(prop: _setting.cupertinoRoute),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildHideTitleBar() {
|
||||||
|
return ListTile(
|
||||||
|
title: Text(l10n.hideTitleBar),
|
||||||
|
trailing: StoreSwitch(prop: _setting.hideTitleBar),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:toolbox/data/res/store.dart';
|
||||||
import 'package:window_manager/window_manager.dart';
|
import 'package:window_manager/window_manager.dart';
|
||||||
|
|
||||||
class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
|
class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||||
@@ -84,8 +85,8 @@ class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
case 'macos':
|
case 'macos':
|
||||||
barHeight = 27;
|
barHeight = 27;
|
||||||
break;
|
break;
|
||||||
// Draw a titlebar on Linux
|
|
||||||
case 'linux' || 'windows':
|
case 'linux' || 'windows':
|
||||||
|
if (!Stores.setting.hideTitleBar.fetch()) break;
|
||||||
barHeight = 37;
|
barHeight = 37;
|
||||||
_drawTitlebar = true;
|
_drawTitlebar = true;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user