bool isExecutableInShellPath(String name)

Source

bool isExecutableInShellPath(String name) {
  String locator = Platform.isWindows ? "where" : "which";
  ProcessResult results = Process.runSync(locator, [name], runInShell: true);

  return results.exitCode == 0;
}