{"action":"created","comment":{"url":"https://api.github.com/repos/flutter/engine/pulls/comments/41456759","id":41456759,"diff_hunk":"@@ -237,3 +270,40 @@ class RenderStack extends RenderBox with ContainerRenderObjectMixin<RenderBox, S\n     }\n   }\n }\n+\n+/// Implements the same layout algorithm as RenderStack but only paints the child\n+/// specified by index.\n+class RenderIndexedStack extends RenderStack {\n+  RenderIndexedStack({\n+    List<RenderBox> children,\n+    double horizontalAlignment: 0.0,\n+    double verticalAlignment: 0.0,\n+    int index: 0\n+  }) : _index = index, super(\n+   children: children,\n+   horizontalAlignment: horizontalAlignment,\n+   verticalAlignment: verticalAlignment\n+  );\n+\n+  int get index => _index;\n+  int _index;\n+  void set index (int value) {\n+    if (_index != value) {\n+      _index = value;\n+      markNeedsLayout();\n+    }\n+  }\n+\n+  void defaultPaint(PaintingContext context, Offset offset) {\n+    RenderBox child = firstChild;\n+    int i = 0;\n+    while (child != null && i < index) {\n+      assert(child.parentData is StackParentData);\n+      child = child.parentData.nextSibling;\n+      i += 1;\n+    }\n+    assert(i == index);\n+    assert(child != null);\n+    context.paintChild(child, child.parentData.position + offset);\n+  }\n+}","path":"sky/packages/sky/lib/src/rendering/stack.dart","position":null,"original_position":113,"commit_id":"864eef6a191c4a3814f9edea5f14847ed64b1363","original_commit_id":"81cbfaa9d8fa2e25b3acf3c0d63ba053596fe193","user":{"login":"HansMuller","id":1377460,"avatar_url":"https://avatars.githubusercontent.com/u/1377460?v=3","gravatar_id":"","url":"https://api.github.com/users/HansMuller","html_url":"https://github.com/HansMuller","followers_url":"https://api.github.com/users/HansMuller/followers","following_url":"https://api.github.com/users/HansMuller/following{/other_user}","gists_url":"https://api.github.com/users/HansMuller/gists{/gist_id}","starred_url":"https://api.github.com/users/HansMuller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HansMuller/subscriptions","organizations_url":"https://api.github.com/users/HansMuller/orgs","repos_url":"https://api.github.com/users/HansMuller/repos","events_url":"https://api.github.com/users/HansMuller/events{/privacy}","received_events_url":"https://api.github.com/users/HansMuller/received_events","type":"User","site_admin":false},"body":"Done.","created_at":"2015-10-07T22:34:25Z","updated_at":"2015-10-07T22:34:25Z","html_url":"https://github.com/flutter/engine/pull/1520#discussion_r41456759","pull_request_url":"https://api.github.com/repos/flutter/engine/pulls/1520","_links":{"self":{"href":"https://api.github.com/repos/flutter/engine/pulls/comments/41456759"},"html":{"href":"https://github.com/flutter/engine/pull/1520#discussion_r41456759"},"pull_request":{"href":"https://api.github.com/repos/flutter/engine/pulls/1520"}}},"pull_request":{"url":"https://api.github.com/repos/flutter/engine/pulls/1520","id":47068634,"html_url":"https://github.com/flutter/engine/pull/1520","diff_url":"https://github.com/flutter/engine/pull/1520.diff","patch_url":"https://github.com/flutter/engine/pull/1520.patch","issue_url":"https://api.github.com/repos/flutter/engine/issues/1520","number":1520,"state":"open","locked":false,"title":"Indexed stack","user":{"login":"HansMuller","id":1377460,"avatar_url":"https://avatars.githubusercontent.com/u/1377460?v=3","gravatar_id":"","url":"https://api.github.com/users/HansMuller","html_url":"https://github.com/HansMuller","followers_url":"https://api.github.com/users/HansMuller/followers","following_url":"https://api.github.com/users/HansMuller/following{/other_user}","gists_url":"https://api.github.com/users/HansMuller/gists{/gist_id}","starred_url":"https://api.github.com/users/HansMuller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HansMuller/subscriptions","organizations_url":"https://api.github.com/users/HansMuller/orgs","repos_url":"https://api.github.com/users/HansMuller/repos","events_url":"https://api.github.com/users/HansMuller/events{/privacy}","received_events_url":"https://api.github.com/users/HansMuller/received_events","type":"User","site_admin":false},"body":"Added horizontal and vertical alignment properties to Stack so that the origin of non-positioned children can be specified. Currently all of the non-positioned children just end up with their top-left at 0,0. Now, for example, you can center the children by specifying verticalAlignment: 0.5, horizontalAlignment: 0.5.\r\n\r\nAdded IndexedStack which only paints the stack child specified by the index property. Since it's a Stack, it's as big as the biggest non-positioned child. This component will be essential for building mobile drop down menus.\r\n\r\nAdded a (likely temporary) example that demonstrates IndexedStack.\r\n","created_at":"2015-10-07T19:08:42Z","updated_at":"2015-10-07T22:34:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3e9f17d202311123999899156978ee4530e82a0e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/flutter/engine/pulls/1520/commits","review_comments_url":"https://api.github.com/repos/flutter/engine/pulls/1520/comments","review_comment_url":"https://api.github.com/repos/flutter/engine/pulls/comments{/number}","comments_url":"https://api.github.com/repos/flutter/engine/issues/1520/comments","statuses_url":"https://api.github.com/repos/flutter/engine/statuses/864eef6a191c4a3814f9edea5f14847ed64b1363","head":{"label":"HansMuller:indexed_stack","ref":"indexed_stack","sha":"864eef6a191c4a3814f9edea5f14847ed64b1363","user":{"login":"HansMuller","id":1377460,"avatar_url":"https://avatars.githubusercontent.com/u/1377460?v=3","gravatar_id":"","url":"https://api.github.com/users/HansMuller","html_url":"https://github.com/HansMuller","followers_url":"https://api.github.com/users/HansMuller/followers","following_url":"https://api.github.com/users/HansMuller/following{/other_user}","gists_url":"https://api.github.com/users/HansMuller/gists{/gist_id}","starred_url":"https://api.github.com/users/HansMuller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HansMuller/subscriptions","organizations_url":"https://api.github.com/users/HansMuller/orgs","repos_url":"https://api.github.com/users/HansMuller/repos","events_url":"https://api.github.com/users/HansMuller/events{/privacy}","received_events_url":"https://api.github.com/users/HansMuller/received_events","type":"User","site_admin":false},"repo":{"id":39275287,"name":"engine","full_name":"HansMuller/engine","owner":{"login":"HansMuller","id":1377460,"avatar_url":"https://avatars.githubusercontent.com/u/1377460?v=3","gravatar_id":"","url":"https://api.github.com/users/HansMuller","html_url":"https://github.com/HansMuller","followers_url":"https://api.github.com/users/HansMuller/followers","following_url":"https://api.github.com/users/HansMuller/following{/other_user}","gists_url":"https://api.github.com/users/HansMuller/gists{/gist_id}","starred_url":"https://api.github.com/users/HansMuller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HansMuller/subscriptions","organizations_url":"https://api.github.com/users/HansMuller/orgs","repos_url":"https://api.github.com/users/HansMuller/repos","events_url":"https://api.github.com/users/HansMuller/events{/privacy}","received_events_url":"https://api.github.com/users/HansMuller/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/HansMuller/engine","description":"The Sky engine","fork":true,"url":"https://api.github.com/repos/HansMuller/engine","forks_url":"https://api.github.com/repos/HansMuller/engine/forks","keys_url":"https://api.github.com/repos/HansMuller/engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HansMuller/engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HansMuller/engine/teams","hooks_url":"https://api.github.com/repos/HansMuller/engine/hooks","issue_events_url":"https://api.github.com/repos/HansMuller/engine/issues/events{/number}","events_url":"https://api.github.com/repos/HansMuller/engine/events","assignees_url":"https://api.github.com/repos/HansMuller/engine/assignees{/user}","branches_url":"https://api.github.com/repos/HansMuller/engine/branches{/branch}","tags_url":"https://api.github.com/repos/HansMuller/engine/tags","blobs_url":"https://api.github.com/repos/HansMuller/engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HansMuller/engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HansMuller/engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/HansMuller/engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HansMuller/engine/statuses/{sha}","languages_url":"https://api.github.com/repos/HansMuller/engine/languages","stargazers_url":"https://api.github.com/repos/HansMuller/engine/stargazers","contributors_url":"https://api.github.com/repos/HansMuller/engine/contributors","subscribers_url":"https://api.github.com/repos/HansMuller/engine/subscribers","subscription_url":"https://api.github.com/repos/HansMuller/engine/subscription","commits_url":"https://api.github.com/repos/HansMuller/engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/HansMuller/engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/HansMuller/engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/HansMuller/engine/issues/comments{/number}","contents_url":"https://api.github.com/repos/HansMuller/engine/contents/{+path}","compare_url":"https://api.github.com/repos/HansMuller/engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HansMuller/engine/merges","archive_url":"https://api.github.com/repos/HansMuller/engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HansMuller/engine/downloads","issues_url":"https://api.github.com/repos/HansMuller/engine/issues{/number}","pulls_url":"https://api.github.com/repos/HansMuller/engine/pulls{/number}","milestones_url":"https://api.github.com/repos/HansMuller/engine/milestones{/number}","notifications_url":"https://api.github.com/repos/HansMuller/engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HansMuller/engine/labels{/name}","releases_url":"https://api.github.com/repos/HansMuller/engine/releases{/id}","created_at":"2015-07-17T21:07:51Z","updated_at":"2015-09-21T17:28:09Z","pushed_at":"2015-10-07T22:32:48Z","git_url":"git://github.com/HansMuller/engine.git","ssh_url":"git@github.com:HansMuller/engine.git","clone_url":"https://github.com/HansMuller/engine.git","svn_url":"https://github.com/HansMuller/engine","homepage":null,"size":75847,"stargazers_count":0,"watchers_count":0,"language":"C++","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":"e24d9c1f08cf3e98075e0cd52738a49f18f37ee0","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":39211337,"name":"engine","full_name":"flutter/engine","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/engine","description":"The Flutter engine","fork":false,"url":"https://api.github.com/repos/flutter/engine","forks_url":"https://api.github.com/repos/flutter/engine/forks","keys_url":"https://api.github.com/repos/flutter/engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/flutter/engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/flutter/engine/teams","hooks_url":"https://api.github.com/repos/flutter/engine/hooks","issue_events_url":"https://api.github.com/repos/flutter/engine/issues/events{/number}","events_url":"https://api.github.com/repos/flutter/engine/events","assignees_url":"https://api.github.com/repos/flutter/engine/assignees{/user}","branches_url":"https://api.github.com/repos/flutter/engine/branches{/branch}","tags_url":"https://api.github.com/repos/flutter/engine/tags","blobs_url":"https://api.github.com/repos/flutter/engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/flutter/engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/flutter/engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/flutter/engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/flutter/engine/statuses/{sha}","languages_url":"https://api.github.com/repos/flutter/engine/languages","stargazers_url":"https://api.github.com/repos/flutter/engine/stargazers","contributors_url":"https://api.github.com/repos/flutter/engine/contributors","subscribers_url":"https://api.github.com/repos/flutter/engine/subscribers","subscription_url":"https://api.github.com/repos/flutter/engine/subscription","commits_url":"https://api.github.com/repos/flutter/engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/flutter/engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/flutter/engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/flutter/engine/issues/comments{/number}","contents_url":"https://api.github.com/repos/flutter/engine/contents/{+path}","compare_url":"https://api.github.com/repos/flutter/engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/flutter/engine/merges","archive_url":"https://api.github.com/repos/flutter/engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/flutter/engine/downloads","issues_url":"https://api.github.com/repos/flutter/engine/issues{/number}","pulls_url":"https://api.github.com/repos/flutter/engine/pulls{/number}","milestones_url":"https://api.github.com/repos/flutter/engine/milestones{/number}","notifications_url":"https://api.github.com/repos/flutter/engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/flutter/engine/labels{/name}","releases_url":"https://api.github.com/repos/flutter/engine/releases{/id}","created_at":"2015-07-16T17:39:56Z","updated_at":"2015-10-07T15:45:25Z","pushed_at":"2015-10-07T22:32:49Z","git_url":"git://github.com/flutter/engine.git","ssh_url":"git@github.com:flutter/engine.git","clone_url":"https://github.com/flutter/engine.git","svn_url":"https://github.com/flutter/engine","homepage":"http://flutter.io","size":87294,"stargazers_count":264,"watchers_count":264,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":67,"mirror_url":null,"open_issues_count":192,"forks":67,"open_issues":192,"watchers":264,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/flutter/engine/pulls/1520"},"html":{"href":"https://github.com/flutter/engine/pull/1520"},"issue":{"href":"https://api.github.com/repos/flutter/engine/issues/1520"},"comments":{"href":"https://api.github.com/repos/flutter/engine/issues/1520/comments"},"review_comments":{"href":"https://api.github.com/repos/flutter/engine/pulls/1520/comments"},"review_comment":{"href":"https://api.github.com/repos/flutter/engine/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/flutter/engine/pulls/1520/commits"},"statuses":{"href":"https://api.github.com/repos/flutter/engine/statuses/864eef6a191c4a3814f9edea5f14847ed64b1363"}}}}