feat: Cross-platform logic updates

This commit is contained in:
2024-06-16 11:52:25 +08:00
parent cd812cac66
commit 6265acb2ad
30 changed files with 110 additions and 123 deletions

View File

@ -7,6 +7,7 @@ import 'package:starcitizen_doctor/common/utils/log.dart';
class SCLoggerHelper {
static Future<String?> getLogFilePath() async {
if (!Platform.isWindows) return null;
Map<String, String> envVars = Platform.environment;
final appDataPath = envVars["appdata"];
if (appDataPath == null) {
@ -30,6 +31,7 @@ class SCLoggerHelper {
}
static Future<List?> getLauncherLogList() async {
if (!Platform.isWindows) return [];
final jsonLogPath = await getLogFilePath();
if (jsonLogPath == null) return null;
var jsonString = utf8.decode(await File(jsonLogPath).readAsBytes());