mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
Improve.
This commit is contained in:
@@ -354,7 +354,7 @@
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = 88;
|
||||
CURRENT_PROJECT_VERSION = 96;
|
||||
DEVELOPMENT_TEAM = BA88US33G6;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
@@ -362,7 +362,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.88;
|
||||
MARKETING_VERSION = 1.0.96;
|
||||
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 = 88;
|
||||
CURRENT_PROJECT_VERSION = 96;
|
||||
DEVELOPMENT_TEAM = BA88US33G6;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
@@ -492,7 +492,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.88;
|
||||
MARKETING_VERSION = 1.0.96;
|
||||
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 = 88;
|
||||
CURRENT_PROJECT_VERSION = 96;
|
||||
DEVELOPMENT_TEAM = BA88US33G6;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
@@ -516,7 +516,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.88;
|
||||
MARKETING_VERSION = 1.0.96;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
|
||||
@@ -11,13 +11,14 @@ class MenuItem {
|
||||
}
|
||||
|
||||
class MenuItems {
|
||||
static const List<MenuItem> firstItems = [sftp, snippet, apt];
|
||||
static const List<MenuItem> firstItems = [ssh, sftp, snippet, apt];
|
||||
static const List<MenuItem> secondItems = [edit];
|
||||
|
||||
static const ssh = MenuItem(text: 'SSH', icon: Icons.link);
|
||||
static const sftp = MenuItem(text: 'SFTP', icon: Icons.file_present);
|
||||
static const snippet = MenuItem(text: 'Snippet', icon: Icons.label);
|
||||
static const apt = MenuItem(text: 'Apt', icon: Icons.system_security_update);
|
||||
static const edit = MenuItem(text: 'Edit', icon: Icons.settings);
|
||||
static const edit = MenuItem(text: 'Edit', icon: Icons.edit);
|
||||
|
||||
static Widget buildItem(MenuItem item) {
|
||||
return Row(
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
class BuildData {
|
||||
static const String name = "ServerBox";
|
||||
static const int build = 95;
|
||||
static const int build = 97;
|
||||
static const String engine =
|
||||
"Flutter 2.10.0 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision 5f105a6ca7 (7 days ago) • 2022-02-01 14:15:42 -0800\nEngine • revision 776efd2034\nTools • Dart 2.16.0 • DevTools 2.9.2\n";
|
||||
static const String buildAt = "2022-02-08 21:30:51.218738";
|
||||
static const int modifications = 3;
|
||||
static const String buildAt = "2022-02-09 10:58:45.586008";
|
||||
static const int modifications = 8;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:toolbox/data/model/app/navigation_item.dart';
|
||||
|
||||
final List<String> tabs = ['Servers', 'En/Decode', 'Ping'];
|
||||
final List<NavigationItem> tabItems = [
|
||||
NavigationItem(Icons.computer, 'Server'),
|
||||
NavigationItem(Icons.cloud, 'Server'),
|
||||
NavigationItem(Icons.code, 'Convert'),
|
||||
NavigationItem(Icons.network_check, 'Ping'),
|
||||
NavigationItem(Icons.leak_add, 'Ping'),
|
||||
];
|
||||
|
||||
@@ -213,23 +213,28 @@ class _MyHomePageState extends State<MyHomePage>
|
||||
SizedBox(
|
||||
height: MediaQuery.of(context).size.height * 0.07,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 29),
|
||||
child: Column(
|
||||
children: [
|
||||
ListTile(
|
||||
leading: const Icon(Icons.settings),
|
||||
title: const Text('Setting'),
|
||||
onTap: () => AppRoute(const SettingPage(), 'Setting').go(context),
|
||||
onTap: () =>
|
||||
AppRoute(const SettingPage(), 'Setting').go(context),
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.vpn_key),
|
||||
title: const Text('Private Key'),
|
||||
onTap: () =>
|
||||
AppRoute(const StoredPrivateKeysPage(), 'private key list')
|
||||
onTap: () => AppRoute(
|
||||
const StoredPrivateKeysPage(), 'private key list')
|
||||
.go(context),
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.snippet_folder),
|
||||
title: const Text('Snippet'),
|
||||
onTap: () =>
|
||||
AppRoute(const SnippetListPage(), 'snippet list').go(context),
|
||||
onTap: () => AppRoute(const SnippetListPage(), 'snippet list')
|
||||
.go(context),
|
||||
),
|
||||
AboutListTile(
|
||||
icon: const Icon(Icons.text_snippet),
|
||||
@@ -239,13 +244,17 @@ class _MyHomePageState extends State<MyHomePage>
|
||||
applicationIcon: _buildIcon(),
|
||||
aboutBoxChildren: const [
|
||||
UrlText(
|
||||
text: '\nMade with ❤️ by $myGithub', replace: 'LollipopKit'),
|
||||
text: '\nMade with ❤️ by $myGithub',
|
||||
replace: 'LollipopKit'),
|
||||
UrlText(
|
||||
text:
|
||||
'\nThanks $rainSunMeGithub for participating in the test.\n\nAll rights reserved.',
|
||||
replace: 'RainSunMe',
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -18,15 +18,13 @@ class PingPage extends StatefulWidget {
|
||||
class _PingPageState extends State<PingPage>
|
||||
with AutomaticKeepAliveClientMixin {
|
||||
late TextEditingController _textEditingController;
|
||||
late TextEditingController _textEditingControllerResult;
|
||||
late String _result;
|
||||
String _result = '';
|
||||
Ping? _ping;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_textEditingController = TextEditingController(text: '');
|
||||
_textEditingControllerResult = TextEditingController(text: '');
|
||||
if (Platform.isIOS) {
|
||||
DartPingIOS.register();
|
||||
}
|
||||
@@ -48,7 +46,12 @@ class _PingPageState extends State<PingPage>
|
||||
const SizedBox(height: 13),
|
||||
buildInput(context, _textEditingController, maxLines: 1),
|
||||
_buildControl(),
|
||||
buildInput(context, _textEditingControllerResult),
|
||||
RoundRectCard(
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
child: Padding(padding: const EdgeInsets.all(7), child: Text(_result)),
|
||||
),
|
||||
),
|
||||
])),
|
||||
onTap: () => FocusScope.of(context).requestFocus(FocusNode()),
|
||||
),
|
||||
@@ -62,7 +65,7 @@ class _PingPageState extends State<PingPage>
|
||||
final resp = event.response.toString();
|
||||
if (resp == 'null') return;
|
||||
_result += '$resp\n';
|
||||
_textEditingControllerResult.text = _result;
|
||||
setState(() {});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -175,70 +175,7 @@ class _ServerPageState extends State<ServerPage>
|
||||
style: style),
|
||||
)
|
||||
: Text(topRightStr, style: style, textScaleFactor: 1.0),
|
||||
DropdownButtonHideUnderline(
|
||||
child: DropdownButton2(
|
||||
customButton: const Padding(
|
||||
padding: EdgeInsets.only(left: 7),
|
||||
child: Icon(
|
||||
Icons.more_vert,
|
||||
size: 17,
|
||||
),
|
||||
),
|
||||
customItemsIndexes: const [3],
|
||||
customItemsHeight: 8,
|
||||
items: [
|
||||
...MenuItems.firstItems.map(
|
||||
(item) => DropdownMenuItem<MenuItem>(
|
||||
value: item,
|
||||
child: MenuItems.buildItem(item),
|
||||
),
|
||||
),
|
||||
const DropdownMenuItem<Divider>(
|
||||
enabled: false, child: Divider()),
|
||||
...MenuItems.secondItems.map(
|
||||
(item) => DropdownMenuItem<MenuItem>(
|
||||
value: item,
|
||||
child: MenuItems.buildItem(item),
|
||||
),
|
||||
),
|
||||
],
|
||||
onChanged: (value) {
|
||||
final item = value as MenuItem;
|
||||
switch (item) {
|
||||
case MenuItems.apt:
|
||||
case MenuItems.sftp:
|
||||
showSnackBar(
|
||||
context, const Text('Now is not supported'));
|
||||
break;
|
||||
case MenuItems.snippet:
|
||||
AppRoute(
|
||||
SnippetListPage(
|
||||
spi: spi,
|
||||
),
|
||||
'snippet list')
|
||||
.go(context);
|
||||
break;
|
||||
case MenuItems.edit:
|
||||
AppRoute(
|
||||
ServerEditPage(
|
||||
spi: spi,
|
||||
),
|
||||
'Edit server info 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),
|
||||
),
|
||||
),
|
||||
_buildMoreBtn(spi),
|
||||
],
|
||||
)
|
||||
],
|
||||
@@ -272,6 +209,72 @@ class _ServerPageState extends State<ServerPage>
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildMoreBtn(ServerPrivateInfo spi) {
|
||||
return DropdownButtonHideUnderline(
|
||||
child: DropdownButton2(
|
||||
customButton: const Padding(
|
||||
padding: EdgeInsets.only(left: 7),
|
||||
child: Icon(
|
||||
Icons.more_vert,
|
||||
size: 17,
|
||||
),
|
||||
),
|
||||
customItemsIndexes: [MenuItems.firstItems.length],
|
||||
customItemsHeight: 8,
|
||||
items: [
|
||||
...MenuItems.firstItems.map(
|
||||
(item) => DropdownMenuItem<MenuItem>(
|
||||
value: item,
|
||||
child: MenuItems.buildItem(item),
|
||||
),
|
||||
),
|
||||
const DropdownMenuItem<Divider>(enabled: false, child: Divider()),
|
||||
...MenuItems.secondItems.map(
|
||||
(item) => DropdownMenuItem<MenuItem>(
|
||||
value: item,
|
||||
child: MenuItems.buildItem(item),
|
||||
),
|
||||
),
|
||||
],
|
||||
onChanged: (value) {
|
||||
final item = value as MenuItem;
|
||||
switch (item) {
|
||||
case MenuItems.ssh:
|
||||
case MenuItems.apt:
|
||||
case MenuItems.sftp:
|
||||
showSnackBar(context, const Text('Now is not supported'));
|
||||
break;
|
||||
case MenuItems.snippet:
|
||||
AppRoute(
|
||||
SnippetListPage(
|
||||
spi: spi,
|
||||
),
|
||||
'snippet list')
|
||||
.go(context);
|
||||
break;
|
||||
case MenuItems.edit:
|
||||
AppRoute(
|
||||
ServerEditPage(
|
||||
spi: spi,
|
||||
),
|
||||
'Edit server info 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),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildExplainText(String text) {
|
||||
return SizedBox(
|
||||
width: _media.size.width * 0.2,
|
||||
|
||||
10
make.dart
10
make.dart
@@ -44,12 +44,13 @@ Future<String> getFlutterVersion() async {
|
||||
}
|
||||
|
||||
Future<Map<String, dynamic>> getBuildData() async {
|
||||
final modifiedCount = await getGitModificationCount();
|
||||
final data = {
|
||||
'name': appName,
|
||||
'build': await getGitCommitCount(),
|
||||
'build': await getGitCommitCount() + (modifiedCount == 0 ? 0 : 1),
|
||||
'engine': await getFlutterVersion(),
|
||||
'buildAt': DateTime.now().toString(),
|
||||
'modifications': await getGitModificationCount(),
|
||||
'modifications': modifiedCount,
|
||||
};
|
||||
return data;
|
||||
}
|
||||
@@ -69,7 +70,7 @@ Future<void> updateBuildData() async {
|
||||
|
||||
void dartFormat() {
|
||||
final result = Process.runSync('dart', ['format', '.']);
|
||||
print(result.stdout);
|
||||
print('\n' + result.stdout);
|
||||
if (result.exitCode != 0) {
|
||||
print(result.stderr);
|
||||
exit(1);
|
||||
@@ -83,7 +84,8 @@ void flutterRun(String? mode) {
|
||||
|
||||
Future<void> flutterBuild(String source, String target, bool isAndroid) async {
|
||||
final startTime = DateTime.now();
|
||||
final build = await getGitCommitCount();
|
||||
final build = await getGitCommitCount() +
|
||||
(await getGitModificationCount() == 0 ? 0 : 1);
|
||||
|
||||
final args = [
|
||||
'build',
|
||||
|
||||
@@ -335,13 +335,6 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.12.11"
|
||||
material_color_utilities:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: material_color_utilities
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.1.3"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -528,7 +521,7 @@ packages:
|
||||
name: test_api
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.4.8"
|
||||
version: "0.4.3"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
Reference in New Issue
Block a user