{"action":"created","comment":{"url":"https://api.github.com/repos/flutter/flutter-intellij/pulls/comments/83726886","pull_request_review_id":4551959,"id":83726886,"diff_hunk":"@@ -163,6 +166,23 @@ private static String readVersionFile(String sdkHomePath) {\n     return null;\n   }\n \n+  public static boolean isFlutterModule(@Nullable Module module) {\n+    return module != null && ModuleType.is(module, FlutterModuleType.getInstance());\n+  }\n+\n+  public static boolean hasFlutterModule(@NotNull Project project) {\n+    return ModuleUtil.hasModulesOfType(project, FlutterModuleType.getInstance());\n+  }\n+\n+  /**\n+   * Checks the workspace for any open Flutter projects.\n+   *\n+   * @return true if an open Flutter project is found\n+   */\n+  public static boolean isFluttering() {\n+    return Arrays.stream(ProjectManager.getInstance().getOpenProjects()).anyMatch((Project p) -> FlutterSdkUtil.hasFlutterModule(p));","path":"src/io/flutter/sdk/FlutterSdkUtil.java","position":47,"original_position":47,"commit_id":"cfdebc65ac32106b8ec8dc4a7dd6cd2849653ea2","original_commit_id":"cfdebc65ac32106b8ec8dc4a7dd6cd2849653ea2","user":{"login":"pq","id":67586,"avatar_url":"https://avatars.githubusercontent.com/u/67586?v=3","gravatar_id":"","url":"https://api.github.com/users/pq","html_url":"https://github.com/pq","followers_url":"https://api.github.com/users/pq/followers","following_url":"https://api.github.com/users/pq/following{/other_user}","gists_url":"https://api.github.com/users/pq/gists{/gist_id}","starred_url":"https://api.github.com/users/pq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pq/subscriptions","organizations_url":"https://api.github.com/users/pq/orgs","repos_url":"https://api.github.com/users/pq/repos","events_url":"https://api.github.com/users/pq/events{/privacy}","received_events_url":"https://api.github.com/users/pq/received_events","type":"User","site_admin":false},"body":"Interesting.  I shied away from `e.getProject()` because sometimes it returns null but then I now notice that it's getting called more than once...  So maybe it's not null when it needs to be?","created_at":"2016-10-17T20:29:31Z","updated_at":"2016-10-17T20:29:31Z","html_url":"https://github.com/flutter/flutter-intellij/pull/313#discussion_r83726886","pull_request_url":"https://api.github.com/repos/flutter/flutter-intellij/pulls/313","_links":{"self":{"href":"https://api.github.com/repos/flutter/flutter-intellij/pulls/comments/83726886"},"html":{"href":"https://github.com/flutter/flutter-intellij/pull/313#discussion_r83726886"},"pull_request":{"href":"https://api.github.com/repos/flutter/flutter-intellij/pulls/313"}}},"pull_request":{"url":"https://api.github.com/repos/flutter/flutter-intellij/pulls/313","id":89672027,"html_url":"https://github.com/flutter/flutter-intellij/pull/313","diff_url":"https://github.com/flutter/flutter-intellij/pull/313.diff","patch_url":"https://github.com/flutter/flutter-intellij/pull/313.patch","issue_url":"https://api.github.com/repos/flutter/flutter-intellij/issues/313","number":313,"state":"closed","locked":false,"title":"Only show device selector for Flutter projects (#267).","user":{"login":"pq","id":67586,"avatar_url":"https://avatars.githubusercontent.com/u/67586?v=3","gravatar_id":"","url":"https://api.github.com/users/pq","html_url":"https://github.com/pq","followers_url":"https://api.github.com/users/pq/followers","following_url":"https://api.github.com/users/pq/following{/other_user}","gists_url":"https://api.github.com/users/pq/gists{/gist_id}","starred_url":"https://api.github.com/users/pq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pq/subscriptions","organizations_url":"https://api.github.com/users/pq/orgs","repos_url":"https://api.github.com/users/pq/repos","events_url":"https://api.github.com/users/pq/events{/privacy}","received_events_url":"https://api.github.com/users/pq/received_events","type":"User","site_admin":false},"body":"Fixes #267\r\n\r\n/cc @stevemessick @devoncarew","created_at":"2016-10-17T17:59:32Z","updated_at":"2016-10-17T20:29:31Z","closed_at":"2016-10-17T20:04:19Z","merged_at":"2016-10-17T20:04:18Z","merge_commit_sha":"1be1dd56df0463b25ea5bb606b6b53b349e26e36","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/flutter/flutter-intellij/pulls/313/commits","review_comments_url":"https://api.github.com/repos/flutter/flutter-intellij/pulls/313/comments","review_comment_url":"https://api.github.com/repos/flutter/flutter-intellij/pulls/comments{/number}","comments_url":"https://api.github.com/repos/flutter/flutter-intellij/issues/313/comments","statuses_url":"https://api.github.com/repos/flutter/flutter-intellij/statuses/cfdebc65ac32106b8ec8dc4a7dd6cd2849653ea2","head":{"label":"pq:scope_selector","ref":"scope_selector","sha":"cfdebc65ac32106b8ec8dc4a7dd6cd2849653ea2","user":{"login":"pq","id":67586,"avatar_url":"https://avatars.githubusercontent.com/u/67586?v=3","gravatar_id":"","url":"https://api.github.com/users/pq","html_url":"https://github.com/pq","followers_url":"https://api.github.com/users/pq/followers","following_url":"https://api.github.com/users/pq/following{/other_user}","gists_url":"https://api.github.com/users/pq/gists{/gist_id}","starred_url":"https://api.github.com/users/pq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pq/subscriptions","organizations_url":"https://api.github.com/users/pq/orgs","repos_url":"https://api.github.com/users/pq/repos","events_url":"https://api.github.com/users/pq/events{/privacy}","received_events_url":"https://api.github.com/users/pq/received_events","type":"User","site_admin":false},"repo":{"id":67261255,"name":"flutter-intellij","full_name":"pq/flutter-intellij","owner":{"login":"pq","id":67586,"avatar_url":"https://avatars.githubusercontent.com/u/67586?v=3","gravatar_id":"","url":"https://api.github.com/users/pq","html_url":"https://github.com/pq","followers_url":"https://api.github.com/users/pq/followers","following_url":"https://api.github.com/users/pq/following{/other_user}","gists_url":"https://api.github.com/users/pq/gists{/gist_id}","starred_url":"https://api.github.com/users/pq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pq/subscriptions","organizations_url":"https://api.github.com/users/pq/orgs","repos_url":"https://api.github.com/users/pq/repos","events_url":"https://api.github.com/users/pq/events{/privacy}","received_events_url":"https://api.github.com/users/pq/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pq/flutter-intellij","description":"Flutter Plugin for IntelliJ","fork":true,"url":"https://api.github.com/repos/pq/flutter-intellij","forks_url":"https://api.github.com/repos/pq/flutter-intellij/forks","keys_url":"https://api.github.com/repos/pq/flutter-intellij/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pq/flutter-intellij/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pq/flutter-intellij/teams","hooks_url":"https://api.github.com/repos/pq/flutter-intellij/hooks","issue_events_url":"https://api.github.com/repos/pq/flutter-intellij/issues/events{/number}","events_url":"https://api.github.com/repos/pq/flutter-intellij/events","assignees_url":"https://api.github.com/repos/pq/flutter-intellij/assignees{/user}","branches_url":"https://api.github.com/repos/pq/flutter-intellij/branches{/branch}","tags_url":"https://api.github.com/repos/pq/flutter-intellij/tags","blobs_url":"https://api.github.com/repos/pq/flutter-intellij/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pq/flutter-intellij/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pq/flutter-intellij/git/refs{/sha}","trees_url":"https://api.github.com/repos/pq/flutter-intellij/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pq/flutter-intellij/statuses/{sha}","languages_url":"https://api.github.com/repos/pq/flutter-intellij/languages","stargazers_url":"https://api.github.com/repos/pq/flutter-intellij/stargazers","contributors_url":"https://api.github.com/repos/pq/flutter-intellij/contributors","subscribers_url":"https://api.github.com/repos/pq/flutter-intellij/subscribers","subscription_url":"https://api.github.com/repos/pq/flutter-intellij/subscription","commits_url":"https://api.github.com/repos/pq/flutter-intellij/commits{/sha}","git_commits_url":"https://api.github.com/repos/pq/flutter-intellij/git/commits{/sha}","comments_url":"https://api.github.com/repos/pq/flutter-intellij/comments{/number}","issue_comment_url":"https://api.github.com/repos/pq/flutter-intellij/issues/comments{/number}","contents_url":"https://api.github.com/repos/pq/flutter-intellij/contents/{+path}","compare_url":"https://api.github.com/repos/pq/flutter-intellij/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pq/flutter-intellij/merges","archive_url":"https://api.github.com/repos/pq/flutter-intellij/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pq/flutter-intellij/downloads","issues_url":"https://api.github.com/repos/pq/flutter-intellij/issues{/number}","pulls_url":"https://api.github.com/repos/pq/flutter-intellij/pulls{/number}","milestones_url":"https://api.github.com/repos/pq/flutter-intellij/milestones{/number}","notifications_url":"https://api.github.com/repos/pq/flutter-intellij/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pq/flutter-intellij/labels{/name}","releases_url":"https://api.github.com/repos/pq/flutter-intellij/releases{/id}","deployments_url":"https://api.github.com/repos/pq/flutter-intellij/deployments","created_at":"2016-09-02T23:37:27Z","updated_at":"2016-09-02T23:37:28Z","pushed_at":"2016-10-17T20:02:36Z","git_url":"git://github.com/pq/flutter-intellij.git","ssh_url":"git@github.com:pq/flutter-intellij.git","clone_url":"https://github.com/pq/flutter-intellij.git","svn_url":"https://github.com/pq/flutter-intellij","homepage":"","size":4303,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"flutter:master","ref":"master","sha":"24e432676ba0a134afed8fd8eafe0569ba4bdee4","user":{"login":"flutter","id":14101776,"avatar_url":"https://avatars.githubusercontent.com/u/14101776?v=3","gravatar_id":"","url":"https://api.github.com/users/flutter","html_url":"https://github.com/flutter","followers_url":"https://api.github.com/users/flutter/followers","following_url":"https://api.github.com/users/flutter/following{/other_user}","gists_url":"https://api.github.com/users/flutter/gists{/gist_id}","starred_url":"https://api.github.com/users/flutter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flutter/subscriptions","organizations_url":"https://api.github.com/users/flutter/orgs","repos_url":"https://api.github.com/users/flutter/repos","events_url":"https://api.github.com/users/flutter/events{/privacy}","received_events_url":"https://api.github.com/users/flutter/received_events","type":"Organization","site_admin":false},"repo":{"id":64172164,"name":"flutter-intellij","full_name":"flutter/flutter-intellij","owner":{"login":"flutter","id":14101776,"avatar_url":"https://avatars.githubusercontent.com/u/14101776?v=3","gravatar_id":"","url":"https://api.github.com/users/flutter","html_url":"https://github.com/flutter","followers_url":"https://api.github.com/users/flutter/followers","following_url":"https://api.github.com/users/flutter/following{/other_user}","gists_url":"https://api.github.com/users/flutter/gists{/gist_id}","starred_url":"https://api.github.com/users/flutter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flutter/subscriptions","organizations_url":"https://api.github.com/users/flutter/orgs","repos_url":"https://api.github.com/users/flutter/repos","events_url":"https://api.github.com/users/flutter/events{/privacy}","received_events_url":"https://api.github.com/users/flutter/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/flutter/flutter-intellij","description":"Flutter Plugin for IntelliJ","fork":false,"url":"https://api.github.com/repos/flutter/flutter-intellij","forks_url":"https://api.github.com/repos/flutter/flutter-intellij/forks","keys_url":"https://api.github.com/repos/flutter/flutter-intellij/keys{/key_id}","collaborators_url":"https://api.github.com/repos/flutter/flutter-intellij/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/flutter/flutter-intellij/teams","hooks_url":"https://api.github.com/repos/flutter/flutter-intellij/hooks","issue_events_url":"https://api.github.com/repos/flutter/flutter-intellij/issues/events{/number}","events_url":"https://api.github.com/repos/flutter/flutter-intellij/events","assignees_url":"https://api.github.com/repos/flutter/flutter-intellij/assignees{/user}","branches_url":"https://api.github.com/repos/flutter/flutter-intellij/branches{/branch}","tags_url":"https://api.github.com/repos/flutter/flutter-intellij/tags","blobs_url":"https://api.github.com/repos/flutter/flutter-intellij/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/flutter/flutter-intellij/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/flutter/flutter-intellij/git/refs{/sha}","trees_url":"https://api.github.com/repos/flutter/flutter-intellij/git/trees{/sha}","statuses_url":"https://api.github.com/repos/flutter/flutter-intellij/statuses/{sha}","languages_url":"https://api.github.com/repos/flutter/flutter-intellij/languages","stargazers_url":"https://api.github.com/repos/flutter/flutter-intellij/stargazers","contributors_url":"https://api.github.com/repos/flutter/flutter-intellij/contributors","subscribers_url":"https://api.github.com/repos/flutter/flutter-intellij/subscribers","subscription_url":"https://api.github.com/repos/flutter/flutter-intellij/subscription","commits_url":"https://api.github.com/repos/flutter/flutter-intellij/commits{/sha}","git_commits_url":"https://api.github.com/repos/flutter/flutter-intellij/git/commits{/sha}","comments_url":"https://api.github.com/repos/flutter/flutter-intellij/comments{/number}","issue_comment_url":"https://api.github.com/repos/flutter/flutter-intellij/issues/comments{/number}","contents_url":"https://api.github.com/repos/flutter/flutter-intellij/contents/{+path}","compare_url":"https://api.github.com/repos/flutter/flutter-intellij/compare/{base}...{head}","merges_url":"https://api.github.com/repos/flutter/flutter-intellij/merges","archive_url":"https://api.github.com/repos/flutter/flutter-intellij/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/flutter/flutter-intellij/downloads","issues_url":"https://api.github.com/repos/flutter/flutter-intellij/issues{/number}","pulls_url":"https://api.github.com/repos/flutter/flutter-intellij/pulls{/number}","milestones_url":"https://api.github.com/repos/flutter/flutter-intellij/milestones{/number}","notifications_url":"https://api.github.com/repos/flutter/flutter-intellij/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/flutter/flutter-intellij/labels{/name}","releases_url":"https://api.github.com/repos/flutter/flutter-intellij/releases{/id}","deployments_url":"https://api.github.com/repos/flutter/flutter-intellij/deployments","created_at":"2016-07-25T22:31:03Z","updated_at":"2016-10-16T10:21:17Z","pushed_at":"2016-10-17T20:04:19Z","git_url":"git://github.com/flutter/flutter-intellij.git","ssh_url":"git@github.com:flutter/flutter-intellij.git","clone_url":"https://github.com/flutter/flutter-intellij.git","svn_url":"https://github.com/flutter/flutter-intellij","homepage":"","size":4393,"stargazers_count":9,"watchers_count":9,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":4,"mirror_url":null,"open_issues_count":38,"forks":4,"open_issues":38,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/flutter/flutter-intellij/pulls/313"},"html":{"href":"https://github.com/flutter/flutter-intellij/pull/313"},"issue":{"href":"https://api.github.com/repos/flutter/flutter-intellij/issues/313"},"comments":{"href":"https://api.github.com/repos/flutter/flutter-intellij/issues/313/comments"},"review_comments":{"href":"https://api.github.com/repos/flutter/flutter-intellij/pulls/313/comments"},"review_comment":{"href":"https://api.github.com/repos/flutter/flutter-intellij/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/flutter/flutter-intellij/pulls/313/commits"},"statuses":{"href":"https://api.github.com/repos/flutter/flutter-intellij/statuses/cfdebc65ac32106b8ec8dc4a7dd6cd2849653ea2"}}}}
{"actor":{"display_login":"pq"}}