mirror of
https://ghfast.top/https://github.com/StarCitizenToolBox/app.git
synced 2025-10-14 05:58:44 +08:00
dart: fix
This commit is contained in:
@@ -32,6 +32,8 @@ analyzer:
|
|||||||
exclude:
|
exclude:
|
||||||
- "**/*.g.dart"
|
- "**/*.g.dart"
|
||||||
- "**/*.freezed.dart"
|
- "**/*.freezed.dart"
|
||||||
|
- "**/generated/*.dart"
|
||||||
|
- "**/generated/**/*.dart"
|
||||||
errors:
|
errors:
|
||||||
invalid_annotation_target: ignore
|
invalid_annotation_target: ignore
|
||||||
# Additional information about this file can be found at
|
# Additional information about this file can be found at
|
||||||
|
@@ -81,7 +81,7 @@ GoRouter router(Ref ref) {
|
|||||||
pageBuilder: (context, state) => myPageBuilder(context, state, const AdvancedLocalizationUI()))
|
pageBuilder: (context, state) => myPageBuilder(context, state, const AdvancedLocalizationUI()))
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
GoRoute(path: '/tools', builder: (_, __) => const SizedBox(), routes: [
|
GoRoute(path: '/tools', builder: (_, _) => const SizedBox(), routes: [
|
||||||
GoRoute(
|
GoRoute(
|
||||||
path: 'unp4kc',
|
path: 'unp4kc',
|
||||||
pageBuilder: (context, state) => myPageBuilder(context, state, const UnP4kcUI()),
|
pageBuilder: (context, state) => myPageBuilder(context, state, const UnP4kcUI()),
|
||||||
@@ -295,7 +295,7 @@ class AppGlobalModel extends _$AppGlobalModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void changeLocale(value) async {
|
void changeLocale(dynamic value) async {
|
||||||
final appConfBox = await Hive.openBox("app_conf");
|
final appConfBox = await Hive.openBox("app_conf");
|
||||||
if (value is Locale) {
|
if (value is Locale) {
|
||||||
if (value.languageCode == "auto") {
|
if (value.languageCode == "auto") {
|
||||||
|
@@ -21,7 +21,7 @@ class ConstConf {
|
|||||||
class AppConf {
|
class AppConf {
|
||||||
static List<String>? _networkGameChannels;
|
static List<String>? _networkGameChannels;
|
||||||
|
|
||||||
static setNetworkChannels(List<String>? channels) {
|
static void setNetworkChannels(List<String>? channels) {
|
||||||
_networkGameChannels = channels;
|
_networkGameChannels = channels;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -6,7 +6,7 @@ import 'package:starcitizen_doctor/common/utils/log.dart';
|
|||||||
class SystemHelper {
|
class SystemHelper {
|
||||||
static String powershellPath = "powershell.exe";
|
static String powershellPath = "powershell.exe";
|
||||||
|
|
||||||
static initPowershellPath() async {
|
static Future<void> initPowershellPath() async {
|
||||||
try {
|
try {
|
||||||
var result = await Process.run(powershellPath, ["echo", "pong"]);
|
var result = await Process.run(powershellPath, ["echo", "pong"]);
|
||||||
if (!result.stdout.toString().startsWith("pong") && powershellPath == "powershell.exe") {
|
if (!result.stdout.toString().startsWith("pong") && powershellPath == "powershell.exe") {
|
||||||
@@ -58,7 +58,7 @@ class SystemHelper {
|
|||||||
return result.stderr;
|
return result.stderr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static doRemoveNvmePath() async {
|
static Future<bool> doRemoveNvmePath() async {
|
||||||
try {
|
try {
|
||||||
var result = await Process.run(powershellPath, [
|
var result = await Process.run(powershellPath, [
|
||||||
"Clear-ItemProperty",
|
"Clear-ItemProperty",
|
||||||
@@ -110,7 +110,7 @@ class SystemHelper {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
static killRSILauncher() async {
|
static Future<void> killRSILauncher() async {
|
||||||
var psr = await Process.run(powershellPath, ["ps", "\"RSI Launcher\"", "|select -expand id"]);
|
var psr = await Process.run(powershellPath, ["ps", "\"RSI Launcher\"", "|select -expand id"]);
|
||||||
if (psr.stderr == "") {
|
if (psr.stderr == "") {
|
||||||
for (var value in (psr.stdout ?? "").toString().split("\n")) {
|
for (var value in (psr.stdout ?? "").toString().split("\n")) {
|
||||||
@@ -139,7 +139,7 @@ class SystemHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static checkAndLaunchRSILauncher(String path) async {
|
static Future<void> checkAndLaunchRSILauncher(String path) async {
|
||||||
// check running and kill
|
// check running and kill
|
||||||
await killRSILauncher();
|
await killRSILauncher();
|
||||||
// launch
|
// launch
|
||||||
@@ -254,7 +254,7 @@ foreach ($adapter in $adapterMemory) {
|
|||||||
return int.parse(binaryString, radix: 2).toRadixString(16).padLeft(hexDigits, '0').toUpperCase();
|
return int.parse(binaryString, radix: 2).toRadixString(16).padLeft(hexDigits, '0').toUpperCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future openDir(path, {bool isFile = false}) async {
|
static Future openDir(dynamic path, {bool isFile = false}) async {
|
||||||
dPrint("SystemHelper.openDir path === $path");
|
dPrint("SystemHelper.openDir path === $path");
|
||||||
if (Platform.isWindows) {
|
if (Platform.isWindows) {
|
||||||
await Process.run(
|
await Process.run(
|
||||||
|
@@ -7,7 +7,7 @@ import 'package:starcitizen_doctor/common/rust/api/http_api.dart';
|
|||||||
import 'package:starcitizen_doctor/common/rust/http_package.dart';
|
import 'package:starcitizen_doctor/common/rust/http_package.dart';
|
||||||
|
|
||||||
class RSHttp {
|
class RSHttp {
|
||||||
static init() async {
|
static Future<void> init() async {
|
||||||
await rust_http.setDefaultHeader(headers: {
|
await rust_http.setDefaultHeader(headers: {
|
||||||
"User-Agent":
|
"User-Agent":
|
||||||
"SCToolBox/${ConstConf.appVersion} (${ConstConf.appVersionCode})${ConstConf.isMSE ? "" : " DEV"} RSHttp"
|
"SCToolBox/${ConstConf.appVersion} (${ConstConf.appVersionCode})${ConstConf.isMSE ? "" : " DEV"} RSHttp"
|
||||||
|
@@ -8,7 +8,7 @@ export 'package:starcitizen_doctor/generated/l10n.dart';
|
|||||||
var _logLock = Lock();
|
var _logLock = Lock();
|
||||||
File? _logFile;
|
File? _logFile;
|
||||||
|
|
||||||
void dPrint(src) async {
|
void dPrint(dynamic src) async {
|
||||||
if (kDebugMode) {
|
if (kDebugMode) {
|
||||||
print(src);
|
print(src);
|
||||||
return;
|
return;
|
||||||
|
@@ -50,7 +50,7 @@ class MultiWindowManager {
|
|||||||
// sendAppStateBroadcast(appGlobalState);
|
// sendAppStateBroadcast(appGlobalState);
|
||||||
}
|
}
|
||||||
|
|
||||||
static sendAppStateBroadcast(AppGlobalState appGlobalState) {
|
static void sendAppStateBroadcast(AppGlobalState appGlobalState) {
|
||||||
DesktopMultiWindow.invokeMethod(
|
DesktopMultiWindow.invokeMethod(
|
||||||
0,
|
0,
|
||||||
'app_state_broadcast',
|
'app_state_broadcast',
|
||||||
|
@@ -27,7 +27,7 @@ void main(List<String> args) async {
|
|||||||
runApp(const ProviderScope(child: App()));
|
runApp(const ProviderScope(child: App()));
|
||||||
}
|
}
|
||||||
|
|
||||||
_initWindow() async {
|
Future<void> _initWindow() async {
|
||||||
await windowManager.ensureInitialized();
|
await windowManager.ensureInitialized();
|
||||||
await windowManager.setTitleBarStyle(
|
await windowManager.setTitleBarStyle(
|
||||||
TitleBarStyle.hidden,
|
TitleBarStyle.hidden,
|
||||||
|
@@ -219,7 +219,7 @@ class Unp4kCModel extends _$Unp4kCModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
openFile(String filePath) async {
|
Future<void> openFile(String filePath) async {
|
||||||
final tempDir = await getTemporaryDirectory();
|
final tempDir = await getTemporaryDirectory();
|
||||||
final tempPath =
|
final tempPath =
|
||||||
"${tempDir.absolute.path}\\SCToolbox_unp4kc\\${SCLoggerHelper.getGameChannelID(getGamePath())}\\";
|
"${tempDir.absolute.path}\\SCToolbox_unp4kc\\${SCLoggerHelper.getGameChannelID(getGamePath())}\\";
|
||||||
@@ -229,7 +229,7 @@ class Unp4kCModel extends _$Unp4kCModel {
|
|||||||
extractFile(filePath, tempPath, mode: "extract_open");
|
extractFile(filePath, tempPath, mode: "extract_open");
|
||||||
}
|
}
|
||||||
|
|
||||||
extractFile(String filePath, String outputPath,
|
Future<void> extractFile(String filePath, String outputPath,
|
||||||
{String mode = "extract"}) async {
|
{String mode = "extract"}) async {
|
||||||
// remove first \\
|
// remove first \\
|
||||||
if (filePath.startsWith("\\")) {
|
if (filePath.startsWith("\\")) {
|
||||||
|
@@ -567,7 +567,7 @@ class AboutUI extends HookConsumerWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
_onCheckUpdate(BuildContext context, WidgetRef ref) async {
|
Future<void> _onCheckUpdate(BuildContext context, WidgetRef ref) async {
|
||||||
if (ConstConf.isMSE) {
|
if (ConstConf.isMSE) {
|
||||||
launchUrlString("ms-windows-store://pdp/?productid=9NF3SWFWNKL1");
|
launchUrlString("ms-windows-store://pdp/?productid=9NF3SWFWNKL1");
|
||||||
return;
|
return;
|
||||||
|
@@ -118,7 +118,7 @@ class HomeGameLoginUIModel extends _$HomeGameLoginUIModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ignore: avoid_build_context_in_providers
|
// ignore: avoid_build_context_in_providers
|
||||||
goWebView(BuildContext context, String title, String url,
|
Future<void> goWebView(BuildContext context, String title, String url,
|
||||||
{bool useLocalization = false,
|
{bool useLocalization = false,
|
||||||
bool loginMode = false,
|
bool loginMode = false,
|
||||||
RsiLoginCallback? rsiLoginCallback,
|
RsiLoginCallback? rsiLoginCallback,
|
||||||
|
@@ -64,7 +64,7 @@ class HomeDownloaderUIModel extends _$HomeDownloaderUIModel {
|
|||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
onTapButton(BuildContext context, String key) async {
|
Future<void> onTapButton(BuildContext context, String key) async {
|
||||||
final aria2cState = ref.read(aria2cModelProvider);
|
final aria2cState = ref.read(aria2cModelProvider);
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case "pause_all":
|
case "pause_all":
|
||||||
@@ -194,14 +194,14 @@ class HomeDownloaderUIModel extends _$HomeDownloaderUIModel {
|
|||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
|
|
||||||
openFolder(Aria2Task task) {
|
void openFolder(Aria2Task task) {
|
||||||
final f = getFilesFormTask(task).firstOrNull;
|
final f = getFilesFormTask(task).firstOrNull;
|
||||||
if (f != null) {
|
if (f != null) {
|
||||||
SystemHelper.openDir(File(f.path!).absolute.path.replaceAll("/", "\\"));
|
SystemHelper.openDir(File(f.path!).absolute.path.replaceAll("/", "\\"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_listenDownloader() async {
|
Future<void> _listenDownloader() async {
|
||||||
try {
|
try {
|
||||||
while (true) {
|
while (true) {
|
||||||
final aria2cState = ref.read(aria2cModelProvider);
|
final aria2cState = ref.read(aria2cModelProvider);
|
||||||
|
@@ -285,7 +285,7 @@ class HomeGameDoctorUI extends HookConsumerWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
_onTapButton(
|
Future<void> _onTapButton(
|
||||||
BuildContext context, String key, HomeUIModelState homeState) async {
|
BuildContext context, String key, HomeUIModelState homeState) async {
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case "rsi_log":
|
case "rsi_log":
|
||||||
|
@@ -113,7 +113,7 @@ class HomeGameDoctorUIModel extends _$HomeGameDoctorUIModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ignore: avoid_build_context_in_providers
|
// ignore: avoid_build_context_in_providers
|
||||||
doCheck(BuildContext context) async {
|
Future<void> doCheck(BuildContext context) async {
|
||||||
if (state.isChecking) return;
|
if (state.isChecking) return;
|
||||||
state = state.copyWith(
|
state = state.copyWith(
|
||||||
isChecking: true, lastScreenInfo: S.current.doctor_action_analyzing);
|
isChecking: true, lastScreenInfo: S.current.doctor_action_analyzing);
|
||||||
@@ -124,7 +124,7 @@ class HomeGameDoctorUIModel extends _$HomeGameDoctorUIModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ignore: avoid_build_context_in_providers
|
// ignore: avoid_build_context_in_providers
|
||||||
_statCheck(BuildContext context) async {
|
Future<void> _statCheck(BuildContext context) async {
|
||||||
final homeState = ref.read(homeUIModelProvider);
|
final homeState = ref.read(homeUIModelProvider);
|
||||||
final scInstalledPath = homeState.scInstalledPath!;
|
final scInstalledPath = homeState.scInstalledPath!;
|
||||||
|
|
||||||
|
@@ -718,7 +718,7 @@ class HomeUI extends HookConsumerWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
_showPlacard(BuildContext context, HomeUIModelState homeState) {
|
void _showPlacard(BuildContext context, HomeUIModelState homeState) {
|
||||||
switch (homeState.appPlacardData?.linkType) {
|
switch (homeState.appPlacardData?.linkType) {
|
||||||
case "external":
|
case "external":
|
||||||
launchUrlString(homeState.appPlacardData?.link);
|
launchUrlString(homeState.appPlacardData?.link);
|
||||||
@@ -736,7 +736,7 @@ class HomeUI extends HookConsumerWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_onTapFestival(BuildContext context) {
|
void _onTapFestival(BuildContext context) {
|
||||||
showDialog(context: context, builder: (context) => const HomeCountdownDialogUI());
|
showDialog(context: context, builder: (context) => const HomeCountdownDialogUI());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -69,7 +69,7 @@ class HomeUIModel extends _$HomeUIModel {
|
|||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
closePlacard() async {
|
Future<void> closePlacard() async {
|
||||||
final box = await Hive.openBox("app_conf");
|
final box = await Hive.openBox("app_conf");
|
||||||
await box.put("close_placard", state.appPlacardData?.version);
|
await box.put("close_placard", state.appPlacardData?.version);
|
||||||
state = state.copyWith(appPlacardData: null);
|
state = state.copyWith(appPlacardData: null);
|
||||||
@@ -281,7 +281,7 @@ class HomeUIModel extends _$HomeUIModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ignore: avoid_build_context_in_providers
|
// ignore: avoid_build_context_in_providers
|
||||||
launchRSI(BuildContext context) async {
|
Future<void> launchRSI(BuildContext context) async {
|
||||||
if (state.scInstalledPath == "not_install") {
|
if (state.scInstalledPath == "not_install") {
|
||||||
showToast(context, S.current.home_info_valid_installation_required);
|
showToast(context, S.current.home_info_valid_installation_required);
|
||||||
return;
|
return;
|
||||||
@@ -312,7 +312,7 @@ class HomeUIModel extends _$HomeUIModel {
|
|||||||
ref.read(localizationUIModelProvider.notifier).onChangeGameInstallPath(value);
|
ref.read(localizationUIModelProvider.notifier).onChangeGameInstallPath(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
doLaunchGame(
|
Future<void> doLaunchGame(
|
||||||
// ignore: avoid_build_context_in_providers
|
// ignore: avoid_build_context_in_providers
|
||||||
BuildContext context,
|
BuildContext context,
|
||||||
String launchExe,
|
String launchExe,
|
||||||
|
@@ -239,7 +239,7 @@ class InputMethodDialogUI extends HookConsumerWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_onSwitchAutoTranslate(
|
Future<void> _onSwitchAutoTranslate(
|
||||||
BuildContext context, InputMethodDialogUIModel model, bool b) async {
|
BuildContext context, InputMethodDialogUIModel model, bool b) async {
|
||||||
if (b) {
|
if (b) {
|
||||||
final ok = await showConfirmDialogs(
|
final ok = await showConfirmDialogs(
|
||||||
|
@@ -148,7 +148,7 @@ class InputMethodDialogUIModel extends _$InputMethodDialogUIModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleAutoTranslate(bool b) async {
|
Future<void> toggleAutoTranslate(bool b) async {
|
||||||
state = state.copyWith(isEnableAutoTranslate: b);
|
state = state.copyWith(isEnableAutoTranslate: b);
|
||||||
final appConf = await Hive.openBox("app_conf");
|
final appConf = await Hive.openBox("app_conf");
|
||||||
await appConf.put("isEnableAutoTranslate", b);
|
await appConf.put("isEnableAutoTranslate", b);
|
||||||
|
@@ -2,7 +2,6 @@ import 'dart:convert';
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:fluent_ui/fluent_ui.dart';
|
import 'package:fluent_ui/fluent_ui.dart';
|
||||||
import 'package:flutter/rendering.dart';
|
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||||
|
@@ -24,7 +24,7 @@ class ServerQrState extends _$ServerQrState {
|
|||||||
_context = context;
|
_context = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
popDialog() {
|
void popDialog() {
|
||||||
_context?.pop();
|
_context?.pop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -225,7 +225,7 @@ class AdvancedLocalizationUI extends HookConsumerWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
_showContent(BuildContext context, AppAdvancedLocalizationClassKeysData item) {
|
void _showContent(BuildContext context, AppAdvancedLocalizationClassKeysData item) {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
|
@@ -455,7 +455,7 @@ class LocalizationUIModel extends _$LocalizationUIModel {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
_updateStatus() async {
|
Future<void> _updateStatus() async {
|
||||||
final iniPath = "${_scDataDir.absolute.path}\\Localization\\${state.selectedLanguage}\\global.ini";
|
final iniPath = "${_scDataDir.absolute.path}\\Localization\\${state.selectedLanguage}\\global.ini";
|
||||||
final patchStatus =
|
final patchStatus =
|
||||||
MapEntry(await _getLangCfgEnableLang(lang: state.selectedLanguage!), await _getInstalledIniVersion(iniPath));
|
MapEntry(await _getLangCfgEnableLang(lang: state.selectedLanguage!), await _getInstalledIniVersion(iniPath));
|
||||||
|
@@ -73,7 +73,7 @@ class HomePerformanceUIModel extends _$HomePerformanceUIModel {
|
|||||||
showGraphicsPerformanceTip: v != _graphicsPerformanceTipVersion);
|
showGraphicsPerformanceTip: v != _graphicsPerformanceTipVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
_readConf() async {
|
Future<void> _readConf() async {
|
||||||
if (state.performanceMap == null) return;
|
if (state.performanceMap == null) return;
|
||||||
state = state.copyWith(enabled: true);
|
state = state.copyWith(enabled: true);
|
||||||
|
|
||||||
@@ -95,14 +95,14 @@ class HomePerformanceUIModel extends _$HomePerformanceUIModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
closeTip() async {
|
Future<void> closeTip() async {
|
||||||
final box = await Hive.openBox("app_conf");
|
final box = await Hive.openBox("app_conf");
|
||||||
await box.put(
|
await box.put(
|
||||||
"close_graphics_performance_tip", _graphicsPerformanceTipVersion);
|
"close_graphics_performance_tip", _graphicsPerformanceTipVersion);
|
||||||
_init();
|
_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
onChangePreProfile(String key) {
|
void onChangePreProfile(String key) {
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case "low":
|
case "low":
|
||||||
state.performanceMap?.forEach((key, v) {
|
state.performanceMap?.forEach((key, v) {
|
||||||
@@ -144,11 +144,11 @@ class HomePerformanceUIModel extends _$HomePerformanceUIModel {
|
|||||||
state = state.copyWith();
|
state = state.copyWith();
|
||||||
}
|
}
|
||||||
|
|
||||||
refresh() async {
|
Future<void> refresh() async {
|
||||||
_init();
|
_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
clean(BuildContext context) async {
|
Future<void> clean(BuildContext context) async {
|
||||||
state = state.copyWith(
|
state = state.copyWith(
|
||||||
workingString: S.current.performance_info_delete_config_file);
|
workingString: S.current.performance_info_delete_config_file);
|
||||||
if (await confFile.exists()) {
|
if (await confFile.exists()) {
|
||||||
@@ -164,7 +164,7 @@ class HomePerformanceUIModel extends _$HomePerformanceUIModel {
|
|||||||
state = state.copyWith(workingString: "");
|
state = state.copyWith(workingString: "");
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanShaderCache(BuildContext? context) async {
|
Future<void> cleanShaderCache(BuildContext? context) async {
|
||||||
final gameShaderCachePath = await SCLoggerHelper.getShaderCachePath();
|
final gameShaderCachePath = await SCLoggerHelper.getShaderCachePath();
|
||||||
final l =
|
final l =
|
||||||
await Directory(gameShaderCachePath!).list(recursive: false).toList();
|
await Directory(gameShaderCachePath!).list(recursive: false).toList();
|
||||||
@@ -181,7 +181,7 @@ class HomePerformanceUIModel extends _$HomePerformanceUIModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
applyProfile(bool cleanShader) async {
|
Future<void> applyProfile(bool cleanShader) async {
|
||||||
if (state.performanceMap == null) return;
|
if (state.performanceMap == null) return;
|
||||||
AnalyticsApi.touch("performance_apply");
|
AnalyticsApi.touch("performance_apply");
|
||||||
state = state.copyWith(
|
state = state.copyWith(
|
||||||
@@ -222,7 +222,7 @@ class HomePerformanceUIModel extends _$HomePerformanceUIModel {
|
|||||||
state = state.copyWith(workingString: "");
|
state = state.copyWith(workingString: "");
|
||||||
}
|
}
|
||||||
|
|
||||||
updateState() {
|
void updateState() {
|
||||||
state = state.copyWith();
|
state = state.copyWith();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -164,7 +164,7 @@ class IndexUI extends HookConsumerWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
_goDownloader(BuildContext context) {
|
void _goDownloader(BuildContext context) {
|
||||||
context.push('/index/downloader');
|
context.push('/index/downloader');
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -116,7 +116,7 @@ class SettingsUIModel extends _$SettingsUIModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_saveCustomPath(String pathKey, String dir) async {
|
Future<void> _saveCustomPath(String pathKey, String dir) async {
|
||||||
final confBox = await Hive.openBox("app_conf");
|
final confBox = await Hive.openBox("app_conf");
|
||||||
await confBox.put(pathKey, dir);
|
await confBox.put(pathKey, dir);
|
||||||
}
|
}
|
||||||
@@ -210,7 +210,7 @@ class SettingsUIModel extends _$SettingsUIModel {
|
|||||||
_initState();
|
_initState();
|
||||||
}
|
}
|
||||||
|
|
||||||
showLogs() async {
|
Future<void> showLogs() async {
|
||||||
SystemHelper.openDir(getDPrintFile()?.absolute.path.replaceAll("/", "\\"),
|
SystemHelper.openDir(getDPrintFile()?.absolute.path.replaceAll("/", "\\"),
|
||||||
isFile: true);
|
isFile: true);
|
||||||
}
|
}
|
||||||
|
@@ -90,7 +90,7 @@ class SplashUI extends HookConsumerWidget {
|
|||||||
context.go("/index");
|
context.go("/index");
|
||||||
}
|
}
|
||||||
|
|
||||||
_showAlert(BuildContext context, Box<dynamic> appConf) async {
|
Future<void> _showAlert(BuildContext context, Box<dynamic> appConf) async {
|
||||||
final userOk = await showConfirmDialogs(
|
final userOk = await showConfirmDialogs(
|
||||||
context,
|
context,
|
||||||
S.current.app_splash_dialog_u_a_p_p,
|
S.current.app_splash_dialog_u_a_p_p,
|
||||||
|
@@ -63,7 +63,7 @@ class ToolsUIModel extends _$ToolsUIModel {
|
|||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
loadToolsCard(BuildContext context, {bool skipPathScan = false}) async {
|
Future<void> loadToolsCard(BuildContext context, {bool skipPathScan = false}) async {
|
||||||
if (state.isItemLoading) return;
|
if (state.isItemLoading) return;
|
||||||
var items = <ToolsItemData>[];
|
var items = <ToolsItemData>[];
|
||||||
state = state.copyWith(items: items, isItemLoading: true);
|
state = state.copyWith(items: items, isItemLoading: true);
|
||||||
@@ -352,7 +352,7 @@ class ToolsUIModel extends _$ToolsUIModel {
|
|||||||
SystemHelper.checkAndLaunchRSILauncher(state.rsiLauncherInstalledPath);
|
SystemHelper.checkAndLaunchRSILauncher(state.rsiLauncherInstalledPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
openDir(path) async {
|
Future<void> openDir(dynamic path) async {
|
||||||
SystemHelper.openDir(path);
|
SystemHelper.openDir(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -526,7 +526,7 @@ class ToolsUIModel extends _$ToolsUIModel {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
_onChangePhotographyMode(BuildContext context, bool isEnable) async {
|
Future<void> _onChangePhotographyMode(BuildContext context, bool isEnable) async {
|
||||||
_checkPhotographyStatus(context, setMode: !isEnable).unwrap(context: context);
|
_checkPhotographyStatus(context, setMode: !isEnable).unwrap(context: context);
|
||||||
loadToolsCard(context, skipPathScan: true);
|
loadToolsCard(context, skipPathScan: true);
|
||||||
}
|
}
|
||||||
@@ -539,15 +539,15 @@ class ToolsUIModel extends _$ToolsUIModel {
|
|||||||
state = state.copyWith(rsiLauncherInstalledPath: s);
|
state = state.copyWith(rsiLauncherInstalledPath: s);
|
||||||
}
|
}
|
||||||
|
|
||||||
_doHostsBooster(BuildContext context) async {
|
Future<void> _doHostsBooster(BuildContext context) async {
|
||||||
showDialog(context: context, builder: (BuildContext context) => const HostsBoosterDialogUI());
|
showDialog(context: context, builder: (BuildContext context) => const HostsBoosterDialogUI());
|
||||||
}
|
}
|
||||||
|
|
||||||
_unp4kc(BuildContext context) async {
|
Future<void> _unp4kc(BuildContext context) async {
|
||||||
context.push("/tools/unp4kc");
|
context.push("/tools/unp4kc");
|
||||||
}
|
}
|
||||||
|
|
||||||
static rsiEnhance(BuildContext context, {bool showNotGameInstallMsg = false}) async {
|
static Future<void> rsiEnhance(BuildContext context, {bool showNotGameInstallMsg = false}) async {
|
||||||
if ((await SystemHelper.getPID("\"RSI Launcher\"")).isNotEmpty) {
|
if ((await SystemHelper.getPID("\"RSI Launcher\"")).isNotEmpty) {
|
||||||
if (!context.mounted) return;
|
if (!context.mounted) return;
|
||||||
showToast(context, S.current.tools_action_info_rsi_launcher_running_warning,
|
showToast(context, S.current.tools_action_info_rsi_launcher_running_warning,
|
||||||
@@ -562,7 +562,7 @@ class ToolsUIModel extends _$ToolsUIModel {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
_showLogAnalyze(BuildContext context) async {
|
Future<void> _showLogAnalyze(BuildContext context) async {
|
||||||
if (state.scInstalledPath.isEmpty) {
|
if (state.scInstalledPath.isEmpty) {
|
||||||
showToast(context, S.current.tools_action_info_valid_game_directory_needed);
|
showToast(context, S.current.tools_action_info_valid_game_directory_needed);
|
||||||
return;
|
return;
|
||||||
|
@@ -213,11 +213,11 @@ class WebViewModel {
|
|||||||
return finalUrl;
|
return finalUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
launch(String url, AppVersionData appVersionData) async {
|
Future<void> launch(String url, AppVersionData appVersionData) async {
|
||||||
webview.launch(await _handleMirrorsUrl(url, appVersionData));
|
webview.launch(await _handleMirrorsUrl(url, appVersionData));
|
||||||
}
|
}
|
||||||
|
|
||||||
initLocalization(AppWebLocalizationVersionsData v) async {
|
Future<void> initLocalization(AppWebLocalizationVersionsData v) async {
|
||||||
localizationScript = await rootBundle.loadString('assets/web_script.js');
|
localizationScript = await rootBundle.loadString('assets/web_script.js');
|
||||||
|
|
||||||
/// https://github.com/CxJuice/Uex_Chinese_Translate
|
/// https://github.com/CxJuice/Uex_Chinese_Translate
|
||||||
|
@@ -35,7 +35,7 @@ class _CountdownTimeTextState extends State<CountdownTimeText> {
|
|||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
_onUpdateTime(_) {
|
void _onUpdateTime(_) {
|
||||||
final now = DateTime.now();
|
final now = DateTime.now();
|
||||||
final dur = widget.targetTime.difference(now);
|
final dur = widget.targetTime.difference(now);
|
||||||
setState(() {
|
setState(() {
|
||||||
|
@@ -212,7 +212,7 @@ class LoadingWidget<T> extends HookConsumerWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
addPostFrameCallback(Function() callback) {
|
void addPostFrameCallback(Function() callback) {
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
callback();
|
callback();
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user