home static method

String? home({
  1. Map<String, String>? environment,
})

The user's home folder: %USERPROFILE% on Windows, $HOME elsewhere. Null when it can't be found.

Implementation

static String? home({Map<String, String>? environment}) {
  final env = environment ?? Platform.environment;
  final home = Platform.isWindows
      ? _set(env['USERPROFILE']) ??
            (_set(env['HOMEDRIVE']) != null && _set(env['HOMEPATH']) != null
                ? '${_set(env['HOMEDRIVE'])}${_set(env['HOMEPATH'])}'
                : null)
      : _set(env['HOME']);
  return home == null ? null : normalPath(home);
}