update systemutil
This commit is contained in:
parent
33a24578aa
commit
0bf1fecd73
1 changed files with 6 additions and 6 deletions
|
|
@ -58,8 +58,8 @@ Map<String, dynamic>? getMapFromJson(String jsonStr) {
|
|||
JsonCodec codec = JsonCodec();
|
||||
try {
|
||||
map = codec.decode(jsonStr);
|
||||
} catch (e) {
|
||||
print("Error: $e");
|
||||
} on Exception catch (e, stacktace) {
|
||||
print('Error: $e\n\n$stacktace');
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
|
@ -71,7 +71,7 @@ Map<String, dynamic>? getMapFromYaml(String yamlStr) {
|
|||
try {
|
||||
map = jsonDecode(jsonEncode(loadYaml(yamlStr)));
|
||||
} on Exception catch (e, stacktace) {
|
||||
throw Exception('Yaml Pasing error.');
|
||||
throw Exception('Yaml Pasing error.\n\n$stacktace');
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
|
@ -139,11 +139,11 @@ Future<String> getUserPath_() async {
|
|||
Future<String> getDataPath_() async {
|
||||
String path = await getUserPath();
|
||||
if (Platform.isMacOS) {
|
||||
path = '$path/Library/Application Support/${getProjectName()}';
|
||||
path = '$path/Library/Application Support/${await getProjectName()}';
|
||||
} else if (Platform.isLinux) {
|
||||
path = '$path/.config/${getProjectName()}';
|
||||
path = '$path/.config/${await getProjectName()}';
|
||||
} else if (Platform.isWindows) {
|
||||
path = '$path/AppData/Local/${getProjectName()}';
|
||||
path = '$path/AppData/Local/${await getProjectName()}';
|
||||
}
|
||||
var c = Completer<String>();
|
||||
c.complete(path);
|
||||
|
|
|
|||
Loading…
Reference in a new issue