This commit is contained in:
lollipopkit
2023-11-27 17:35:15 +08:00
parent 05de760c41
commit ad49593fe3
21 changed files with 62 additions and 102 deletions

View File

@@ -1,9 +1,7 @@
import 'package:flutter/services.dart';
import 'package:toolbox/data/res/misc.dart';
class BgRunMC {
const BgRunMC._();
abstract final class BgRunMC {
static const _channel = MethodChannel('${Miscs.pkgName}/app_retain');
static void moveToBg() {

View File

@@ -1,9 +1,7 @@
import 'package:flutter/services.dart';
import 'package:toolbox/data/res/misc.dart';
class HomeWidgetMC {
const HomeWidgetMC._();
abstract final class HomeWidgetMC {
static const _channel = MethodChannel('${Miscs.pkgName}/home_widget');
static void update() {

View File

@@ -5,9 +5,7 @@ import 'package:flutter/foundation.dart';
import 'package:hive_flutter/hive_flutter.dart';
import 'package:toolbox/data/res/path.dart';
// class SecureStore {
// SecureStore._();
// abstract final class SecureStore {
// static const _secureStorage = FlutterSecureStorage();
// static HiveAesCipher? _cipher;

View File

@@ -25,11 +25,9 @@ class SyncResult<T, E> {
}
}
class ICloud {
abstract final class ICloud {
static const _containerId = 'iCloud.tech.lolli.serverbox';
const ICloud._();
/// Upload file to iCloud
///
/// - [relativePath] is the path relative to [docDir],

View File

@@ -5,9 +5,7 @@ import 'package:local_auth/local_auth.dart';
import 'package:toolbox/core/utils/platform/base.dart';
import 'package:local_auth/error_codes.dart' as errs;
class BioAuth {
const BioAuth._();
abstract final class BioAuth {
static final _auth = LocalAuthentication();
static bool get isPlatformSupported => isAndroid || isIOS || isWindows;

View File

@@ -5,9 +5,7 @@ import 'package:share_plus/share_plus.dart';
import 'package:toolbox/core/extension/context/locale.dart';
import 'package:toolbox/data/res/provider.dart';
class Shares {
const Shares._();
abstract final class Shares {
static Future<bool> files(List<String> filePaths) async {
for (final filePath in filePaths) {
if (!await File(filePath).exists()) {

View File

@@ -4,9 +4,7 @@ import '../model/app/dynamic_color.dart';
late Color primaryColor;
class DynamicColors {
const DynamicColors._();
abstract final class DynamicColors {
static const content = DynamicColor(Colors.black87, Colors.white70);
static const bg = DynamicColor(Colors.white, Colors.black);
static const progress = DynamicColor(Colors.black12, Colors.white10);

View File

@@ -2,9 +2,7 @@ import 'dart:ui';
import 'package:toolbox/data/model/ssh/virtual_key.dart';
class Defaults {
const Defaults._();
abstract final class Defaults {
// default server details page cards order
static const detailCardOrder = [
'uptime',

View File

@@ -1,10 +1,8 @@
import 'package:toolbox/data/model/app/github_id.dart';
class GithubIds {
const GithubIds._();
abstract final class GithubIds {
// Thanks
// If you want to change the url, please open an issue.
// If you want to change your Github ID, please open an issue.
static const contributors = <GhId>{
'its-tom',
'RainSunMe',
@@ -41,6 +39,8 @@ class GithubIds {
'balh55y',
'wc7086',
'michaelsara',
'xingleiwu'
'xingleiwu',
'Cooper098',
'xushuojie',
};
}

View File

@@ -32,9 +32,7 @@ import 'package:highlight/languages/vim.dart';
import 'package:highlight/languages/xml.dart';
import 'package:highlight/languages/yaml.dart';
class Highlights {
const Highlights._();
abstract final class Highlights {
/// - KEY: fileNameSuffix
/// - VAL: highlight
static final all = {

View File

@@ -1,8 +1,6 @@
import 'package:logging/logging.dart';
class Loggers {
const Loggers._();
abstract final class Loggers {
static final root = Logger('Root');
static final app = Logger('App');
static final parse = Logger('Parse');

View File

@@ -1,8 +1,6 @@
import 'dart:convert';
class Miscs {
const Miscs._();
abstract final class Miscs {
/// RegExp for number
static final numReg = RegExp(r'\s{1,}');

View File

@@ -4,9 +4,7 @@ import 'package:path_provider/path_provider.dart';
import 'package:toolbox/core/utils/platform/base.dart';
import 'package:toolbox/core/utils/platform/path.dart';
class Paths {
const Paths._();
abstract final class Paths {
static String? _docDir;
static String? _sftpDir;
static String? _fontDir;

View File

@@ -7,9 +7,7 @@ import 'package:toolbox/data/provider/sftp.dart';
import 'package:toolbox/data/provider/snippet.dart';
import 'package:toolbox/locator.dart';
class Pros {
const Pros._();
abstract final class Pros {
static final app = locator<AppProvider>();
static final debug = locator<DebugProvider>();
static final docker = locator<DockerProvider>();

View File

@@ -1,7 +1,5 @@
import 'package:toolbox/data/model/app/rebuild.dart';
class RebuildNodes {
const RebuildNodes._();
abstract final class RebuildNodes {
static final app = RebuildNode();
}

View File

@@ -8,9 +8,7 @@ import '../model/server/net_speed.dart';
import '../model/server/conn.dart';
import '../model/server/system.dart';
class InitStatus {
const InitStatus._();
abstract final class InitStatus {
static OneTimeCpuStatus get _initOneTimeCpuStatus => OneTimeCpuStatus(
'cpu',
0,

View File

@@ -7,9 +7,7 @@ import 'package:toolbox/data/store/setting.dart';
import 'package:toolbox/data/store/snippet.dart';
import 'package:toolbox/locator.dart';
class Stores {
const Stores._();
abstract final class Stores {
static final setting = locator<SettingStore>();
static final server = locator<ServerStore>();
static final docker = locator<DockerStore>();

View File

@@ -1,9 +1,7 @@
import 'package:flutter/material.dart';
import 'package:xterm/ui.dart';
class TerminalThemes {
const TerminalThemes._();
abstract final class TerminalThemes {
static const dark = TerminalTheme(
cursor: Color.fromARGB(137, 174, 175, 173),
selection: Color.fromARGB(147, 174, 175, 173),

View File

@@ -1,8 +1,6 @@
import 'package:flutter/material.dart';
class UIs {
const UIs._();
abstract final class UIs {
/// Font style
static const textSize9Grey = TextStyle(color: Colors.grey, fontSize: 9);

View File

@@ -1,6 +1,4 @@
class Urls {
const Urls._();
abstract final class Urls {
static const resBase = 'https://res.lolli.tech/serverbox';
static const myGithub = 'https://github.com/lollipopkit';
static const appHelp = '$myGithub/flutter_server_box#-help';

View File

@@ -325,8 +325,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
if (processes.isNotEmpty) {
children.addAll(processes.map((e) => _buildGpuProcessItem(e)));
}
return CardX(
ListTile(
return ListTile(
title: Text(item.name, style: UIs.textSize13),
leading: Text(
'${item.temp}°C',
@@ -366,7 +365,6 @@ class _ServerDetailPageState extends State<ServerDetailPage>
},
child: const Icon(Icons.info_outline, size: 17),
),
),
);
}