{"action":"created","comment":{"url":"https://api.github.com/repos/flutter/flutter/pulls/comments/67802253","id":67802253,"diff_hunk":"@@ -0,0 +1,98 @@\n+// Copyright 2015 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/services.dart';\n+import 'package:flutter/widgets.dart';\n+\n+import 'icons.dart';\n+import 'icon_button.dart';\n+import 'icon_theme.dart';\n+import 'icon_theme_data.dart';\n+\n+/// An icon that comes from an [ImageProvider], e.g. an [AssetImage].\n+///\n+/// See also:\n+///\n+///  * [IconButton], for interactive icons.\n+///  * [IconTheme], which provides ambient configuration for icons.\n+///  * [Icon] and [Icons], for icons from the material design library.\n+class ImageIcon extends StatelessWidget {\n+  /// Creates an image icon.\n+  ///\n+  /// The [size] and [color] default to the value given by the current [IconTheme].\n+  const ImageIcon(this.image, {\n+    Key key,\n+    this.size,\n+    this.color\n+  }) : super(key: key);\n+\n+  /// The image to display as the icon.\n+  ///\n+  /// The icon can be null, in which case the widget will render as an empty\n+  /// space of the specified [size].\n+  final ImageProvider image;\n+\n+  /// The size of the icon in logical pixels.\n+  ///\n+  /// Icons occupy a square with width and height equal to size.\n+  ///\n+  /// Defaults to the current [IconTheme] size, if any. If there is no\n+  /// [IconTheme], or it does not specify an explicit size, then it defaults to\n+  /// 24.0.\n+  final double size;\n+\n+  /// The color to use when drawing the icon.\n+  ///\n+  /// Defaults to the current [IconTheme] color, if any. If there is\n+  /// no [IconTheme], then it defaults to not recolorizing the image.\n+  ///\n+  /// The image will additionally be adjusted by the opacity of the current\n+  /// [IconTheme], if any.\n+  final Color color;\n+\n+  @override\n+  Widget build(BuildContext context) {\n+    final IconThemeData iconTheme = const IconThemeData.fallback().merge(IconTheme.of(context));\n+\n+    final double iconSize = size ?? iconTheme.size;\n+\n+    if (image == null)\n+      return new SizedBox(width: iconSize, height: iconSize);\n+\n+    final double iconOpacity = iconTheme.opacity;\n+    final Color iconColor = color ?? iconTheme.color;\n+\n+    Widget result = new Image(\n+      image: image,\n+      width: iconSize,\n+      height: iconSize,\n+      color: iconColor,\n+      fit: ImageFit.scaleDown,","path":"packages/flutter/lib/src/material/image_icon.dart","position":71,"original_position":71,"commit_id":"6c3803f939924186cfa292b6ff3c2c62b85d8573","original_commit_id":"527a798bd3745021467a0d599625c13b4e42f8b6","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":"Icon sizes the picture so it always fits (it sets the font size to the size of the icon). I considered `contain`, but that would also stretch it, which seems bad.\r\n\r\nI dunno. I plan to eventually make AssetImage just pick a bitmap of the right size, the same way it picks one of the right scale. We now plumb the data all the way from the IconThemeData to the resolver, it just doesn't use it yet.","created_at":"2016-06-21T03:13:12Z","updated_at":"2016-06-21T03:13:12Z","html_url":"https://github.com/flutter/flutter/pull/4649#discussion_r67802253","pull_request_url":"https://api.github.com/repos/flutter/flutter/pulls/4649","_links":{"self":{"href":"https://api.github.com/repos/flutter/flutter/pulls/comments/67802253"},"html":{"href":"https://github.com/flutter/flutter/pull/4649#discussion_r67802253"},"pull_request":{"href":"https://api.github.com/repos/flutter/flutter/pulls/4649"}}},"pull_request":{"url":"https://api.github.com/repos/flutter/flutter/pulls/4649","id":74541731,"html_url":"https://github.com/flutter/flutter/pull/4649","diff_url":"https://github.com/flutter/flutter/pull/4649.diff","patch_url":"https://github.com/flutter/flutter/pull/4649.patch","issue_url":"https://api.github.com/repos/flutter/flutter/issues/4649","number":4649,"state":"open","locked":false,"title":"ImageIcon","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":"Anywhere that accepted IconData now accepts either an Icon or an\r\nImageIcon.\r\n\r\nPlaces that used to take an IconData in an `icon` argument, notably\r\nIconButton and DrawerItem, now take a Widget in that slot. You can wrap\r\nthe value that used to be passed in in an Icon constructor to get the\r\nsame result.\r\n\r\nIcon itself now takes the icon as a positional argument, for brevity.\r\n\r\nThemeData now has an iconTheme as well as a primaryIconTheme, the same\r\nway it has had a textTheme and primaryTextTheme for a while.\r\n\r\nIconTheme.of() always returns a value now (though that value itself may\r\nhave nulls in it). It defaults to the ThemeData.iconTheme.\r\n\r\nIconThemeData.fallback() is a new const constructor that returns an icon\r\ntheme data structure with all fields filled in.\r\n\r\nIconTheme.merge() is a new constructor that takes a context and creates\r\na widget that mixes in the new values with the inherited values.\r\n\r\nMost places that introduced an IconTheme widget now use IconTheme.merge.\r\n\r\nIconThemeData.merge and IconThemeData.copyWith act in a way analogous to\r\nthe similarly-named members of TextStyle.\r\n\r\nImageIcon is introduced. It acts like Icon but takes an ImageProvider\r\ninstead of an IconData.\r\n\r\nAlso: Fix the analyzer to actually check the stocks app.","created_at":"2016-06-21T02:11:13Z","updated_at":"2016-06-21T03:13:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9e92164d7b54b61a3cda72097ab0891e9829cc2d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/flutter/flutter/pulls/4649/commits","review_comments_url":"https://api.github.com/repos/flutter/flutter/pulls/4649/comments","review_comment_url":"https://api.github.com/repos/flutter/flutter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/flutter/flutter/issues/4649/comments","statuses_url":"https://api.github.com/repos/flutter/flutter/statuses/6c3803f939924186cfa292b6ff3c2c62b85d8573","head":{"label":"Hixie:icon_images","ref":"icon_images","sha":"6c3803f939924186cfa292b6ff3c2c62b85d8573","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-06-21T03:09:28Z","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":19272,"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":"e071f0bafdabe46b5c68de9e91cc8879ad3b8031","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-06-20T22:06:45Z","pushed_at":"2016-06-21T03:09:28Z","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":113348,"stargazers_count":2843,"watchers_count":2843,"language":"Dart","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":299,"mirror_url":null,"open_issues_count":1053,"forks":299,"open_issues":1053,"watchers":2843,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/flutter/flutter/pulls/4649"},"html":{"href":"https://github.com/flutter/flutter/pull/4649"},"issue":{"href":"https://api.github.com/repos/flutter/flutter/issues/4649"},"comments":{"href":"https://api.github.com/repos/flutter/flutter/issues/4649/comments"},"review_comments":{"href":"https://api.github.com/repos/flutter/flutter/pulls/4649/comments"},"review_comment":{"href":"https://api.github.com/repos/flutter/flutter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/flutter/flutter/pulls/4649/commits"},"statuses":{"href":"https://api.github.com/repos/flutter/flutter/statuses/6c3803f939924186cfa292b6ff3c2c62b85d8573"}}}}
{"actor":{"display_login":"Hixie"}}