{"action":"created","comment":{"url":"https://api.github.com/repos/flutter/flutter/pulls/comments/58909430","id":58909430,"diff_hunk":"@@ -0,0 +1,252 @@\n+// Copyright 2016 The Chromium Authors. All rights reserved.\n+// Use of this source code is governed by a BSD-style license that can be\n+// found in the LICENSE file.\n+\n+import 'package:flutter/material.dart';\n+import 'package:flutter_markdown/flutter_markdown.dart';\n+\n+import '../gallery/syntax_highlighter.dart';\n+\n+class SingleComponentDemoData {\n+  SingleComponentDemoData({\n+    this.builder,\n+    this.exampleCode,\n+    this.description,\n+    this.onPressedDemo\n+  });\n+\n+  final WidgetBuilder builder;\n+  final String exampleCode;\n+  final String description;\n+  final VoidCallback onPressedDemo;\n+}\n+\n+class ComponentDemoTabData extends SingleComponentDemoData {\n+  ComponentDemoTabData({\n+    WidgetBuilder builder,\n+    String exampleCode,\n+    String description,\n+    VoidCallback onPressedDemo,\n+    this.tabName\n+  }) : super(\n+    builder: builder,\n+    exampleCode: exampleCode,\n+    description: description,\n+    onPressedDemo: onPressedDemo\n+  );\n+\n+  final String tabName;\n+\n+  static Map<ComponentDemoTabData, TabLabel> buildTabLabels(List<ComponentDemoTabData> demos) {\n+    return new Map<ComponentDemoTabData, TabLabel>.fromIterable(\n+      demos,\n+      value: (ComponentDemoTabData demo) => new TabLabel(text: demo.tabName)\n+    );\n+  }\n+\n+  @override\n+  bool operator==(Object other) {\n+    if (other.runtimeType != runtimeType)\n+      return false;\n+    ComponentDemoTabData typedOther = other;\n+    return typedOther.tabName == tabName && typedOther.description == description;\n+  }\n+\n+  @override\n+  int get hashCode => hashValues(tabName.hashCode, description.hashCode);\n+}\n+\n+class TabbedComponentDemoScaffold extends StatelessWidget {\n+  TabbedComponentDemoScaffold({\n+    this.title,\n+    this.demos\n+  });\n+\n+  final List<ComponentDemoTabData> demos;\n+  final String title;\n+\n+  @override\n+  Widget build(BuildContext context) {\n+    return new TabBarSelection<ComponentDemoTabData>(\n+      values: demos,\n+      child: new Scaffold(\n+        appBar: new AppBar(\n+          title: new Text(title),\n+          tabBar: new TabBar<ComponentDemoTabData>(\n+            isScrollable: true,\n+            labels: ComponentDemoTabData.buildTabLabels(demos)\n+          )\n+        ),\n+        body: new TabbedComponentDemo(demos)\n+      )\n+    );\n+  }\n+}\n+\n+class TabbedComponentDemo extends StatelessWidget {\n+  TabbedComponentDemo(this.demos);\n+\n+  final List<ComponentDemoTabData> demos;\n+\n+  @override\n+  Widget build(BuildContext context) {\n+    return new TabBarView<ComponentDemoTabData>(\n+      children: demos.map(buildTabView).toList()\n+    );\n+  }\n+\n+  Widget buildTabView(ComponentDemoTabData demo) {\n+    return new Builder(","path":"examples/material_gallery/lib/gallery/demo.dart","position":99,"original_position":99,"commit_id":"d01f4a75253f8616331dea7f03d03fce2d8f03e7","original_commit_id":"d01f4a75253f8616331dea7f03d03fce2d8f03e7","user":{"login":"vlidholt","id":1539812,"avatar_url":"https://avatars.githubusercontent.com/u/1539812?v=3","gravatar_id":"","url":"https://api.github.com/users/vlidholt","html_url":"https://github.com/vlidholt","followers_url":"https://api.github.com/users/vlidholt/followers","following_url":"https://api.github.com/users/vlidholt/following{/other_user}","gists_url":"https://api.github.com/users/vlidholt/gists{/gist_id}","starred_url":"https://api.github.com/users/vlidholt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vlidholt/subscriptions","organizations_url":"https://api.github.com/users/vlidholt/orgs","repos_url":"https://api.github.com/users/vlidholt/repos","events_url":"https://api.github.com/users/vlidholt/events{/privacy}","received_events_url":"https://api.github.com/users/vlidholt/received_events","type":"User","site_admin":false},"body":"Thanks! Removing the Builder!","created_at":"2016-04-07T17:16:59Z","updated_at":"2016-04-07T17:16:59Z","html_url":"https://github.com/flutter/flutter/pull/3174#discussion_r58909430","pull_request_url":"https://api.github.com/repos/flutter/flutter/pulls/3174","_links":{"self":{"href":"https://api.github.com/repos/flutter/flutter/pulls/comments/58909430"},"html":{"href":"https://github.com/flutter/flutter/pull/3174#discussion_r58909430"},"pull_request":{"href":"https://api.github.com/repos/flutter/flutter/pulls/3174"}}},"pull_request":{"url":"https://api.github.com/repos/flutter/flutter/pulls/3174","id":65665006,"html_url":"https://github.com/flutter/flutter/pull/3174","diff_url":"https://github.com/flutter/flutter/pull/3174.diff","patch_url":"https://github.com/flutter/flutter/pull/3174.patch","issue_url":"https://api.github.com/repos/flutter/flutter/issues/3174","number":3174,"state":"open","locked":false,"title":"New version of Button demo","user":{"login":"vlidholt","id":1539812,"avatar_url":"https://avatars.githubusercontent.com/u/1539812?v=3","gravatar_id":"","url":"https://api.github.com/users/vlidholt","html_url":"https://github.com/vlidholt","followers_url":"https://api.github.com/users/vlidholt/followers","following_url":"https://api.github.com/users/vlidholt/following{/other_user}","gists_url":"https://api.github.com/users/vlidholt/gists{/gist_id}","starred_url":"https://api.github.com/users/vlidholt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vlidholt/subscriptions","organizations_url":"https://api.github.com/users/vlidholt/orgs","repos_url":"https://api.github.com/users/vlidholt/repos","events_url":"https://api.github.com/users/vlidholt/events{/privacy}","received_events_url":"https://api.github.com/users/vlidholt/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-07T17:04:25Z","updated_at":"2016-04-07T17:16:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"82afd1ec18f165d73ac7cc10c94786ba04d39d9b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/flutter/flutter/pulls/3174/commits","review_comments_url":"https://api.github.com/repos/flutter/flutter/pulls/3174/comments","review_comment_url":"https://api.github.com/repos/flutter/flutter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/flutter/flutter/issues/3174/comments","statuses_url":"https://api.github.com/repos/flutter/flutter/statuses/d01f4a75253f8616331dea7f03d03fce2d8f03e7","head":{"label":"vlidholt:master","ref":"master","sha":"d01f4a75253f8616331dea7f03d03fce2d8f03e7","user":{"login":"vlidholt","id":1539812,"avatar_url":"https://avatars.githubusercontent.com/u/1539812?v=3","gravatar_id":"","url":"https://api.github.com/users/vlidholt","html_url":"https://github.com/vlidholt","followers_url":"https://api.github.com/users/vlidholt/followers","following_url":"https://api.github.com/users/vlidholt/following{/other_user}","gists_url":"https://api.github.com/users/vlidholt/gists{/gist_id}","starred_url":"https://api.github.com/users/vlidholt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vlidholt/subscriptions","organizations_url":"https://api.github.com/users/vlidholt/orgs","repos_url":"https://api.github.com/users/vlidholt/repos","events_url":"https://api.github.com/users/vlidholt/events{/privacy}","received_events_url":"https://api.github.com/users/vlidholt/received_events","type":"User","site_admin":false},"repo":{"id":46521777,"name":"flutter","full_name":"vlidholt/flutter","owner":{"login":"vlidholt","id":1539812,"avatar_url":"https://avatars.githubusercontent.com/u/1539812?v=3","gravatar_id":"","url":"https://api.github.com/users/vlidholt","html_url":"https://github.com/vlidholt","followers_url":"https://api.github.com/users/vlidholt/followers","following_url":"https://api.github.com/users/vlidholt/following{/other_user}","gists_url":"https://api.github.com/users/vlidholt/gists{/gist_id}","starred_url":"https://api.github.com/users/vlidholt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vlidholt/subscriptions","organizations_url":"https://api.github.com/users/vlidholt/orgs","repos_url":"https://api.github.com/users/vlidholt/repos","events_url":"https://api.github.com/users/vlidholt/events{/privacy}","received_events_url":"https://api.github.com/users/vlidholt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vlidholt/flutter","description":"The Flutter framework","fork":true,"url":"https://api.github.com/repos/vlidholt/flutter","forks_url":"https://api.github.com/repos/vlidholt/flutter/forks","keys_url":"https://api.github.com/repos/vlidholt/flutter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vlidholt/flutter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vlidholt/flutter/teams","hooks_url":"https://api.github.com/repos/vlidholt/flutter/hooks","issue_events_url":"https://api.github.com/repos/vlidholt/flutter/issues/events{/number}","events_url":"https://api.github.com/repos/vlidholt/flutter/events","assignees_url":"https://api.github.com/repos/vlidholt/flutter/assignees{/user}","branches_url":"https://api.github.com/repos/vlidholt/flutter/branches{/branch}","tags_url":"https://api.github.com/repos/vlidholt/flutter/tags","blobs_url":"https://api.github.com/repos/vlidholt/flutter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vlidholt/flutter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vlidholt/flutter/git/refs{/sha}","trees_url":"https://api.github.com/repos/vlidholt/flutter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vlidholt/flutter/statuses/{sha}","languages_url":"https://api.github.com/repos/vlidholt/flutter/languages","stargazers_url":"https://api.github.com/repos/vlidholt/flutter/stargazers","contributors_url":"https://api.github.com/repos/vlidholt/flutter/contributors","subscribers_url":"https://api.github.com/repos/vlidholt/flutter/subscribers","subscription_url":"https://api.github.com/repos/vlidholt/flutter/subscription","commits_url":"https://api.github.com/repos/vlidholt/flutter/commits{/sha}","git_commits_url":"https://api.github.com/repos/vlidholt/flutter/git/commits{/sha}","comments_url":"https://api.github.com/repos/vlidholt/flutter/comments{/number}","issue_comment_url":"https://api.github.com/repos/vlidholt/flutter/issues/comments{/number}","contents_url":"https://api.github.com/repos/vlidholt/flutter/contents/{+path}","compare_url":"https://api.github.com/repos/vlidholt/flutter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vlidholt/flutter/merges","archive_url":"https://api.github.com/repos/vlidholt/flutter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vlidholt/flutter/downloads","issues_url":"https://api.github.com/repos/vlidholt/flutter/issues{/number}","pulls_url":"https://api.github.com/repos/vlidholt/flutter/pulls{/number}","milestones_url":"https://api.github.com/repos/vlidholt/flutter/milestones{/number}","notifications_url":"https://api.github.com/repos/vlidholt/flutter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vlidholt/flutter/labels{/name}","releases_url":"https://api.github.com/repos/vlidholt/flutter/releases{/id}","deployments_url":"https://api.github.com/repos/vlidholt/flutter/deployments","created_at":"2015-11-19T21:35:17Z","updated_at":"2016-01-29T22:35:25Z","pushed_at":"2016-04-07T16:52:50Z","git_url":"git://github.com/vlidholt/flutter.git","ssh_url":"git@github.com:vlidholt/flutter.git","clone_url":"https://github.com/vlidholt/flutter.git","svn_url":"https://github.com/vlidholt/flutter","homepage":"http://flutter.io","size":15370,"stargazers_count":0,"watchers_count":0,"language":"Dart","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":"907215df2787339c3d92f70caae63e5dfe8fd7ad","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-04-07T15:55:42Z","pushed_at":"2016-04-07T17:08:15Z","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":"http://flutter.io","size":108975,"stargazers_count":2740,"watchers_count":2740,"language":"Dart","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":274,"mirror_url":null,"open_issues_count":771,"forks":274,"open_issues":771,"watchers":2740,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/flutter/flutter/pulls/3174"},"html":{"href":"https://github.com/flutter/flutter/pull/3174"},"issue":{"href":"https://api.github.com/repos/flutter/flutter/issues/3174"},"comments":{"href":"https://api.github.com/repos/flutter/flutter/issues/3174/comments"},"review_comments":{"href":"https://api.github.com/repos/flutter/flutter/pulls/3174/comments"},"review_comment":{"href":"https://api.github.com/repos/flutter/flutter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/flutter/flutter/pulls/3174/commits"},"statuses":{"href":"https://api.github.com/repos/flutter/flutter/statuses/d01f4a75253f8616331dea7f03d03fce2d8f03e7"}}}}