mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 15:24:35 +01:00
opt.
This commit is contained in:
@@ -102,7 +102,7 @@ abstract class S {
|
|||||||
/// No description provided for @aboutThanks.
|
/// No description provided for @aboutThanks.
|
||||||
///
|
///
|
||||||
/// In en, this message translates to:
|
/// In en, this message translates to:
|
||||||
/// **'\n\nThanks to the following people who participated in the test.'**
|
/// **'\nThanks to the following people who participated in the test.'**
|
||||||
String get aboutThanks;
|
String get aboutThanks;
|
||||||
|
|
||||||
/// No description provided for @addAServer.
|
/// No description provided for @addAServer.
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ class SEn extends S {
|
|||||||
String get about => 'About';
|
String get about => 'About';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get aboutThanks => '\n\nThanks to the following people who participated in the test.';
|
String get aboutThanks => '\nThanks to the following people who participated in the test.';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get addAServer => 'add a server';
|
String get addAServer => 'add a server';
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ class SZh extends S {
|
|||||||
String get about => '关于';
|
String get about => '关于';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get aboutThanks => '\n\n感谢以下参与软件测试的各位。';
|
String get aboutThanks => '\n感谢以下参与软件测试的各位。';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get addAServer => '添加服务器';
|
String get addAServer => '添加服务器';
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import 'dart:typed_data';
|
|||||||
|
|
||||||
extension FutureUint8ListX on Future<Uint8List> {
|
extension FutureUint8ListX on Future<Uint8List> {
|
||||||
Future<String> get string async => utf8.decode(await this);
|
Future<String> get string async => utf8.decode(await this);
|
||||||
|
Future<ByteData> get byteData async => (await this).buffer.asByteData();
|
||||||
}
|
}
|
||||||
|
|
||||||
extension Uint8ListX on Uint8List {
|
extension Uint8ListX on Uint8List {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import 'package:flutter/widgets.dart';
|
|||||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||||
import 'package:plain_notification_token/plain_notification_token.dart';
|
import 'package:plain_notification_token/plain_notification_token.dart';
|
||||||
import 'package:share_plus/share_plus.dart';
|
import 'package:share_plus/share_plus.dart';
|
||||||
|
import 'package:toolbox/core/extension/uint8list.dart';
|
||||||
|
|
||||||
import 'platform.dart';
|
import 'platform.dart';
|
||||||
|
|
||||||
@@ -47,3 +48,9 @@ Future<String?> getToken() async {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> loadFontFile(String localPath, String name) async {
|
||||||
|
var fontLoader = FontLoader(name);
|
||||||
|
fontLoader.addFont(File(localPath).readAsBytes().byteData);
|
||||||
|
await fontLoader.load();
|
||||||
|
}
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ class ServerProvider extends BusyProvider {
|
|||||||
// after connected
|
// after connected
|
||||||
s.cs = ServerState.connected;
|
s.cs = ServerState.connected;
|
||||||
final writeResult = await s.client!
|
final writeResult = await s.client!
|
||||||
.run("echo '$shellCmd' > $shellPath && chmod +x $shellPath")
|
.run(installShellCmd)
|
||||||
.string;
|
.string;
|
||||||
|
|
||||||
// if write failed
|
// if write failed
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
class BuildData {
|
class BuildData {
|
||||||
static const String name = "ServerBox";
|
static const String name = "ServerBox";
|
||||||
static const int build = 233;
|
static const int build = 233;
|
||||||
static const String engine = "Flutter 3.7.7 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision 2ad6cd72c0 (7 days ago) • 2023-03-08 09:41:59 -0800\nEngine • revision 1837b5be5f\nTools • Dart 2.19.4 • DevTools 2.20.1\n";
|
static const String engine =
|
||||||
|
"Flutter 3.7.7 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision 2ad6cd72c0 (7 days ago) • 2023-03-08 09:41:59 -0800\nEngine • revision 1837b5be5f\nTools • Dart 2.19.4 • DevTools 2.20.1\n";
|
||||||
static const String buildAt = "2023-03-15 23:00:21.075300";
|
static const String buildAt = "2023-03-15 23:00:21.075300";
|
||||||
static const int modifications = 2;
|
static const int modifications = 2;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
import 'build_data.dart';
|
import 'build_data.dart';
|
||||||
|
|
||||||
const seperator = 'SrvBox';
|
const seperator = 'SrvBox';
|
||||||
const shellPath = '.serverbox.sh';
|
const serverBoxDir = r'$HOME/.config/server_box';
|
||||||
|
const shellPath = '$serverBoxDir/mobile_app.sh';
|
||||||
|
const installShellCmd =
|
||||||
|
"mkdir -p $serverBoxDir && echo '$shellCmd' > $shellPath && chmod +x $shellPath";
|
||||||
|
|
||||||
const shellCmd = """
|
const shellCmd = """
|
||||||
# Script for app `${BuildData.name}`
|
# Script for app `${BuildData.name}`
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
import 'package:flutter/widgets.dart';
|
|
||||||
|
|
||||||
const height13 = SizedBox(height: 13);
|
|
||||||
const width13 = SizedBox(width: 13);
|
|
||||||
const width7 = SizedBox(width: 7);
|
|
||||||
@@ -17,3 +17,9 @@ final appIcon = Image.asset('assets/app_icon.png');
|
|||||||
/// Padding
|
/// Padding
|
||||||
|
|
||||||
const roundRectCardPadding = EdgeInsets.symmetric(horizontal: 17, vertical: 13);
|
const roundRectCardPadding = EdgeInsets.symmetric(horizontal: 17, vertical: 13);
|
||||||
|
|
||||||
|
/// SizedBox
|
||||||
|
|
||||||
|
const height13 = SizedBox(height: 13);
|
||||||
|
const width13 = SizedBox(width: 13);
|
||||||
|
const width7 = SizedBox(width: 7);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"about": "About",
|
"about": "About",
|
||||||
"aboutThanks": "\n\nThanks to the following people who participated in the test.",
|
"aboutThanks": "\nThanks to the following people who participated in the test.",
|
||||||
"addAServer": "add a server",
|
"addAServer": "add a server",
|
||||||
"addOne": "Add one",
|
"addOne": "Add one",
|
||||||
"addPrivateKey": "Add private key",
|
"addPrivateKey": "Add private key",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"about": "关于",
|
"about": "关于",
|
||||||
"aboutThanks": "\n\n感谢以下参与软件测试的各位。",
|
"aboutThanks": "\n感谢以下参与软件测试的各位。",
|
||||||
"addAServer": "添加服务器",
|
"addAServer": "添加服务器",
|
||||||
"addOne": "前去新增",
|
"addOne": "前去新增",
|
||||||
"addPrivateKey": "添加一个私钥",
|
"addPrivateKey": "添加一个私钥",
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import '../../../data/model/server/server.dart';
|
|||||||
import '../../../data/model/server/server_status.dart';
|
import '../../../data/model/server/server_status.dart';
|
||||||
import '../../../data/provider/server.dart';
|
import '../../../data/provider/server.dart';
|
||||||
import '../../../data/res/color.dart';
|
import '../../../data/res/color.dart';
|
||||||
import '../../../data/res/sizedbox.dart';
|
|
||||||
import '../../../data/res/ui.dart';
|
import '../../../data/res/ui.dart';
|
||||||
import '../../../data/store/setting.dart';
|
import '../../../data/store/setting.dart';
|
||||||
import '../../../locator.dart';
|
import '../../../locator.dart';
|
||||||
|
|||||||
@@ -431,6 +431,7 @@ class _SettingPageState extends State<SettingPage> {
|
|||||||
error: (error, trace) => Text('${_s.error}: $error'),
|
error: (error, trace) => Text('${_s.error}: $error'),
|
||||||
noData: Text(_s.nullToken),
|
noData: Text(_s.nullToken),
|
||||||
success: (text) {
|
success: (text) {
|
||||||
|
_pushToken = text;
|
||||||
if (_pushToken == null) {
|
if (_pushToken == null) {
|
||||||
text = _s.nullToken;
|
text = _s.nullToken;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user