mirror of
https://github.com/StarCitizenToolBox/app.git
synced 2026-02-06 15:10:20 +00:00
dart: fix
This commit is contained in:
@@ -118,7 +118,7 @@ class HomeGameLoginUIModel extends _$HomeGameLoginUIModel {
|
||||
}
|
||||
|
||||
// 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 loginMode = false,
|
||||
RsiLoginCallback? rsiLoginCallback,
|
||||
|
||||
@@ -64,7 +64,7 @@ class HomeDownloaderUIModel extends _$HomeDownloaderUIModel {
|
||||
return state;
|
||||
}
|
||||
|
||||
onTapButton(BuildContext context, String key) async {
|
||||
Future<void> onTapButton(BuildContext context, String key) async {
|
||||
final aria2cState = ref.read(aria2cModelProvider);
|
||||
switch (key) {
|
||||
case "pause_all":
|
||||
@@ -194,14 +194,14 @@ class HomeDownloaderUIModel extends _$HomeDownloaderUIModel {
|
||||
return l;
|
||||
}
|
||||
|
||||
openFolder(Aria2Task task) {
|
||||
void openFolder(Aria2Task task) {
|
||||
final f = getFilesFormTask(task).firstOrNull;
|
||||
if (f != null) {
|
||||
SystemHelper.openDir(File(f.path!).absolute.path.replaceAll("/", "\\"));
|
||||
}
|
||||
}
|
||||
|
||||
_listenDownloader() async {
|
||||
Future<void> _listenDownloader() async {
|
||||
try {
|
||||
while (true) {
|
||||
final aria2cState = ref.read(aria2cModelProvider);
|
||||
|
||||
@@ -285,7 +285,7 @@ class HomeGameDoctorUI extends HookConsumerWidget {
|
||||
);
|
||||
}
|
||||
|
||||
_onTapButton(
|
||||
Future<void> _onTapButton(
|
||||
BuildContext context, String key, HomeUIModelState homeState) async {
|
||||
switch (key) {
|
||||
case "rsi_log":
|
||||
|
||||
@@ -113,7 +113,7 @@ class HomeGameDoctorUIModel extends _$HomeGameDoctorUIModel {
|
||||
}
|
||||
|
||||
// ignore: avoid_build_context_in_providers
|
||||
doCheck(BuildContext context) async {
|
||||
Future<void> doCheck(BuildContext context) async {
|
||||
if (state.isChecking) return;
|
||||
state = state.copyWith(
|
||||
isChecking: true, lastScreenInfo: S.current.doctor_action_analyzing);
|
||||
@@ -124,7 +124,7 @@ class HomeGameDoctorUIModel extends _$HomeGameDoctorUIModel {
|
||||
}
|
||||
|
||||
// ignore: avoid_build_context_in_providers
|
||||
_statCheck(BuildContext context) async {
|
||||
Future<void> _statCheck(BuildContext context) async {
|
||||
final homeState = ref.read(homeUIModelProvider);
|
||||
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) {
|
||||
case "external":
|
||||
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());
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ class HomeUIModel extends _$HomeUIModel {
|
||||
return state;
|
||||
}
|
||||
|
||||
closePlacard() async {
|
||||
Future<void> closePlacard() async {
|
||||
final box = await Hive.openBox("app_conf");
|
||||
await box.put("close_placard", state.appPlacardData?.version);
|
||||
state = state.copyWith(appPlacardData: null);
|
||||
@@ -281,7 +281,7 @@ class HomeUIModel extends _$HomeUIModel {
|
||||
}
|
||||
|
||||
// ignore: avoid_build_context_in_providers
|
||||
launchRSI(BuildContext context) async {
|
||||
Future<void> launchRSI(BuildContext context) async {
|
||||
if (state.scInstalledPath == "not_install") {
|
||||
showToast(context, S.current.home_info_valid_installation_required);
|
||||
return;
|
||||
@@ -312,7 +312,7 @@ class HomeUIModel extends _$HomeUIModel {
|
||||
ref.read(localizationUIModelProvider.notifier).onChangeGameInstallPath(value);
|
||||
}
|
||||
|
||||
doLaunchGame(
|
||||
Future<void> doLaunchGame(
|
||||
// ignore: avoid_build_context_in_providers
|
||||
BuildContext context,
|
||||
String launchExe,
|
||||
|
||||
@@ -239,7 +239,7 @@ class InputMethodDialogUI extends HookConsumerWidget {
|
||||
}
|
||||
}
|
||||
|
||||
_onSwitchAutoTranslate(
|
||||
Future<void> _onSwitchAutoTranslate(
|
||||
BuildContext context, InputMethodDialogUIModel model, bool b) async {
|
||||
if (b) {
|
||||
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);
|
||||
final appConf = await Hive.openBox("app_conf");
|
||||
await appConf.put("isEnableAutoTranslate", b);
|
||||
|
||||
@@ -2,7 +2,6 @@ import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:fluent_ui/fluent_ui.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
|
||||
@@ -24,7 +24,7 @@ class ServerQrState extends _$ServerQrState {
|
||||
_context = context;
|
||||
}
|
||||
|
||||
popDialog() {
|
||||
void popDialog() {
|
||||
_context?.pop();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ class AdvancedLocalizationUI extends HookConsumerWidget {
|
||||
);
|
||||
}
|
||||
|
||||
_showContent(BuildContext context, AppAdvancedLocalizationClassKeysData item) {
|
||||
void _showContent(BuildContext context, AppAdvancedLocalizationClassKeysData item) {
|
||||
showDialog(
|
||||
context: 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 patchStatus =
|
||||
MapEntry(await _getLangCfgEnableLang(lang: state.selectedLanguage!), await _getInstalledIniVersion(iniPath));
|
||||
|
||||
@@ -73,7 +73,7 @@ class HomePerformanceUIModel extends _$HomePerformanceUIModel {
|
||||
showGraphicsPerformanceTip: v != _graphicsPerformanceTipVersion);
|
||||
}
|
||||
|
||||
_readConf() async {
|
||||
Future<void> _readConf() async {
|
||||
if (state.performanceMap == null) return;
|
||||
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");
|
||||
await box.put(
|
||||
"close_graphics_performance_tip", _graphicsPerformanceTipVersion);
|
||||
_init();
|
||||
}
|
||||
|
||||
onChangePreProfile(String key) {
|
||||
void onChangePreProfile(String key) {
|
||||
switch (key) {
|
||||
case "low":
|
||||
state.performanceMap?.forEach((key, v) {
|
||||
@@ -144,11 +144,11 @@ class HomePerformanceUIModel extends _$HomePerformanceUIModel {
|
||||
state = state.copyWith();
|
||||
}
|
||||
|
||||
refresh() async {
|
||||
Future<void> refresh() async {
|
||||
_init();
|
||||
}
|
||||
|
||||
clean(BuildContext context) async {
|
||||
Future<void> clean(BuildContext context) async {
|
||||
state = state.copyWith(
|
||||
workingString: S.current.performance_info_delete_config_file);
|
||||
if (await confFile.exists()) {
|
||||
@@ -164,7 +164,7 @@ class HomePerformanceUIModel extends _$HomePerformanceUIModel {
|
||||
state = state.copyWith(workingString: "");
|
||||
}
|
||||
|
||||
cleanShaderCache(BuildContext? context) async {
|
||||
Future<void> cleanShaderCache(BuildContext? context) async {
|
||||
final gameShaderCachePath = await SCLoggerHelper.getShaderCachePath();
|
||||
final l =
|
||||
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;
|
||||
AnalyticsApi.touch("performance_apply");
|
||||
state = state.copyWith(
|
||||
@@ -222,7 +222,7 @@ class HomePerformanceUIModel extends _$HomePerformanceUIModel {
|
||||
state = state.copyWith(workingString: "");
|
||||
}
|
||||
|
||||
updateState() {
|
||||
void updateState() {
|
||||
state = state.copyWith();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user