mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
opt.
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import 'package:fl_lib/fl_lib.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.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/res/provider.dart';
|
||||
import 'package:toolbox/data/res/store.dart';
|
||||
import 'package:toolbox/view/page/backup.dart';
|
||||
import 'package:toolbox/view/page/container.dart';
|
||||
@@ -21,7 +23,6 @@ import 'package:toolbox/view/page/setting/seq/virt_key.dart';
|
||||
import 'package:toolbox/view/page/storage/local.dart';
|
||||
|
||||
import '../data/model/server/snippet.dart';
|
||||
import '../view/page/debug.dart';
|
||||
import '../view/page/editor.dart';
|
||||
import '../view/page/process.dart';
|
||||
import '../view/page/server/edit.dart';
|
||||
@@ -150,7 +151,14 @@ class AppRoutes {
|
||||
}
|
||||
|
||||
static AppRoutes debug({Key? key}) {
|
||||
return AppRoutes(DebugPage(key: key), 'debug');
|
||||
return AppRoutes(
|
||||
DebugPage(
|
||||
key: key,
|
||||
notifier: Pros.debug.widgets,
|
||||
onClear: Pros.debug.clear,
|
||||
),
|
||||
'debug',
|
||||
);
|
||||
}
|
||||
|
||||
static AppRoutes docker({Key? key, required ServerPrivateInfo spi}) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'package:fl_lib/fl_lib.dart';
|
||||
import 'package:plain_notification_token/plain_notification_token.dart';
|
||||
|
||||
|
||||
Future<String?> getToken() async {
|
||||
if (isIOS) {
|
||||
final plainNotificationToken = PlainNotificationToken();
|
||||
@@ -14,10 +13,3 @@ Future<String?> getToken() async {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
String? getFileName(String? path) {
|
||||
if (path == null || path.isEmpty) {
|
||||
return null;
|
||||
}
|
||||
return path.split('/').last;
|
||||
}
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:fl_lib/fl_lib.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:toolbox/core/utils/misc.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
Future<bool> openUrl(String url) async {
|
||||
return await launchUrl(Uri.parse(url), mode: LaunchMode.externalApplication);
|
||||
}
|
||||
|
||||
void setTransparentNavigationBar(BuildContext context) {
|
||||
if (isAndroid) {
|
||||
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
|
||||
SystemChrome.setSystemUIOverlayStyle(
|
||||
const SystemUiOverlayStyle(
|
||||
systemNavigationBarColor: Colors.transparent,
|
||||
systemNavigationBarContrastEnforced: true),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> loadFontFile(String localPath) async {
|
||||
if (localPath.isEmpty) return;
|
||||
final name = getFileName(localPath);
|
||||
if (name == null) return;
|
||||
final file = File(localPath);
|
||||
if (!await file.exists()) return;
|
||||
final fontLoader = FontLoader(name);
|
||||
fontLoader.addFont(file.readAsBytes().byteData);
|
||||
await fontLoader.load();
|
||||
}
|
||||
|
||||
void switchStatusBar({required bool hide}) {
|
||||
if (hide) {
|
||||
SystemChrome.setEnabledSystemUIMode(
|
||||
SystemUiMode.immersiveSticky,
|
||||
overlays: [],
|
||||
);
|
||||
} else {
|
||||
SystemChrome.setEnabledSystemUIMode(
|
||||
SystemUiMode.edgeToEdge,
|
||||
overlays: [SystemUiOverlay.top, SystemUiOverlay.bottom],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user