mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00
fix: Use Platform.environment instead String.fromEnvironment
The latter seems return an empty string. See: https://github.com/flutter/flutter/issues/55870#issuecomment-936612420
This commit is contained in:
parent
e6479c2841
commit
0eaf3a5e0c
@ -99,11 +99,11 @@ class AppLogger {
|
||||
// See https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
||||
// TODO: Use path_provider once it supports XDG_STATE_HOME
|
||||
if (const bool.hasEnvironment("XDG_STATE_HOME")) {
|
||||
String xdgStateHomeRaw = const String.fromEnvironment("XDG_STATE_HOME");
|
||||
String xdgStateHomeRaw = Platform.environment["XDG_STATE_HOME"] ?? "";
|
||||
if (xdgStateHomeRaw.isNotEmpty) {
|
||||
return xdgStateHomeRaw;
|
||||
}
|
||||
}
|
||||
return join(const String.fromEnvironment("HOME"), ".local", "state");
|
||||
return join(Platform.environment["HOME"] ?? "", ".local", "state");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user