opt.: migrate fl_lib
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
|
||||
class BuildData {
|
||||
static const String name = "ServerBox";
|
||||
static const int build = 893;
|
||||
static const int build = 896;
|
||||
static const String engine = "3.19.6";
|
||||
static const String buildAt = "2024-05-10 20:57:55";
|
||||
static const int modifications = 8;
|
||||
static const String buildAt = "2024-05-12 15:46:37";
|
||||
static const int modifications = 3;
|
||||
static const int script = 47;
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../model/app/dynamic_color.dart';
|
||||
|
||||
var primaryColor = const Color(0xff8b2252);
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
import 'package:logging/logging.dart';
|
||||
|
||||
abstract final class Loggers {
|
||||
static final root = Logger('Root');
|
||||
static final app = Logger('App');
|
||||
static final parse = Logger('Parse');
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:toolbox/core/utils/platform/base.dart';
|
||||
import 'package:toolbox/core/utils/platform/path.dart';
|
||||
|
||||
abstract final class Paths {
|
||||
static String? _docDir;
|
||||
static String? _sftpDir;
|
||||
static String? _fontDir;
|
||||
|
||||
static Future<String> get doc async {
|
||||
if (_docDir != null) {
|
||||
return _docDir!;
|
||||
}
|
||||
if (isAndroid) {
|
||||
final dir = await getExternalStorageDirectory();
|
||||
if (dir != null) {
|
||||
_docDir = dir.path;
|
||||
return dir.path;
|
||||
}
|
||||
// fallthrough to getApplicationDocumentsDirectory
|
||||
}
|
||||
final dir = await getApplicationDocumentsDirectory();
|
||||
_docDir = dir.path;
|
||||
return dir.path;
|
||||
}
|
||||
|
||||
static Future<String> get sftp async {
|
||||
if (_sftpDir != null) {
|
||||
return _sftpDir!;
|
||||
}
|
||||
_sftpDir = '${await doc}/sftp';
|
||||
final dir = Directory(_sftpDir!);
|
||||
await dir.create(recursive: true);
|
||||
return _sftpDir!;
|
||||
}
|
||||
|
||||
static Future<String> get font async {
|
||||
if (_fontDir != null) {
|
||||
return _fontDir!;
|
||||
}
|
||||
_fontDir = '${await doc}/font';
|
||||
final dir = Directory(_fontDir!);
|
||||
await dir.create(recursive: true);
|
||||
return _fontDir!;
|
||||
}
|
||||
|
||||
static const String bakName = 'srvbox_bak.json';
|
||||
|
||||
static Future<String> get bak async => '${await doc}/$bakName';
|
||||
|
||||
static Future<String> get dl async => joinPath(await doc, 'dl');
|
||||
}
|
||||
@@ -4,15 +4,14 @@ import 'package:toolbox/data/provider/private_key.dart';
|
||||
import 'package:toolbox/data/provider/server.dart';
|
||||
import 'package:toolbox/data/provider/sftp.dart';
|
||||
import 'package:toolbox/data/provider/snippet.dart';
|
||||
import 'package:toolbox/locator.dart';
|
||||
|
||||
abstract final class Pros {
|
||||
static final app = locator<AppProvider>();
|
||||
static final debug = locator<DebugProvider>();
|
||||
static final key = locator<PrivateKeyProvider>();
|
||||
static final server = locator<ServerProvider>();
|
||||
static final sftp = locator<SftpProvider>();
|
||||
static final snippet = locator<SnippetProvider>();
|
||||
static final app = AppProvider();
|
||||
static final debug = DebugProvider();
|
||||
static final key = PrivateKeyProvider();
|
||||
static final server = ServerProvider();
|
||||
static final sftp = SftpProvider();
|
||||
static final snippet = SnippetProvider();
|
||||
|
||||
static void reload() {
|
||||
key.load();
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
import 'package:toolbox/core/persistant_store.dart';
|
||||
import 'package:fl_lib/fl_lib.dart';
|
||||
import 'package:toolbox/data/store/container.dart';
|
||||
import 'package:toolbox/data/store/history.dart';
|
||||
import 'package:toolbox/data/store/private_key.dart';
|
||||
import 'package:toolbox/data/store/server.dart';
|
||||
import 'package:toolbox/data/store/setting.dart';
|
||||
import 'package:toolbox/data/store/snippet.dart';
|
||||
import 'package:toolbox/locator.dart';
|
||||
|
||||
abstract final class Stores {
|
||||
static final setting = locator<SettingStore>();
|
||||
static final server = locator<ServerStore>();
|
||||
static final container = locator<ContainerStore>();
|
||||
static final history = locator<HistoryStore>();
|
||||
static final key = locator<PrivateKeyStore>();
|
||||
static final snippet = locator<SnippetStore>();
|
||||
static final setting = SettingStore();
|
||||
static final server = ServerStore();
|
||||
static final container = ContainerStore();
|
||||
static final history = HistoryStore();
|
||||
static final key = PrivateKeyStore();
|
||||
static final snippet = SnippetStore();
|
||||
|
||||
static final List<PersistentStore> all = [
|
||||
setting,
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
abstract final class UIs {
|
||||
/// Font style
|
||||
|
||||
static const text11 = TextStyle(fontSize: 11);
|
||||
static const text11Bold = TextStyle(
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.w500,
|
||||
);
|
||||
static const text11Grey = TextStyle(color: Colors.grey, fontSize: 11);
|
||||
static const text12 = TextStyle(fontSize: 12);
|
||||
static const text12Bold = TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.bold,
|
||||
);
|
||||
static const text12Grey = TextStyle(color: Colors.grey, fontSize: 12);
|
||||
static const text13 = TextStyle(fontSize: 13);
|
||||
static const text13Bold = TextStyle(
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.bold,
|
||||
);
|
||||
static const text13Grey = TextStyle(color: Colors.grey, fontSize: 13);
|
||||
static const text15 = TextStyle(fontSize: 15);
|
||||
static const text15Bold = TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.bold,
|
||||
);
|
||||
static const text18 = TextStyle(fontSize: 18);
|
||||
static const text27 = TextStyle(fontSize: 27);
|
||||
static const textGrey = TextStyle(color: Colors.grey);
|
||||
static const textRed = TextStyle(color: Colors.red);
|
||||
|
||||
/// Icon
|
||||
|
||||
static final appIcon = Image.asset('assets/app_icon.png');
|
||||
|
||||
/// Padding
|
||||
|
||||
static const roundRectCardPadding =
|
||||
EdgeInsets.symmetric(horizontal: 17, vertical: 13);
|
||||
|
||||
/// SizedBox
|
||||
|
||||
static const placeholder = SizedBox();
|
||||
static const height7 = SizedBox(height: 7);
|
||||
static const height13 = SizedBox(height: 13);
|
||||
static const height77 = SizedBox(height: 77);
|
||||
static const width13 = SizedBox(width: 13);
|
||||
static const width7 = SizedBox(width: 7);
|
||||
|
||||
/// Misc
|
||||
|
||||
static const popMenuChild = Padding(
|
||||
padding: EdgeInsets.only(left: 7),
|
||||
child: Icon(
|
||||
Icons.more_vert,
|
||||
size: 21,
|
||||
),
|
||||
);
|
||||
|
||||
static const centerLoading = Center(child: CircularProgressIndicator());
|
||||
|
||||
static const centerSizedLoadingSmall = SizedBox(
|
||||
width: 23,
|
||||
height: 23,
|
||||
child: Center(
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
);
|
||||
|
||||
static const centerSizedLoading = SizedBox(
|
||||
width: 77,
|
||||
height: 77,
|
||||
child: Center(
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
abstract final class Urls {
|
||||
static const cdnBase = 'https://cdn.lolli.tech/serverbox';
|
||||
static const updateCfg = '$cdnBase/update.json';
|
||||
static const myGithub = 'https://github.com/lollipopkit';
|
||||
static const appHelp = '$myGithub/flutter_server_box#-help';
|
||||
static const appWiki = '$myGithub/flutter_server_box/wiki';
|
||||
|
||||
Reference in New Issue
Block a user