{"action":"created","comment":{"url":"https://api.github.com/repos/flutter/flutter/pulls/comments/59810941","id":59810941,"diff_hunk":"@@ -0,0 +1,757 @@\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 'dart:math' as math;\n+\n+import 'package:flutter/rendering.dart';\n+import 'package:flutter/widgets.dart';\n+\n+import 'checkbox.dart';\n+import 'colors.dart';\n+import 'debug.dart';\n+import 'drop_down.dart';\n+import 'icon.dart';\n+import 'icon_theme.dart';\n+import 'icon_theme_data.dart';\n+import 'icons.dart';\n+import 'ink_well.dart';\n+import 'material.dart';\n+import 'theme.dart';\n+import 'theme_data.dart';\n+import 'tooltip.dart';\n+\n+typedef void DataColumnSortCallback(bool ascending);\n+\n+typedef void DataCellEditCallback(Rect cell);\n+\n+/// Column configuration for a [DataTable].\n+///\n+/// One column configuration must be provided for each column to\n+/// display in the table. The list of [DataColumn] objects is passed\n+/// as the `columns` argument to the [new DataTable] constructor.\n+class DataColumn {\n+  /// Creates the configuration for a column of a [DataTable].\n+  ///\n+  /// The [label] argument must not be null.\n+  const DataColumn({\n+    this.label,\n+    this.tooltip,\n+    this.numeric: false,\n+    this.onSort\n+  });\n+\n+  /// The column heading.\n+  ///\n+  /// Typically, this will be either a [Text] widget, or a [Tooltip]\n+  /// widget whose child is a [Text] widget. It could also include an\n+  /// [Icon] (typically using size 18).\n+  ///\n+  /// The label should not include the sort indicator.\n+  final Widget label;\n+\n+  /// The column heading's tooltip.\n+  ///\n+  /// This is a longer description of the column heading, for cases\n+  /// where the heading might have been abbreviated to keep the column\n+  /// width to a reasonable size.\n+  final String tooltip;\n+\n+  /// Whether this column represents numeric data or not.\n+  ///\n+  /// Numeric data is presented by right-aligning the column.\n+  final bool numeric;\n+\n+  /// Invoked when the user asks to sort the table using this column.\n+  ///\n+  /// If null, the column will not be considered sortable.\n+  ///\n+  /// See [DataTable.sortColumn] and [DataTable.sortAscending].\n+  final DataColumnSortCallback onSort;\n+\n+  bool get _debugInteractive => onSort != null;\n+}\n+\n+/// Row configuration and cell data for a [DataTable].\n+///\n+/// One row configuration must be provided for each row to\n+/// display in the table. The list of [DataRow] objects is passed\n+/// as the `rows` argument to the [new DataTable] constructor.\n+///\n+/// The data for this row of the table is provided in the [cells]\n+/// property of the [DataRow] object.\n+class DataRow {\n+  /// Creates the configuration for a row of a [DataTable].\n+  ///\n+  /// The [cells] argument must not be null.\n+  const DataRow({\n+    this.key,\n+    this.selected: false,\n+    this.onSelectChanged,\n+    this.cells\n+  });\n+\n+  /// A [Key] that uniquely identifies this row. This is used to\n+  /// ensure that if a row is added or removed, any stateful widgets\n+  /// related to this row (e.g. an in-progress checkbox animation)\n+  /// remain on the right row visually.\n+  ///\n+  /// If the table never changes once created, no key is necessary.\n+  final LocalKey key;\n+\n+  /// Invoked when the user selects or unselects a selectable row.\n+  ///\n+  /// If this is not null, then the row is selectable. The current\n+  /// selection state of the row is given by [selected].\n+  ///\n+  /// If any row is selectable, then the table's heading row will have\n+  /// a checkbox that can be checked to select all selectable rows\n+  /// (and which is checked if all the rows are selected), and each\n+  /// subsequent row will have a checkbox to toggle just that row.\n+  ///\n+  /// Rows whose [onSelectChanged] callback is null are ignored for\n+  /// the purposes of determining the state of the \"all\" checkbox;\n+  /// their checkbox is disabled.\n+  final ValueChanged<bool> onSelectChanged;\n+\n+  /// Whether the row is selected.\n+  ///\n+  /// If [onSelectChanged] is non-null for any row in the table, then\n+  /// a checkbox is shown at the start of each row. If the row is\n+  /// selected (true), the checkbox will be checked and the row will\n+  /// be highlighted.\n+  ///\n+  /// Otherwise, the checkbox, if present, will not be checked.\n+  final bool selected;\n+\n+  /// The data for this row.\n+  ///\n+  /// There must be exactly as many cells as there are columns in the\n+  /// table.\n+  final List<DataCell> cells;\n+\n+  bool get _debugInteractive => onSelectChanged != null || cells.any((DataCell cell) => cell._debugInteractive);\n+}\n+\n+/// The data for a cell of a [DataTable].\n+///\n+/// One list of [DataCell] objects must be provided for each [DataRow]\n+/// in the [DataTable], in the [new DataRow] constructor's `cells`\n+/// argument.\n+class DataCell {\n+  /// Creates an object to hold the data for a cell in a [DataTable].\n+  ///\n+  /// The first argument is the widget to show for the cell, typically\n+  /// a [Text] or [DropDownButton] widget; this becomes the [widget]\n+  /// property and must not be null.\n+  ///\n+  /// If the cell has no data, then a [Text] widget with placeholder\n+  /// text should be provided instead, and then the [placeholder]\n+  /// argument should be set to true.\n+  const DataCell(this.widget, {\n+    this.placeholder: false,\n+    this.showEditIcon: false,\n+    this.onTap\n+  });\n+\n+  /// The data for the row.\n+  ///\n+  /// Typically a [Text] widget or a [DropDownButton] widget.\n+  ///\n+  /// If the cell has no data, then a [Text] widget with placeholder\n+  /// text should be provided instead, and [placeholder] should be set\n+  /// to true.\n+  final Widget widget;\n+\n+  /// Whether the [widget] is actually a placeholder.\n+  ///\n+  /// If this is true, the default text style for the cell is changed\n+  /// to be appropriate for placeholder text.\n+  final bool placeholder;\n+\n+  /// Whether to show an edit icon at the end of the cell.\n+  ///\n+  /// This does not make the cell actually editable; the caller must\n+  /// implement editing behavior if desired (by hooking [onTap]).","path":"packages/flutter/lib/src/material/data_table.dart","position":175,"original_position":175,"commit_id":"1ae2fb6901055094e2a14dc7d63096307a7688d9","original_commit_id":"1ae2fb6901055094e2a14dc7d63096307a7688d9","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":"Do we use the term \"hooking\"? Maybe \"specifying\".","created_at":"2016-04-14T23:58:39Z","updated_at":"2016-04-14T23:58:39Z","html_url":"https://github.com/flutter/flutter/pull/3337#discussion_r59810941","pull_request_url":"https://api.github.com/repos/flutter/flutter/pulls/3337","_links":{"self":{"href":"https://api.github.com/repos/flutter/flutter/pulls/comments/59810941"},"html":{"href":"https://github.com/flutter/flutter/pull/3337#discussion_r59810941"},"pull_request":{"href":"https://api.github.com/repos/flutter/flutter/pulls/3337"}}},"pull_request":{"url":"https://api.github.com/repos/flutter/flutter/pulls/3337","id":66548669,"html_url":"https://github.com/flutter/flutter/pull/3337","diff_url":"https://github.com/flutter/flutter/pull/3337.diff","patch_url":"https://github.com/flutter/flutter/pull/3337.patch","issue_url":"https://api.github.com/repos/flutter/flutter/issues/3337","number":3337,"state":"open","locked":false,"title":"Material Data Tables","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":"+ Add new demo to gallery to show data tables. (This currently doesn't\r\nuse a Card; I'll create a Card version in a subsequent patch.)\r\n\r\n+ Fix checkbox alignment. It now centers in its box regardless.\r\n\r\n+ Add Colors.black54.\r\n\r\n+ Some minor fixes to dartdocs.\r\n\r\n+ DataTable, DataColumn, DataRow, DataCell\r\n\r\n+ RowInkWell\r\n\r\n+ Augment dartdocs of materia/debug.dart.\r\n\r\n+ DropDownButtonHideUnderline to hide the underline in a drop-down when\r\n  used in a DataTable.\r\n\r\n+ Add new capabilities to InkResponse to support RowInkWell.\r\n\r\n+ Augment dartdocs of materia/material.dart.\r\n\r\n+ Add an assert to catch nested Blocks.\r\n\r\n+ Fix a crash in RenderBox when you remove an object and an ancestor\r\n  used its baseline. (https://github.com/flutter/flutter/issues/2874)\r\n\r\n+ Fix (and redocument) RenderBaseline/Baseline.\r\n\r\n+ Add flex support to IntrinsicColumnWidth.\r\n\r\n+ Document more stuff on the RenderTable side.\r\n\r\n+ Fix a bug with parentData handling on RenderTable children.\r\n\r\n+ Completely rewrite the column width computations. The old logic made\r\n  no sense at all.\r\n\r\n+ Add dartdocs to widgets/debug.dart.\r\n\r\n+ Add a toString for TableRow.","created_at":"2016-04-14T20:30:19Z","updated_at":"2016-04-14T23:58:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5576fdecacc647557e7d2ebe52515a0da49ad998","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/flutter/flutter/pulls/3337/commits","review_comments_url":"https://api.github.com/repos/flutter/flutter/pulls/3337/comments","review_comment_url":"https://api.github.com/repos/flutter/flutter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/flutter/flutter/issues/3337/comments","statuses_url":"https://api.github.com/repos/flutter/flutter/statuses/1ae2fb6901055094e2a14dc7d63096307a7688d9","head":{"label":"Hixie:datatable","ref":"datatable","sha":"1ae2fb6901055094e2a14dc7d63096307a7688d9","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},"repo":{"id":45635647,"name":"flutter","full_name":"Hixie/flutter","owner":{"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},"private":false,"html_url":"https://github.com/Hixie/flutter","description":"The Flutter framework","fork":true,"url":"https://api.github.com/repos/Hixie/flutter","forks_url":"https://api.github.com/repos/Hixie/flutter/forks","keys_url":"https://api.github.com/repos/Hixie/flutter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Hixie/flutter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Hixie/flutter/teams","hooks_url":"https://api.github.com/repos/Hixie/flutter/hooks","issue_events_url":"https://api.github.com/repos/Hixie/flutter/issues/events{/number}","events_url":"https://api.github.com/repos/Hixie/flutter/events","assignees_url":"https://api.github.com/repos/Hixie/flutter/assignees{/user}","branches_url":"https://api.github.com/repos/Hixie/flutter/branches{/branch}","tags_url":"https://api.github.com/repos/Hixie/flutter/tags","blobs_url":"https://api.github.com/repos/Hixie/flutter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Hixie/flutter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Hixie/flutter/git/refs{/sha}","trees_url":"https://api.github.com/repos/Hixie/flutter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Hixie/flutter/statuses/{sha}","languages_url":"https://api.github.com/repos/Hixie/flutter/languages","stargazers_url":"https://api.github.com/repos/Hixie/flutter/stargazers","contributors_url":"https://api.github.com/repos/Hixie/flutter/contributors","subscribers_url":"https://api.github.com/repos/Hixie/flutter/subscribers","subscription_url":"https://api.github.com/repos/Hixie/flutter/subscription","commits_url":"https://api.github.com/repos/Hixie/flutter/commits{/sha}","git_commits_url":"https://api.github.com/repos/Hixie/flutter/git/commits{/sha}","comments_url":"https://api.github.com/repos/Hixie/flutter/comments{/number}","issue_comment_url":"https://api.github.com/repos/Hixie/flutter/issues/comments{/number}","contents_url":"https://api.github.com/repos/Hixie/flutter/contents/{+path}","compare_url":"https://api.github.com/repos/Hixie/flutter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Hixie/flutter/merges","archive_url":"https://api.github.com/repos/Hixie/flutter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Hixie/flutter/downloads","issues_url":"https://api.github.com/repos/Hixie/flutter/issues{/number}","pulls_url":"https://api.github.com/repos/Hixie/flutter/pulls{/number}","milestones_url":"https://api.github.com/repos/Hixie/flutter/milestones{/number}","notifications_url":"https://api.github.com/repos/Hixie/flutter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Hixie/flutter/labels{/name}","releases_url":"https://api.github.com/repos/Hixie/flutter/releases{/id}","deployments_url":"https://api.github.com/repos/Hixie/flutter/deployments","created_at":"2015-11-05T19:54:58Z","updated_at":"2016-02-09T22:48:09Z","pushed_at":"2016-04-14T23:51:10Z","git_url":"git://github.com/Hixie/flutter.git","ssh_url":"git@github.com:Hixie/flutter.git","clone_url":"https://github.com/Hixie/flutter.git","svn_url":"https://github.com/Hixie/flutter","homepage":"http://flutter.io","size":15862,"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":"d5d4e7c05432414bd154a898583b8894f3332074","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-14T16:12:31Z","pushed_at":"2016-04-14T23:51:11Z","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":109507,"stargazers_count":2746,"watchers_count":2746,"language":"Dart","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":279,"mirror_url":null,"open_issues_count":826,"forks":279,"open_issues":826,"watchers":2746,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/flutter/flutter/pulls/3337"},"html":{"href":"https://github.com/flutter/flutter/pull/3337"},"issue":{"href":"https://api.github.com/repos/flutter/flutter/issues/3337"},"comments":{"href":"https://api.github.com/repos/flutter/flutter/issues/3337/comments"},"review_comments":{"href":"https://api.github.com/repos/flutter/flutter/pulls/3337/comments"},"review_comment":{"href":"https://api.github.com/repos/flutter/flutter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/flutter/flutter/pulls/3337/commits"},"statuses":{"href":"https://api.github.com/repos/flutter/flutter/statuses/1ae2fb6901055094e2a14dc7d63096307a7688d9"}}}}