home_directory property

Directory get home_directory

Implementation

static Directory get home_directory {
  if (Dart.isWeb) {
    return Directory("");
  }
  String? configDir;
  if (Platform.isLinux) {
    configDir = path.join(Platform.environment['XDG_CONFIG_HOME'] ??
        Platform.environment['HOME']!);
  } 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'] ?? '');
  }
  return Directory(configDir);
}