base_directory property
Directory
get
base_directory
Implementation
Directory get base_directory {
String? configDir;
if (Platform.isLinux) {
configDir = path.join(
Platform.environment['XDG_CONFIG_HOME'] ??
Platform.environment['HOME']!,
'.pub-cache');
} else if (Platform.isWindows) {
configDir = Platform.environment['APPDATA']!;
} else if (Platform.isMacOS) {
configDir = path.join(
Platform.environment['HOME']!, 'Library', 'Application Support');
} else {
configDir = path.join(Platform.environment['HOME'] ?? '', '.pub-cache');
}
return Directory(configDir);
}