{"action":"created","comment":{"url":"https://api.github.com/repos/flutter/flutter/pulls/comments/83936035","pull_request_review_id":4746650,"id":83936035,"diff_hunk":"@@ -2284,6 +2305,85 @@ abstract class Element implements BuildContext {\n   @override\n   RenderObject findRenderObject() => renderObject;\n \n+  @override\n+  Size get size {\n+    assert(() {\n+      if (_debugLifecycleState != _ElementLifecycle.active) {\n+        throw new FlutterError(\n+          'Cannot get size of inactive element.\\n'\n+          'In order for an element to have a valid size, the element must be '\n+          'active, which means it is part of the tree. Instead, this element '\n+          'is in the $_debugLifecycleState state.\\n'\n+          'The size getter was called for the following element:\\n'\n+          '  $this\\n'\n+        );\n+      }\n+      if (owner._debugBuilding) {\n+        throw new FlutterError(\n+          'Cannot get size during build.\\n'\n+          'The size of this render object has not yet been determined because '\n+          'the framework is still in the process of building widgets, which '\n+          'means the render tree for this frame has not youet been determined. '\n+          'The size getter should only be called from paint callbacks or '\n+          'interaction event handlers (e.g. gesture callbacks).\\n'\n+          '\\n'\n+          'If you need some sizing information during build to decide which '\n+          'widgets to build, consider using a LayoutBuilder widget, which can '\n+          'tell you the layout constraints at a given location in the tree. See '\n+          '<https://docs.flutter.io/flutter/widgets/LayoutBuilder-class.html> '\n+          'for more details.\\n'\n+          '\\n'\n+          'The size getter was called for the following element:\\n'\n+          '  $this\\n'\n+        );\n+      }\n+      return true;\n+    });\n+    final RenderObject renderObject = findRenderObject();\n+    assert(() {\n+      if (renderObject == null) {\n+        throw new FlutterError(\n+          'Cannot get size without a render object.\\n'\n+          'In order for an element to have a valid size, the element must have '\n+          'an assoicated render object. This element does not have an assoicated '\n+          'render object, which typically means that the size getter was called '\n+          'too early in the pipeline (e.g., during the build phase) before the '\n+          'framework has created the render tree.\\n'\n+          'The size getter was called for the following element:\\n'\n+          '  $this\\n'\n+        );\n+      }\n+      if (renderObject is! RenderBox) {\n+        throw new FlutterError(\n+          'Cannot get size from a render object that is not a RenderBox.\\n'\n+          'Instead of being a subtype of RenderBox, the render object associated '\n+          'with this element is a ${renderObject.runtimeType}. If this type of '\n+          'render object does have a size, consider calling findRenderObject '\n+          'and extracting its size manually.\\n'\n+          'The size getter was called for the following element:\\n'\n+          '  $this\\n'\n+        );\n+      }\n+      final RenderBox box = renderObject;\n+      if (!box.hasSize || box.needsLayout) {\n+        throw new FlutterError(\n+          'Cannot get size from a render object that has not been through layout.\\n'\n+          'The size of this render object has not yet been determined because '\n+          'this render object has not yet been through layout, which typically '\n+          'means that the size getter was called too early in the pipeline '\n+          '(e.g., during the build pahse) before the framework has determined '","path":"packages/flutter/lib/src/widgets/framework.dart","position":113,"original_position":113,"commit_id":"68cbd43ed0281a5c61bf26f2c467159bcb4e75a4","original_commit_id":"68cbd43ed0281a5c61bf26f2c467159bcb4e75a4","user":{"login":"Hixie","id":551196,"avatar_url":"https://avatars.githubusercontent.com/u/551196?v=3","gravatar_id":"","url":"https://api.github.com/users/Hixie","html_url":"https://github.com/Hixie","followers_url":"https://api.github.com/users/Hixie/followers","following_url":"https://api.github.com/users/Hixie/following{/other_user}","gists_url":"https://api.github.com/users/Hixie/gists{/gist_id}","starred_url":"https://api.github.com/users/Hixie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hixie/subscriptions","organizations_url":"https://api.github.com/users/Hixie/orgs","repos_url":"https://api.github.com/users/Hixie/repos","events_url":"https://api.github.com/users/Hixie/events{/privacy}","received_events_url":"https://api.github.com/users/Hixie/received_events","type":"User","site_admin":false},"body":"pahse -> phase","created_at":"2016-10-18T19:50:34Z","updated_at":"2016-10-18T19:50:34Z","html_url":"https://github.com/flutter/flutter/pull/6355#discussion_r83936035","pull_request_url":"https://api.github.com/repos/flutter/flutter/pulls/6355","_links":{"self":{"href":"https://api.github.com/repos/flutter/flutter/pulls/comments/83936035"},"html":{"href":"https://github.com/flutter/flutter/pull/6355#discussion_r83936035"},"pull_request":{"href":"https://api.github.com/repos/flutter/flutter/pulls/6355"}}},"pull_request":{"url":"https://api.github.com/repos/flutter/flutter/pulls/6355","id":89560958,"html_url":"https://github.com/flutter/flutter/pull/6355","diff_url":"https://github.com/flutter/flutter/pull/6355.diff","patch_url":"https://github.com/flutter/flutter/pull/6355.patch","issue_url":"https://api.github.com/repos/flutter/flutter/issues/6355","number":6355,"state":"closed","locked":false,"title":"Add BuildContext.size as a convenience getter","user":{"login":"abarth","id":112007,"avatar_url":"https://avatars.githubusercontent.com/u/112007?v=3","gravatar_id":"","url":"https://api.github.com/users/abarth","html_url":"https://github.com/abarth","followers_url":"https://api.github.com/users/abarth/followers","following_url":"https://api.github.com/users/abarth/following{/other_user}","gists_url":"https://api.github.com/users/abarth/gists{/gist_id}","starred_url":"https://api.github.com/users/abarth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abarth/subscriptions","organizations_url":"https://api.github.com/users/abarth/orgs","repos_url":"https://api.github.com/users/abarth/repos","events_url":"https://api.github.com/users/abarth/events{/privacy}","received_events_url":"https://api.github.com/users/abarth/received_events","type":"User","site_admin":false},"body":"Developers need to get the size of the BuildContext sufficiently often\r\nthat we should provide a convenient getter for the value. Having this\r\ngetter is also an opportunity to catch common mistakes and provide\r\nuseful error messages that guide developers towards better patterns.\r\n\r\nFixes #2321","created_at":"2016-10-17T05:00:31Z","updated_at":"2016-10-18T19:50:34Z","closed_at":"2016-10-17T19:33:12Z","merged_at":"2016-10-17T19:33:12Z","merge_commit_sha":"63e7a0e80af09b2367815bdaaa200f2c12fc24f8","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/flutter/flutter/pulls/6355/commits","review_comments_url":"https://api.github.com/repos/flutter/flutter/pulls/6355/comments","review_comment_url":"https://api.github.com/repos/flutter/flutter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/flutter/flutter/issues/6355/comments","statuses_url":"https://api.github.com/repos/flutter/flutter/statuses/68cbd43ed0281a5c61bf26f2c467159bcb4e75a4","head":{"label":"abarth:context_size","ref":"context_size","sha":"68cbd43ed0281a5c61bf26f2c467159bcb4e75a4","user":{"login":"abarth","id":112007,"avatar_url":"https://avatars.githubusercontent.com/u/112007?v=3","gravatar_id":"","url":"https://api.github.com/users/abarth","html_url":"https://github.com/abarth","followers_url":"https://api.github.com/users/abarth/followers","following_url":"https://api.github.com/users/abarth/following{/other_user}","gists_url":"https://api.github.com/users/abarth/gists{/gist_id}","starred_url":"https://api.github.com/users/abarth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abarth/subscriptions","organizations_url":"https://api.github.com/users/abarth/orgs","repos_url":"https://api.github.com/users/abarth/repos","events_url":"https://api.github.com/users/abarth/events{/privacy}","received_events_url":"https://api.github.com/users/abarth/received_events","type":"User","site_admin":false},"repo":{"id":45444193,"name":"flutter","full_name":"abarth/flutter","owner":{"login":"abarth","id":112007,"avatar_url":"https://avatars.githubusercontent.com/u/112007?v=3","gravatar_id":"","url":"https://api.github.com/users/abarth","html_url":"https://github.com/abarth","followers_url":"https://api.github.com/users/abarth/followers","following_url":"https://api.github.com/users/abarth/following{/other_user}","gists_url":"https://api.github.com/users/abarth/gists{/gist_id}","starred_url":"https://api.github.com/users/abarth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abarth/subscriptions","organizations_url":"https://api.github.com/users/abarth/orgs","repos_url":"https://api.github.com/users/abarth/repos","events_url":"https://api.github.com/users/abarth/events{/privacy}","received_events_url":"https://api.github.com/users/abarth/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/abarth/flutter","description":"The Flutter framework","fork":true,"url":"https://api.github.com/repos/abarth/flutter","forks_url":"https://api.github.com/repos/abarth/flutter/forks","keys_url":"https://api.github.com/repos/abarth/flutter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/abarth/flutter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/abarth/flutter/teams","hooks_url":"https://api.github.com/repos/abarth/flutter/hooks","issue_events_url":"https://api.github.com/repos/abarth/flutter/issues/events{/number}","events_url":"https://api.github.com/repos/abarth/flutter/events","assignees_url":"https://api.github.com/repos/abarth/flutter/assignees{/user}","branches_url":"https://api.github.com/repos/abarth/flutter/branches{/branch}","tags_url":"https://api.github.com/repos/abarth/flutter/tags","blobs_url":"https://api.github.com/repos/abarth/flutter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/abarth/flutter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/abarth/flutter/git/refs{/sha}","trees_url":"https://api.github.com/repos/abarth/flutter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/abarth/flutter/statuses/{sha}","languages_url":"https://api.github.com/repos/abarth/flutter/languages","stargazers_url":"https://api.github.com/repos/abarth/flutter/stargazers","contributors_url":"https://api.github.com/repos/abarth/flutter/contributors","subscribers_url":"https://api.github.com/repos/abarth/flutter/subscribers","subscription_url":"https://api.github.com/repos/abarth/flutter/subscription","commits_url":"https://api.github.com/repos/abarth/flutter/commits{/sha}","git_commits_url":"https://api.github.com/repos/abarth/flutter/git/commits{/sha}","comments_url":"https://api.github.com/repos/abarth/flutter/comments{/number}","issue_comment_url":"https://api.github.com/repos/abarth/flutter/issues/comments{/number}","contents_url":"https://api.github.com/repos/abarth/flutter/contents/{+path}","compare_url":"https://api.github.com/repos/abarth/flutter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/abarth/flutter/merges","archive_url":"https://api.github.com/repos/abarth/flutter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/abarth/flutter/downloads","issues_url":"https://api.github.com/repos/abarth/flutter/issues{/number}","pulls_url":"https://api.github.com/repos/abarth/flutter/pulls{/number}","milestones_url":"https://api.github.com/repos/abarth/flutter/milestones{/number}","notifications_url":"https://api.github.com/repos/abarth/flutter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/abarth/flutter/labels{/name}","releases_url":"https://api.github.com/repos/abarth/flutter/releases{/id}","deployments_url":"https://api.github.com/repos/abarth/flutter/deployments","created_at":"2015-11-03T05:34:45Z","updated_at":"2016-04-08T16:45:41Z","pushed_at":"2016-10-18T17:04:20Z","git_url":"git://github.com/abarth/flutter.git","ssh_url":"git@github.com:abarth/flutter.git","clone_url":"https://github.com/abarth/flutter.git","svn_url":"https://github.com/abarth/flutter","homepage":"http://flutter.io","size":22258,"stargazers_count":0,"watchers_count":0,"language":"Dart","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"flutter:master","ref":"master","sha":"e9b041f21e221fd83c8732d940b98cb5109679b1","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":31792824,"name":"flutter","full_name":"flutter/flutter","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","description":"Framework for building high-performance, high-fidelity iOS and Android apps.","fork":false,"url":"https://api.github.com/repos/flutter/flutter","forks_url":"https://api.github.com/repos/flutter/flutter/forks","keys_url":"https://api.github.com/repos/flutter/flutter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/flutter/flutter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/flutter/flutter/teams","hooks_url":"https://api.github.com/repos/flutter/flutter/hooks","issue_events_url":"https://api.github.com/repos/flutter/flutter/issues/events{/number}","events_url":"https://api.github.com/repos/flutter/flutter/events","assignees_url":"https://api.github.com/repos/flutter/flutter/assignees{/user}","branches_url":"https://api.github.com/repos/flutter/flutter/branches{/branch}","tags_url":"https://api.github.com/repos/flutter/flutter/tags","blobs_url":"https://api.github.com/repos/flutter/flutter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/flutter/flutter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/flutter/flutter/git/refs{/sha}","trees_url":"https://api.github.com/repos/flutter/flutter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/flutter/flutter/statuses/{sha}","languages_url":"https://api.github.com/repos/flutter/flutter/languages","stargazers_url":"https://api.github.com/repos/flutter/flutter/stargazers","contributors_url":"https://api.github.com/repos/flutter/flutter/contributors","subscribers_url":"https://api.github.com/repos/flutter/flutter/subscribers","subscription_url":"https://api.github.com/repos/flutter/flutter/subscription","commits_url":"https://api.github.com/repos/flutter/flutter/commits{/sha}","git_commits_url":"https://api.github.com/repos/flutter/flutter/git/commits{/sha}","comments_url":"https://api.github.com/repos/flutter/flutter/comments{/number}","issue_comment_url":"https://api.github.com/repos/flutter/flutter/issues/comments{/number}","contents_url":"https://api.github.com/repos/flutter/flutter/contents/{+path}","compare_url":"https://api.github.com/repos/flutter/flutter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/flutter/flutter/merges","archive_url":"https://api.github.com/repos/flutter/flutter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/flutter/flutter/downloads","issues_url":"https://api.github.com/repos/flutter/flutter/issues{/number}","pulls_url":"https://api.github.com/repos/flutter/flutter/pulls{/number}","milestones_url":"https://api.github.com/repos/flutter/flutter/milestones{/number}","notifications_url":"https://api.github.com/repos/flutter/flutter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/flutter/flutter/labels{/name}","releases_url":"https://api.github.com/repos/flutter/flutter/releases{/id}","deployments_url":"https://api.github.com/repos/flutter/flutter/deployments","created_at":"2015-03-06T22:54:58Z","updated_at":"2016-10-18T18:04:47Z","pushed_at":"2016-10-18T18:51:35Z","git_url":"git://github.com/flutter/flutter.git","ssh_url":"git@github.com:flutter/flutter.git","clone_url":"https://github.com/flutter/flutter.git","svn_url":"https://github.com/flutter/flutter","homepage":"https://flutter.io","size":117204,"stargazers_count":3346,"watchers_count":3346,"language":"Dart","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":358,"mirror_url":null,"open_issues_count":1319,"forks":358,"open_issues":1319,"watchers":3346,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/flutter/flutter/pulls/6355"},"html":{"href":"https://github.com/flutter/flutter/pull/6355"},"issue":{"href":"https://api.github.com/repos/flutter/flutter/issues/6355"},"comments":{"href":"https://api.github.com/repos/flutter/flutter/issues/6355/comments"},"review_comments":{"href":"https://api.github.com/repos/flutter/flutter/pulls/6355/comments"},"review_comment":{"href":"https://api.github.com/repos/flutter/flutter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/flutter/flutter/pulls/6355/commits"},"statuses":{"href":"https://api.github.com/repos/flutter/flutter/statuses/68cbd43ed0281a5c61bf26f2c467159bcb4e75a4"}}}}
{"actor":{"display_login":"Hixie"}}