Compare commits

...

5 Commits

Author SHA1 Message Date
Junyuan Feng
bfd31e561c optimize ping page & make.dart 2022-11-07 20:15:39 +08:00
Junyuan Feng
5b8468effa rm dep. menu & optimize 2022-11-07 19:54:26 +08:00
Junyuan Feng
bd04fd3f1a rm dep. dropdownbtn 2022-11-07 19:12:17 +08:00
Junyuan Feng
398c49bb99 使用 Hive Object 2022-11-05 23:08:56 +08:00
Junyuan Feng
c036b78708 增加 armbian 头图 2022-11-05 21:58:05 +08:00
40 changed files with 761 additions and 455 deletions

View File

@@ -5,7 +5,7 @@
<!-- Badges-->
<p align="center">
<a href="https://apps.apple.com/app/serverbox-status-tools/id1586449703">
<a href="https://apps.apple.com/app/id1586449703">
<img style="height: 37px" src="screenshots/appstore.svg">
</a>
<a href="https://github.com/LollipopKit/flutter_server_box/releases/latest">

BIN
assets/linux/armbian.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View File

@@ -354,7 +354,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 153;
CURRENT_PROJECT_VERSION = 159;
DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
@@ -362,7 +362,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.153;
MARKETING_VERSION = 1.0.159;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
@@ -484,7 +484,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 153;
CURRENT_PROJECT_VERSION = 159;
DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
@@ -492,7 +492,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.153;
MARKETING_VERSION = 1.0.159;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
@@ -508,7 +508,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 153;
CURRENT_PROJECT_VERSION = 159;
DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
@@ -516,7 +516,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.153;
MARKETING_VERSION = 1.0.159;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";

View File

@@ -1,7 +1,7 @@
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:hive/hive.dart';
import 'package:hive_flutter/hive_flutter.dart';
class PersistentStore<E> {
late Box<E> box;

View File

@@ -11,14 +11,14 @@ import 'package:toolbox/data/service/app.dart';
import 'package:toolbox/generated/l10n.dart';
import 'package:toolbox/locator.dart';
final logger = Logger('UPDATE');
final _logger = Logger('UPDATE');
Future<bool> isFileAvailable(String url) async {
try {
final resp = await Dio().head(url);
return resp.statusCode == 200;
} catch (e) {
logger.warning('update file not available: $e');
_logger.warning('update file not available: $e');
return false;
}
}
@@ -40,11 +40,11 @@ Future<void> doUpdate(BuildContext context, {bool force = false}) async {
}();
if (!force && newest <= BuildData.build) {
logger.info('Update ignored due to current: ${BuildData.build}, '
_logger.info('Update ignored due to current: ${BuildData.build}, '
'update: $newest');
return;
}
logger.info('Update available: $newest');
_logger.info('Update available: $newest');
if (Platform.isAndroid && !await isFileAvailable(update.android)) {
return;

View File

@@ -10,8 +10,6 @@ import 'package:toolbox/view/widget/card_dialog.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:toolbox/core/extension/stringx.dart';
void unawaited(Future<void> future) {}
bool isDarkMode(BuildContext context) =>
Theme.of(context).brightness == Brightness.dark;
@@ -110,3 +108,21 @@ Future<bool> shareFiles(BuildContext context, List<String> filePaths) async {
await Share.shareFiles(filePaths, text: 'ServerBox -> $text');
return filePaths.isNotEmpty;
}
Widget buildPopuopMenu(
{required List<PopupMenuEntry> items,
required Function(dynamic) onSelected}) {
return PopupMenuButton(
itemBuilder: (_) => items,
onSelected: onSelected,
padding: EdgeInsets.zero,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
child: const Padding(
padding: EdgeInsets.only(left: 7),
child: Icon(
Icons.more_vert,
size: 21,
),
),
);
}

View File

@@ -9,8 +9,10 @@ const debianDistList = [
'ubuntu',
'linuxmint',
'elementary',
'raspbian'
'raspbian',
'armbian'
];
const rehlDistList = [
'redhat',
'fedora',

View File

@@ -1,53 +1,53 @@
import 'package:toolbox/data/model/server/cpu_status.dart';
class Cpu2Status {
List<CpuStatus> pre;
List<CpuStatus> now;
List<CpuStatus> _pre;
List<CpuStatus> _now;
String temp;
Cpu2Status(this.pre, this.now, this.temp);
Cpu2Status(this._pre, this._now, this.temp);
double usedPercent({int coreIdx = 0}) {
if (now.length != pre.length) return 0;
final idleDelta = now[coreIdx].idle - pre[coreIdx].idle;
final totalDelta = now[coreIdx].total - pre[coreIdx].total;
if (_now.length != _pre.length) return 0;
final idleDelta = _now[coreIdx].idle - _pre[coreIdx].idle;
final totalDelta = _now[coreIdx].total - _pre[coreIdx].total;
final used = idleDelta / totalDelta;
return used.isNaN ? 0 : 100 - used * 100;
}
void update(List<CpuStatus> newStatus, String newTemp) {
pre = now;
now = newStatus;
_pre = _now;
_now = newStatus;
temp = newTemp;
}
int get coresCount => now.length;
int get coresCount => _now.length;
int get totalDelta => now[0].total - pre[0].total;
int get totalDelta => _now[0].total - _pre[0].total;
double get user {
if (now.length != pre.length) return 0;
final delta = now[0].user - pre[0].user;
if (_now.length != _pre.length) return 0;
final delta = _now[0].user - _pre[0].user;
final used = delta / totalDelta;
return used.isNaN ? 0 : used * 100;
}
double get sys {
if (now.length != pre.length) return 0;
final delta = now[0].sys - pre[0].sys;
if (_now.length != _pre.length) return 0;
final delta = _now[0].sys - _pre[0].sys;
final used = delta / totalDelta;
return used.isNaN ? 0 : used * 100;
}
double get nice {
if (now.length != pre.length) return 0;
final delta = now[0].nice - pre[0].nice;
if (_now.length != _pre.length) return 0;
final delta = _now[0].nice - _pre[0].nice;
final used = delta / totalDelta;
return used.isNaN ? 0 : used * 100;
}
double get iowait {
if (now.length != pre.length) return 0;
final delta = now[0].iowait - pre[0].iowait;
if (_now.length != _pre.length) return 0;
final delta = _now[0].iowait - _pre[0].iowait;
final used = delta / totalDelta;
return used.isNaN ? 0 : used * 100;
}

View File

@@ -1,14 +0,0 @@
class LinuxIcons {
List<String> db;
LinuxIcons(this.db);
String? search(String sysVer) {
for (var item in db) {
if (sysVer.toLowerCase().contains(item)) {
return 'assets/linux/$item.png';
}
}
return null;
}
}

View File

@@ -9,46 +9,46 @@ class NetSpeedPart {
}
class NetSpeed {
List<NetSpeedPart> old;
List<NetSpeedPart> now;
NetSpeed(this.old, this.now);
List<NetSpeedPart> _old;
List<NetSpeedPart> _now;
NetSpeed(this._old, this._now);
List<String> get devices {
final devices = <String>[];
for (var item in now) {
for (var item in _now) {
devices.add(item.device);
}
return devices;
}
void update(List<NetSpeedPart> newOne) {
old = now;
now = newOne;
_old = _now;
_now = newOne;
}
int get timeDiff => now[0].time - old[0].time;
int get timeDiff => _now[0].time - _old[0].time;
String speedIn({String? device}) {
if (old[0].device == '' || now[0].device == '') return '0kb/s';
if (_old[0].device == '' || _now[0].device == '') return '0kb/s';
final idx = deviceIdx(device);
final speedInBytesPerSecond =
(now[idx].bytesIn - old[idx].bytesIn) / timeDiff;
(_now[idx].bytesIn - _old[idx].bytesIn) / timeDiff;
return buildStandardOutput(speedInBytesPerSecond);
}
String speedOut({String? device}) {
if (old[0].device == '' || now[0].device == '') return '0kb/s';
if (_old[0].device == '' || _now[0].device == '') return '0kb/s';
final idx = deviceIdx(device);
final speedOutBytesPerSecond =
(now[idx].bytesOut - old[idx].bytesOut) / timeDiff;
(_now[idx].bytesOut - _old[idx].bytesOut) / timeDiff;
return buildStandardOutput(speedOutBytesPerSecond);
}
int deviceIdx(String? device) {
if (device != null) {
for (var item in now) {
for (var item in _now) {
if (item.device == device) {
return now.indexOf(item);
return _now.indexOf(item);
}
}
}

View File

@@ -1,8 +1,13 @@
import 'dart:convert';
import 'package:hive_flutter/hive_flutter.dart';
part 'private_key_info.g.dart';
///
/// Code generated by jsonToDartModel https://ashamp.github.io/jsonToDartModel/
///
@HiveType(typeId: 1)
class PrivateKeyInfo {
/*
{
@@ -12,8 +17,11 @@ class PrivateKeyInfo {
}
*/
@HiveField(0)
late String id;
@HiveField(1)
late String privateKey;
@HiveField(2)
late String password;
PrivateKeyInfo(

View File

@@ -0,0 +1,47 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'private_key_info.dart';
// **************************************************************************
// TypeAdapterGenerator
// **************************************************************************
class PrivateKeyInfoAdapter extends TypeAdapter<PrivateKeyInfo> {
@override
final int typeId = 1;
@override
PrivateKeyInfo read(BinaryReader reader) {
final numOfFields = reader.readByte();
final fields = <int, dynamic>{
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
};
return PrivateKeyInfo(
fields[0] as String,
fields[1] as String,
fields[2] as String,
);
}
@override
void write(BinaryWriter writer, PrivateKeyInfo obj) {
writer
..writeByte(3)
..writeByte(0)
..write(obj.id)
..writeByte(1)
..write(obj.privateKey)
..writeByte(2)
..write(obj.password);
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is PrivateKeyInfoAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}

View File

@@ -1,8 +1,13 @@
import 'dart:convert';
import 'package:hive_flutter/hive_flutter.dart';
part 'server_private_info.g.dart';
///
/// Code generated by jsonToDartModel https://ashamp.github.io/jsonToDartModel/
///
@HiveType(typeId: 3)
class ServerPrivateInfo {
/*
{
@@ -13,13 +18,21 @@ class ServerPrivateInfo {
}
*/
@HiveField(0)
late String name;
@HiveField(1)
late String ip;
@HiveField(2)
late int port;
@HiveField(3)
late String user;
@HiveField(4)
late String pwd;
@HiveField(5)
String? pubKeyId;
String get id => '$user@$ip:$port';
ServerPrivateInfo(
{required this.name,
required this.ip,

View File

@@ -0,0 +1,56 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'server_private_info.dart';
// **************************************************************************
// TypeAdapterGenerator
// **************************************************************************
class ServerPrivateInfoAdapter extends TypeAdapter<ServerPrivateInfo> {
@override
final int typeId = 3;
@override
ServerPrivateInfo read(BinaryReader reader) {
final numOfFields = reader.readByte();
final fields = <int, dynamic>{
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
};
return ServerPrivateInfo(
name: fields[0] as String,
ip: fields[1] as String,
port: fields[2] as int,
user: fields[3] as String,
pwd: fields[4] as String,
pubKeyId: fields[5] as String?,
);
}
@override
void write(BinaryWriter writer, ServerPrivateInfo obj) {
writer
..writeByte(6)
..writeByte(0)
..write(obj.name)
..writeByte(1)
..write(obj.ip)
..writeByte(2)
..write(obj.port)
..writeByte(3)
..write(obj.user)
..writeByte(4)
..write(obj.pwd)
..writeByte(5)
..write(obj.pubKeyId);
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is ServerPrivateInfoAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}

View File

@@ -1,7 +1,14 @@
import 'dart:convert';
import 'package:hive_flutter/hive_flutter.dart';
part 'snippet.g.dart';
@HiveType(typeId: 2)
class Snippet {
@HiveField(0)
late String name;
@HiveField(1)
late String script;
Snippet(this.name, this.script);

View File

@@ -0,0 +1,44 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'snippet.dart';
// **************************************************************************
// TypeAdapterGenerator
// **************************************************************************
class SnippetAdapter extends TypeAdapter<Snippet> {
@override
final int typeId = 2;
@override
Snippet read(BinaryReader reader) {
final numOfFields = reader.readByte();
final fields = <int, dynamic>{
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
};
return Snippet(
fields[0] as String,
fields[1] as String,
);
}
@override
void write(BinaryWriter writer, Snippet obj) {
writer
..writeByte(2)
..writeByte(0)
..write(obj.name)
..writeByte(1)
..write(obj.script);
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is SnippetAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}

View File

@@ -26,7 +26,7 @@ class PrivateKeyProvider extends BusyProvider {
void updateInfo(PrivateKeyInfo old, PrivateKeyInfo newInfo) {
final idx = _infos.indexWhere((e) => e.id == old.id);
_infos[idx] = newInfo;
locator<PrivateKeyStore>().update(old, newInfo);
locator<PrivateKeyStore>().put(newInfo);
notifyListeners();
}
}

View File

@@ -38,7 +38,7 @@ class SnippetProvider extends BusyProvider {
void update(Snippet old, Snippet newOne) {
if (!have(old)) return;
_snippets[index(old)] = newOne;
locator<SnippetStore>().update(old, newOne);
locator<SnippetStore>().put(newOne);
notifyListeners();
}

View File

@@ -2,9 +2,9 @@
class BuildData {
static const String name = "ServerBox";
static const int build = 154;
static const int build = 159;
static const String engine =
"Flutter 3.3.4 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision eb6d86ee27 (2 weeks ago) • 2022-10-04 22:31:45 -0700\nEngine • revision c08d7d5efc\nTools • Dart 2.18.2 • DevTools 2.15.0\n";
static const String buildAt = "2022-10-21 17:29:42.809139";
static const int modifications = 9;
"Flutter 3.3.4 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision eb6d86ee27 (5 weeks ago) • 2022-10-04 22:31:45 -0700\nEngine • revision c08d7d5efc\nTools • Dart 2.18.2 • DevTools 2.15.0\n";
static const String buildAt = "2022-11-07 19:55:21.553007";
static const int modifications = 0;
}

View File

@@ -1,5 +1,3 @@
import 'package:toolbox/data/model/server/linux_icon.dart';
final linuxIcons = LinuxIcons([
'ubuntu',
'arch',
@@ -8,5 +6,21 @@ final linuxIcons = LinuxIcons([
'fedora',
'opensuse',
'kali',
'wrt'
'wrt',
'armbian'
]);
class LinuxIcons {
List<String> db;
LinuxIcons(this.db);
String? search(String sysVer) {
for (var item in db) {
if (sysVer.toLowerCase().contains(item)) {
return 'assets/linux/$item.png';
}
}
return null;
}
}

View File

@@ -1,38 +1,28 @@
import 'dart:convert';
import 'package:toolbox/core/persistant_store.dart';
import 'package:toolbox/data/model/server/private_key_info.dart';
class PrivateKeyStore extends PersistentStore {
void put(PrivateKeyInfo info) {
final ss = fetch();
if (!have(info)) ss.add(info);
box.put('key', json.encode(ss));
box.put(info.id, info);
}
List<PrivateKeyInfo> fetch() {
return getPrivateKeyInfoList(
json.decode(box.get('key', defaultValue: '[]')!));
final keys = box.keys;
final ps = <PrivateKeyInfo>[];
for (final key in keys) {
final s = box.get(key);
if (s != null) {
ps.add(s);
}
}
return ps;
}
PrivateKeyInfo get(String id) {
final ss = fetch();
return ss.firstWhere((e) => e.id == id);
return box.get(id);
}
void delete(PrivateKeyInfo s) {
final ss = fetch();
ss.removeAt(index(s));
box.put('key', json.encode(ss));
box.delete(s.id);
}
void update(PrivateKeyInfo old, PrivateKeyInfo newInfo) {
final ss = fetch();
ss[index(old)] = newInfo;
box.put('key', json.encode(ss));
}
int index(PrivateKeyInfo s) => fetch().indexWhere((e) => e.id == s.id);
bool have(PrivateKeyInfo s) => index(s) != -1;
}

View File

@@ -1,38 +1,33 @@
import 'dart:convert';
import 'package:toolbox/core/persistant_store.dart';
import 'package:toolbox/data/model/server/server_private_info.dart';
class ServerStore extends PersistentStore {
void put(ServerPrivateInfo info) {
final ss = fetch();
if (!have(info)) ss.add(info);
box.put('servers', json.encode(ss));
box.put(info.id, info);
}
List<ServerPrivateInfo> fetch() {
return getServerInfoList(
json.decode(box.get('servers', defaultValue: '[]')!));
final ids = box.keys;
final List<ServerPrivateInfo> ss = [];
for (final id in ids) {
final s = box.get(id);
if (s != null) {
ss.add(s);
}
}
return ss;
}
void delete(ServerPrivateInfo s) {
final ss = fetch();
ss.removeAt(index(s));
box.put('servers', json.encode(ss));
box.delete(s.id);
}
void update(ServerPrivateInfo old, ServerPrivateInfo newInfo) {
final ss = fetch();
final idx = index(old);
if (idx < 0) {
throw RangeError.index(idx, ss);
if (!have(old)) {
throw Exception('Old ServerPrivateInfo not found');
}
ss[idx] = newInfo;
box.put('servers', json.encode(ss));
put(newInfo);
}
int index(ServerPrivateInfo s) => fetch()
.indexWhere((e) => e.ip == s.ip && e.port == s.port && e.user == e.user);
bool have(ServerPrivateInfo s) => index(s) != -1;
bool have(ServerPrivateInfo s) => box.get(s.id) != null;
}

View File

@@ -7,4 +7,7 @@ class SettingStore extends PersistentStore {
StoreProperty<int> get serverStatusUpdateInterval =>
property('serverStatusUpdateInterval', defaultValue: 2);
StoreProperty<int> get launchPage => property('launchPage', defaultValue: 0);
StoreProperty<int> get storeVersion =>
property('storeVersion', defaultValue: 0);
}

View File

@@ -1,32 +1,24 @@
import 'dart:convert';
import 'package:toolbox/core/persistant_store.dart';
import 'package:toolbox/data/model/server/snippet.dart';
class SnippetStore extends PersistentStore {
void put(Snippet snippet) {
final ss = fetch();
if (!have(snippet)) ss.add(snippet);
box.put('snippet', json.encode(ss));
box.put(snippet.name, snippet);
}
List<Snippet> fetch() {
return getSnippetList(json.decode(box.get('snippet', defaultValue: '[]')!));
final keys = box.keys;
final ss = <Snippet>[];
for (final key in keys) {
final s = box.get(key);
if (s != null) {
ss.add(s);
}
}
return ss;
}
void delete(Snippet s) {
final ss = fetch();
ss.removeAt(index(s));
box.put('snippet', json.encode(ss));
box.delete(s.name);
}
void update(Snippet old, Snippet newInfo) {
final ss = fetch();
ss[index(old)] = newInfo;
box.put('snippet', json.encode(ss));
}
int index(Snippet s) => fetch().indexWhere((e) => e.name == s.name);
bool have(Snippet s) => index(s) != -1;
}

View File

@@ -122,6 +122,8 @@ class MessageLookup extends MessageLookupByLibrary {
"import": MessageLookupByLibrary.simpleMessage("Import"),
"importAndExport":
MessageLookupByLibrary.simpleMessage("Import and Export"),
"inputDomainHere":
MessageLookupByLibrary.simpleMessage("Input Domain here"),
"install": MessageLookupByLibrary.simpleMessage("install"),
"installDockerWithUrl": MessageLookupByLibrary.simpleMessage(
"Please https://docs.docker.com/engine/install docker first."),

View File

@@ -111,6 +111,7 @@ class MessageLookup extends MessageLookupByLibrary {
"httpFailedWithCode": m5,
"import": MessageLookupByLibrary.simpleMessage("导入"),
"importAndExport": MessageLookupByLibrary.simpleMessage("导入或导出"),
"inputDomainHere": MessageLookupByLibrary.simpleMessage("在这里输入域名"),
"install": MessageLookupByLibrary.simpleMessage("安装"),
"installDockerWithUrl": MessageLookupByLibrary.simpleMessage(
"请先 https://docs.docker.com/engine/install docker"),

View File

@@ -1340,6 +1340,16 @@ class S {
args: [],
);
}
/// `Input Domain here`
String get inputDomainHere {
return Intl.message(
'Input Domain here',
name: 'inputDomainHere',
desc: '',
args: [],
);
}
}
class AppLocalizationDelegate extends LocalizationsDelegate<S> {

View File

@@ -127,5 +127,6 @@
"clickSee": "Click here",
"feedback": "Feedback",
"feedbackOnGithub": "If you have any questions, please feedback on Github.",
"update": "Update"
"update": "Update",
"inputDomainHere": "Input Domain here"
}

View File

@@ -127,5 +127,6 @@
"clickSee": "点击查看",
"feedback": "反馈",
"feedbackOnGithub": "如果你有任何问题请在GitHub反馈",
"update": "更新"
"update": "更新",
"inputDomainHere": "在这里输入域名"
}

View File

@@ -6,6 +6,10 @@ import 'package:logging/logging.dart';
import 'package:provider/provider.dart';
import 'package:toolbox/app.dart';
import 'package:toolbox/core/analysis.dart';
import 'package:toolbox/core/persistant_store.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/snippet.dart';
import 'package:toolbox/data/provider/app.dart';
import 'package:toolbox/data/provider/apt.dart';
import 'package:toolbox/data/provider/debug.dart';
@@ -14,11 +18,17 @@ import 'package:toolbox/data/provider/private_key.dart';
import 'package:toolbox/data/provider/server.dart';
import 'package:toolbox/data/provider/sftp_download.dart';
import 'package:toolbox/data/provider/snippet.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';
Future<void> initApp() async {
await Hive.initFlutter();
await initHive();
await setupLocator();
await upgradeStore();
locator<SnippetProvider>().loadData();
locator<PrivateKeyProvider>().loadData();
@@ -30,6 +40,27 @@ Future<void> initApp() async {
});
}
Future<void> initHive() async {
await Hive.initFlutter();
Hive.registerAdapter(SnippetAdapter());
Hive.registerAdapter(PrivateKeyInfoAdapter());
Hive.registerAdapter(ServerPrivateInfoAdapter());
}
Future<void> upgradeStore() async {
final setting = locator<SettingStore>();
final version = setting.storeVersion.fetch();
if (version == 0) {
final snippet = locator<SnippetStore>();
final key = locator<PrivateKeyStore>();
final spi = locator<ServerStore>();
for (final s in <PersistentStore>[snippet, key, spi]) {
await s.box.deleteAll(s.box.keys);
}
setting.storeVersion.put(1);
}
}
void runInZone(dynamic Function() body) {
final zoneSpec = ZoneSpecification(
print: (Zone self, ZoneDelegate parent, Zone zone, String line) {

View File

@@ -1,7 +1,7 @@
import 'dart:convert';
import 'package:clipboard/clipboard.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:toolbox/core/utils.dart';
import 'package:toolbox/data/res/color.dart';
import 'package:toolbox/generated/l10n.dart';
@@ -44,22 +44,20 @@ class _ConvertPageState extends State<ConvertPage>
Widget build(BuildContext context) {
super.build(context);
return Scaffold(
body: GestureDetector(
child: SingleChildScrollView(
padding: const EdgeInsets.symmetric(horizontal: 7),
controller: ScrollController(),
child: Column(children: [
const SizedBox(height: 13),
_buildInputTop(),
_buildTypeOption(),
_buildResult(),
])),
onTap: () => FocusScope.of(context).requestFocus(FocusNode()),
),
body: SingleChildScrollView(
padding: const EdgeInsets.symmetric(horizontal: 7),
controller: ScrollController(),
child: Column(children: [
const SizedBox(height: 13),
_buildInputTop(),
_buildTypeOption(),
_buildResult(),
])),
floatingActionButton: FloatingActionButton(
onPressed: () {
try {
_textEditingControllerResult.text = doConvert();
FocusScope.of(context).requestFocus(FocusNode());
} catch (e) {
showSnackBar(context, Text('Error: \n$e'));
}
@@ -89,8 +87,7 @@ class _ConvertPageState extends State<ConvertPage>
Widget _buildInputTop() {
return SizedBox(
height: _media.size.height * 0.33,
child: buildInput(context, _textEditingController,
onSubmitted: (_) => _textEditingControllerResult.text = doConvert()),
child: buildInput(context, _textEditingController),
);
}
@@ -123,10 +120,12 @@ class _ConvertPageState extends State<ConvertPage>
style: ButtonStyle(
foregroundColor: MaterialStateProperty.all(primaryColor)),
child: Icon(Icons.copy, semanticLabel: s.copy),
onPressed: () => FlutterClipboard.copy(
_textEditingControllerResult.text == ''
? ' '
: _textEditingControllerResult.text),
onPressed: () => Clipboard.setData(
ClipboardData(
text: _textEditingControllerResult.text == ''
? ' '
: _textEditingControllerResult.text),
),
)
],
),
@@ -157,8 +156,8 @@ class _ConvertPageState extends State<ConvertPage>
title: Text(
e,
style: TextStyle(
color:
_theme.textTheme.bodyText2!.color!.withAlpha(177)),
color: _theme.textTheme.bodyText2!.color!.withAlpha(177),
),
),
trailing: _buildRadio(typeOption.indexOf(e)),
))

View File

@@ -1,4 +1,3 @@
import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:toolbox/core/utils.dart';
@@ -152,49 +151,31 @@ class _DockerManagePageState extends State<DockerManagePage> {
Widget _buildMoreBtn(bool running, String containerId) {
final item = running ? DockerMenuItems.stop : DockerMenuItems.start;
return DropdownButtonHideUnderline(
child: DropdownButton2(
customButton: const Padding(
padding: EdgeInsets.only(left: 7),
child: Icon(
Icons.more_vert,
size: 17,
),
return buildPopuopMenu(
items: [
PopupMenuItem<DropdownBtnItem>(
value: item,
child: item.build,
),
customItemsHeight: 8,
items: [
DropdownMenuItem<DropdownBtnItem>(
value: item,
child: item.build,
),
DropdownMenuItem<DropdownBtnItem>(
value: DockerMenuItems.rm,
child: DockerMenuItems.rm.build,
),
],
onChanged: (value) {
final item = value as DropdownBtnItem;
switch (item) {
case DockerMenuItems.rm:
_docker.delete(containerId);
break;
case DockerMenuItems.start:
_docker.start(containerId);
break;
case DockerMenuItems.stop:
_docker.stop(containerId);
break;
}
},
itemHeight: 37,
itemPadding: const EdgeInsets.only(left: 17, right: 17),
dropdownWidth: 133,
dropdownDecoration: BoxDecoration(
borderRadius: BorderRadius.circular(7),
PopupMenuItem<DropdownBtnItem>(
value: DockerMenuItems.rm,
child: DockerMenuItems.rm.build,
),
dropdownElevation: 8,
offset: const Offset(0, 8),
),
],
onSelected: (value) {
final item = value as DropdownBtnItem;
switch (item) {
case DockerMenuItems.rm:
_docker.delete(containerId);
break;
case DockerMenuItems.start:
_docker.start(containerId);
break;
case DockerMenuItems.stop:
_docker.stop(containerId);
break;
}
},
);
}

View File

@@ -1,7 +1,6 @@
import 'package:after_layout/after_layout.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_advanced_drawer/flutter_advanced_drawer.dart';
import 'package:get_it/get_it.dart';
import 'package:toolbox/core/analysis.dart';
import 'package:toolbox/core/build_mode.dart';
@@ -46,7 +45,6 @@ class _MyHomePageState extends State<MyHomePage>
WidgetsBindingObserver {
late final ServerProvider _serverProvider;
late final PageController _pageController;
late final AdvancedDrawerController _advancedDrawerController;
late int _selectIndex;
late double _width;
late S s;
@@ -58,7 +56,6 @@ class _MyHomePageState extends State<MyHomePage>
WidgetsBinding.instance.addObserver(this);
_selectIndex = locator<SettingStore>().launchPage.fetch()!;
_pageController = PageController(initialPage: _selectIndex);
_advancedDrawerController = AdvancedDrawerController();
}
@override
@@ -92,8 +89,9 @@ class _MyHomePageState extends State<MyHomePage>
return WillPopScope(
child: _buildMain(context),
onWillPop: () {
if (_advancedDrawerController.value.visible) {
_advancedDrawerController.hideDrawer();
final scaffold = Scaffold.of(context);
if (scaffold.isDrawerOpen) {
scaffold.closeDrawer();
return Future.value(false);
}
return Future.value(true);
@@ -101,63 +99,31 @@ class _MyHomePageState extends State<MyHomePage>
}
Widget _buildMain(BuildContext context) {
return AdvancedDrawer(
controller: _advancedDrawerController,
animationCurve: Curves.easeInOut,
animationDuration: const Duration(milliseconds: 300),
animateChildDecoration: true,
rtlOpening: false,
childDecoration: const BoxDecoration(
// NOTICE: Uncomment if you want to add shadow behind the page.
// Keep in mind that it may cause animation jerks.
// boxShadow: <BoxShadow>[
// BoxShadow(
// color: Colors.black12,
// blurRadius: 0.0,
// ),
// ],
borderRadius: BorderRadius.all(Radius.circular(16)),
),
drawer: _buildDrawer(),
child: Scaffold(
appBar: AppBar(
title: Text(tabTitleName(context, _selectIndex), style: size18),
actions: [
IconButton(
icon: const Icon(Icons.developer_mode, size: 23),
tooltip: s.debug,
onPressed: () =>
AppRoute(const DebugPage(), 'Debug Page').go(context),
),
],
leading: IconButton(
onPressed: () => _advancedDrawerController.showDrawer(),
icon: ValueListenableBuilder<AdvancedDrawerValue>(
valueListenable: _advancedDrawerController,
builder: (_, value, __) {
return AnimatedSwitcher(
duration: const Duration(milliseconds: 250),
child: Icon(
value.visible ? Icons.clear : Icons.menu,
key: ValueKey<bool>(value.visible),
),
);
},
),
),
return Scaffold(
drawer: _buildDrawer(),
appBar: AppBar(
title: Text(tabTitleName(context, _selectIndex), style: size18),
actions: [
IconButton(
icon: const Icon(Icons.developer_mode, size: 23),
tooltip: s.debug,
onPressed: () =>
AppRoute(const DebugPage(), 'Debug Page').go(context),
),
body: PageView(
physics: const ClampingScrollPhysics(),
controller: _pageController,
onPageChanged: (i) {
FocusScope.of(context).unfocus();
_selectIndex = i;
setState(() {});
},
children: const [ServerPage(), ConvertPage(), PingPage()],
),
bottomNavigationBar: _buildBottom(context),
));
],
),
body: PageView(
physics: const ClampingScrollPhysics(),
controller: _pageController,
onPageChanged: (i) {
FocusScope.of(context).unfocus();
_selectIndex = i;
setState(() {});
},
children: const [ServerPage(), ConvertPage(), PingPage()],
),
bottomNavigationBar: _buildBottom(context),
);
}
Widget _buildItem(int idx, NavigationItem item, bool isSelected) {
@@ -208,7 +174,7 @@ class _MyHomePageState extends State<MyHomePage>
}
Widget _buildDrawer() {
return SafeArea(
return Drawer(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [

View File

@@ -9,6 +9,12 @@ import 'package:toolbox/locator.dart';
import 'package:toolbox/view/widget/input_field.dart';
import 'package:toolbox/view/widget/round_rect_card.dart';
final doaminReg =
RegExp(r'^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9]\.[a-zA-Z]{2,}$');
final ipv4Reg =
RegExp(r'^((25[0-5]|(2[0-4]|1[0-9]|[1-9]|)[0-9])(\.(?!$)|$)){4}$');
final ipv6Reg = RegExp(r'^([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$');
class PingPage extends StatefulWidget {
const PingPage({Key? key}) : super(key: key);
@@ -44,27 +50,35 @@ class _PingPageState extends State<PingPage>
Widget build(BuildContext context) {
super.build(context);
return Scaffold(
body: GestureDetector(
child: SingleChildScrollView(
padding: const EdgeInsets.symmetric(horizontal: 7),
child: Column(children: [
const SizedBox(height: 13),
buildInput(context, _textEditingController,
maxLines: 1, onSubmitted: (_) => doPing()),
_buildControl(),
SizedBox(
width: double.infinity,
height: _media.size.height * 0.6,
child: ListView.builder(
controller: ScrollController(),
itemCount: _results.length,
itemBuilder: (context, index) {
final result = _results[index];
return _buildResultItem(result);
}),
),
])),
onTap: () => FocusScope.of(context).requestFocus(FocusNode()),
body: SingleChildScrollView(
padding: const EdgeInsets.symmetric(horizontal: 7),
child: Column(children: [
const SizedBox(height: 13),
buildInput(context, _textEditingController,
hint: s.inputDomainHere,
maxLines: 1,
onSubmitted: (_) => doPing()),
SizedBox(
width: double.infinity,
height: _media.size.height * 0.6,
child: ListView.builder(
controller: ScrollController(),
itemCount: _results.length,
itemBuilder: (context, index) {
final result = _results[index];
return _buildResultItem(result);
}),
),
])),
floatingActionButton: FloatingActionButton(
child: const Icon(Icons.play_arrow),
onPressed: () {
try {
doPing();
} catch (e) {
showSnackBar(context, Text('Error: \n$e'));
}
},
),
);
}
@@ -112,67 +126,25 @@ class _PingPageState extends State<PingPage>
return;
}
await Future.wait(_serverProvider.servers.map((e) async {
if (e.client == null) {
return;
}
final result = await e.client!.run('ping -c 3 $target').string;
_results.add(PingResult.parse(e.info.name, result));
setState(() {});
}));
}
if (!doaminReg.hasMatch(target) &&
!ipv4Reg.hasMatch(target) &&
!ipv6Reg.hasMatch(target)) {
showSnackBar(context, Text(s.pingInputIP));
return;
}
Widget _buildControl() {
return SizedBox(
height: 57,
child: RoundRectCard(
InkWell(
onTap: () => FocusScope.of(context).unfocus(),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
TextButton(
style: ButtonStyle(
foregroundColor: MaterialStateProperty.all(primaryColor)),
child: Row(
children: [
const Icon(Icons.delete),
const SizedBox(
width: 7,
),
Text(s.clear)
],
),
onPressed: () {
_results.clear();
setState(() {});
},
),
TextButton(
style: ButtonStyle(
foregroundColor: MaterialStateProperty.all(primaryColor)),
child: Row(
children: [
const Icon(Icons.play_arrow),
const SizedBox(
width: 7,
),
Text(s.start)
],
),
onPressed: () {
try {
doPing();
} catch (e) {
showSnackBar(context, Text('Error: \n$e'));
}
},
)
],
),
),
),
);
try {
await Future.wait(_serverProvider.servers.map((e) async {
if (e.client == null) {
return;
}
final result = await e.client!.run('ping -c 3 $target').string;
_results.add(PingResult.parse(e.info.name, result));
setState(() {});
}));
} catch (e) {
showSnackBar(context, Text(e.toString()));
}
}
@override

View File

@@ -68,8 +68,12 @@ class _ServerDetailPageState extends State<ServerDetailPage>
Widget _buildLinuxIcon(String sysVer) {
final iconPath = linuxIcons.search(sysVer);
if (iconPath == null) return const SizedBox();
return SizedBox(
height: _media.size.height * 0.15, child: Image.asset(iconPath));
return ConstrainedBox(
constraints: BoxConstraints(
maxHeight: _media.size.height * 0.12,
maxWidth: _media.size.width * 0.6),
child: Image.asset(iconPath),
);
}
Widget _buildCPUView(ServerStatus ss) {

View File

@@ -1,10 +1,8 @@
import 'package:after_layout/after_layout.dart';
import 'package:circle_chart/circle_chart.dart';
import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/material.dart';
import 'package:get_it/get_it.dart';
import 'package:provider/provider.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:toolbox/core/route.dart';
import 'package:toolbox/core/utils.dart';
import 'package:toolbox/data/model/app/menu_item.dart';
@@ -36,16 +34,17 @@ class _ServerPageState extends State<ServerPage>
late MediaQueryData _media;
late ThemeData _theme;
late Color _primaryColor;
late RefreshController _refreshController;
late ServerProvider _serverProvider;
late S s;
late bool autoUpdate;
@override
void initState() {
super.initState();
_serverProvider = locator<ServerProvider>();
_refreshController = RefreshController();
autoUpdate =
locator<SettingStore>().serverStatusUpdateInterval.fetch() != 0;
}
@override
@@ -60,8 +59,6 @@ class _ServerPageState extends State<ServerPage>
@override
Widget build(BuildContext context) {
super.build(context);
final autoUpdate =
locator<SettingStore>().serverStatusUpdateInterval.fetch() != 0;
final child = Consumer<ServerProvider>(builder: (_, pro, __) {
if (pro.servers.isEmpty) {
return Center(
@@ -89,13 +86,9 @@ class _ServerPageState extends State<ServerPage>
return Scaffold(
body: autoUpdate
? child
: SmartRefresher(
controller: _refreshController,
: RefreshIndicator(
child: child,
onRefresh: () async {
await _serverProvider.refreshData();
_refreshController.refreshCompleted();
},
onRefresh: () async => _serverProvider.refreshData(),
),
floatingActionButton: FloatingActionButton(
onPressed: () =>
@@ -206,72 +199,42 @@ class _ServerPageState extends State<ServerPage>
}
Widget _buildMoreBtn(ServerPrivateInfo spi) {
return DropdownButtonHideUnderline(
child: DropdownButton2(
customButton: const Padding(
padding: EdgeInsets.symmetric(horizontal: 5, vertical: 1.7),
child: Icon(
Icons.more_vert,
size: 17,
return buildPopuopMenu(
items: <PopupMenuEntry>[
...ServerTabMenuItems.firstItems.map(
(item) => PopupMenuItem<DropdownBtnItem>(
value: item,
child: item.build,
),
),
customItemsIndexes: [ServerTabMenuItems.firstItems.length],
customItemsHeight: 8,
items: [
...ServerTabMenuItems.firstItems.map(
(item) => DropdownMenuItem<DropdownBtnItem>(
value: item,
child: item.build,
),
const PopupMenuDivider(height: 1),
...ServerTabMenuItems.secondItems.map(
(item) => PopupMenuItem<DropdownBtnItem>(
value: item,
child: item.build,
),
const DropdownMenuItem<Divider>(enabled: false, child: Divider()),
...ServerTabMenuItems.secondItems.map(
(item) => DropdownMenuItem<DropdownBtnItem>(
value: item,
child: item.build,
),
),
],
onChanged: (value) {
final item = value as DropdownBtnItem;
switch (item) {
case ServerTabMenuItems.apt:
AppRoute(AptManagePage(spi), 'apt manage page').go(context);
break;
case ServerTabMenuItems.sftp:
AppRoute(SFTPPage(spi), 'SFTP').go(context);
break;
case ServerTabMenuItems.snippet:
AppRoute(
SnippetListPage(
spi: spi,
),
'snippet list')
.go(context);
break;
case ServerTabMenuItems.edit:
AppRoute(
ServerEditPage(
spi: spi,
),
'Edit server info page')
.go(context);
break;
case ServerTabMenuItems.docker:
AppRoute(DockerManagePage(spi), 'Docker manage page').go(context);
break;
}
},
itemHeight: 37,
itemPadding: const EdgeInsets.only(left: 17, right: 17),
dropdownWidth: 160,
dropdownPadding: const EdgeInsets.symmetric(vertical: 7),
dropdownDecoration: BoxDecoration(
borderRadius: BorderRadius.circular(7),
),
dropdownElevation: 8,
offset: const Offset(0, 8),
),
],
onSelected: (value) {
final item = value as DropdownBtnItem;
switch (item) {
case ServerTabMenuItems.apt:
AppRoute(AptManagePage(spi), 'apt manage').go(context);
break;
case ServerTabMenuItems.sftp:
AppRoute(SFTPPage(spi), 'SFTP').go(context);
break;
case ServerTabMenuItems.snippet:
AppRoute(SnippetListPage(spi: spi), 'snippet list').go(context);
break;
case ServerTabMenuItems.edit:
AppRoute(ServerEditPage(spi: spi), 'Edit server info').go(context);
break;
case ServerTabMenuItems.docker:
AppRoute(DockerManagePage(spi), 'Docker manage').go(context);
break;
}
},
);
}

View File

@@ -420,14 +420,14 @@
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 153;
CURRENT_PROJECT_VERSION = 159;
DEVELOPMENT_TEAM = BA88US33G6;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.0.153;
MARKETING_VERSION = 1.0.159;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
@@ -550,14 +550,14 @@
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 153;
CURRENT_PROJECT_VERSION = 159;
DEVELOPMENT_TEAM = BA88US33G6;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.0.153;
MARKETING_VERSION = 1.0.159;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -574,14 +574,14 @@
CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 153;
CURRENT_PROJECT_VERSION = 159;
DEVELOPMENT_TEAM = BA88US33G6;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.0.153;
MARKETING_VERSION = 1.0.159;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;

View File

@@ -104,8 +104,9 @@ Future<void> flutterBuild(
buildType,
];
// No sksl cache for macos
if ('macos' != buildType) {
args.add('--bundle-sksl-path=$buildType$skslFileSuffix');
final skslPath = '$buildType$skslFileSuffix';
if (await File(skslPath).exists()) {
args.add('--bundle-sksl-path=$skslPath');
}
final isAndroid = 'apk' == buildType;
// [--target-platform] only for Android

View File

@@ -1,6 +1,13 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
_fe_analyzer_shared:
dependency: transitive
description:
name: _fe_analyzer_shared
url: "https://pub.dartlang.org"
source: hosted
version: "50.0.0"
after_layout:
dependency: "direct main"
description:
@@ -8,6 +15,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
analyzer:
dependency: transitive
description:
name: analyzer
url: "https://pub.dartlang.org"
source: hosted
version: "5.2.0"
archive:
dependency: transitive
description:
@@ -43,6 +57,62 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
build:
dependency: transitive
description:
name: build
url: "https://pub.dartlang.org"
source: hosted
version: "2.3.1"
build_config:
dependency: transitive
description:
name: build_config
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.1"
build_daemon:
dependency: transitive
description:
name: build_daemon
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.0"
build_resolvers:
dependency: transitive
description:
name: build_resolvers
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
build_runner:
dependency: "direct dev"
description:
name: build_runner
url: "https://pub.dartlang.org"
source: hosted
version: "2.3.2"
build_runner_core:
dependency: transitive
description:
name: build_runner_core
url: "https://pub.dartlang.org"
source: hosted
version: "7.2.7"
built_collection:
dependency: transitive
description:
name: built_collection
url: "https://pub.dartlang.org"
source: hosted
version: "5.1.1"
built_value:
dependency: transitive
description:
name: built_value
url: "https://pub.dartlang.org"
source: hosted
version: "8.4.2"
characters:
dependency: transitive
description:
@@ -50,6 +120,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.1"
checked_yaml:
dependency: transitive
description:
name: checked_yaml
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
circle_chart:
dependency: "direct main"
description:
@@ -59,13 +136,6 @@ packages:
url: "https://github.com/LollipopKit/circle_chart"
source: git
version: "0.0.3"
clipboard:
dependency: "direct main"
description:
name: clipboard
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
clock:
dependency: transitive
description:
@@ -73,6 +143,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.1"
code_builder:
dependency: transitive
description:
name: code_builder
url: "https://pub.dartlang.org"
source: hosted
version: "4.3.0"
collection:
dependency: transitive
description:
@@ -110,6 +187,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
dart_style:
dependency: transitive
description:
name: dart_style
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.4"
dartssh2:
dependency: "direct main"
description:
@@ -124,13 +208,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.6"
dropdown_button2:
dependency: "direct main"
description:
name: dropdown_button2
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.2"
easy_isolate:
dependency: "direct main"
description:
@@ -173,18 +250,18 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "6.1.2"
fixnum:
dependency: transitive
description:
name: fixnum
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
flutter:
dependency: "direct main"
description: flutter
source: sdk
version: "0.0.0"
flutter_advanced_drawer:
dependency: "direct main"
description:
name: flutter_advanced_drawer
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.2"
flutter_lints:
dependency: "direct dev"
description:
@@ -228,6 +305,13 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
frontend_server_client:
dependency: transitive
description:
name: frontend_server_client
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.0"
get_it:
dependency: "direct main"
description:
@@ -235,8 +319,22 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "7.2.0"
glob:
dependency: transitive
description:
name: glob
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
graphs:
dependency: transitive
description:
name: graphs
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.0"
hive:
dependency: "direct main"
dependency: transitive
description:
name: hive
url: "https://pub.dartlang.org"
@@ -249,6 +347,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
hive_generator:
dependency: "direct dev"
description:
name: hive_generator
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
http:
dependency: transitive
description:
@@ -263,6 +368,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.2"
http_multi_server:
dependency: transitive
description:
name: http_multi_server
url: "https://pub.dartlang.org"
source: hosted
version: "3.2.1"
http_parser:
dependency: transitive
description:
@@ -284,6 +396,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.17.0"
io:
dependency: transitive
description:
name: io
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
js:
dependency: transitive
description:
@@ -291,6 +410,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.4"
json_annotation:
dependency: transitive
description:
name: json_annotation
url: "https://pub.dartlang.org"
source: hosted
version: "4.7.0"
lint:
dependency: transitive
description:
@@ -347,6 +473,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
package_config:
dependency: transitive
description:
name: package_config
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
path:
dependency: transitive
description:
@@ -445,6 +578,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "3.6.0"
pool:
dependency: transitive
description:
name: pool
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.1"
process:
dependency: transitive
description:
@@ -459,13 +599,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.3"
pull_to_refresh:
dependency: "direct main"
pub_semver:
dependency: transitive
description:
name: pull_to_refresh
name: pub_semver
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "2.1.2"
pubspec_parse:
dependency: transitive
description:
name: pubspec_parse
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.1"
r_upgrade:
dependency: "direct main"
description:
@@ -515,11 +662,39 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0"
shelf:
dependency: transitive
description:
name: shelf
url: "https://pub.dartlang.org"
source: hosted
version: "1.4.0"
shelf_web_socket:
dependency: transitive
description:
name: shelf_web_socket
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
sky_engine:
dependency: transitive
description: flutter
source: sdk
version: "0.0.99"
source_gen:
dependency: transitive
description:
name: source_gen
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.6"
source_helper:
dependency: transitive
description:
name: source_helper
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.3"
source_span:
dependency: transitive
description:
@@ -541,6 +716,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
stream_transform:
dependency: transitive
description:
name: stream_transform
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
string_scanner:
dependency: transitive
description:
@@ -562,6 +744,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.12"
timing:
dependency: transitive
description:
name: timing
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
typed_data:
dependency: transitive
description:
@@ -639,6 +828,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.2"
watcher:
dependency: transitive
description:
name: watcher
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
web_socket_channel:
dependency: transitive
description:
name: web_socket_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.0"
win32:
dependency: transitive
description:
@@ -668,5 +871,5 @@ packages:
source: hosted
version: "3.1.1"
sdks:
dart: ">=2.17.0 <3.0.0"
dart: ">=2.18.0 <3.0.0"
flutter: ">=3.0.0"

View File

@@ -33,7 +33,6 @@ dependencies:
sdk: flutter
provider: ^6.0.0
get_it: ^7.2.0
hive: ^2.0.0
hive_flutter: ^1.0.0
dio: ^4.0.0
after_layout: ^1.1.0
@@ -51,11 +50,7 @@ dependencies:
url: https://github.com/LollipopKit/circle_chart
ref: main
# path: ../circle_chart
clipboard: ^0.1.3
r_upgrade: ^0.3.6
pull_to_refresh: ^2.0.0
dropdown_button2: ^1.1.1
flutter_advanced_drawer: ^1.3.0
path_provider: ^2.0.9
easy_isolate: ^1.3.0
share_plus: ^4.0.4
@@ -63,6 +58,8 @@ dependencies:
dev_dependencies:
flutter_native_splash: ^2.1.6
hive_generator: ^2.0.0
build_runner: ^2.3.2
flutter_test:
sdk: flutter
@@ -94,6 +91,7 @@ flutter:
- assets/linux/fedora.png
- assets/linux/opensuse.png
- assets/linux/wrt.png
- assets/linux/armbian.png
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see