{"action":"closed","issue":{"url":"https://api.github.com/repos/flutter/flutter/issues/24824","repository_url":"https://api.github.com/repos/flutter/flutter","labels_url":"https://api.github.com/repos/flutter/flutter/issues/24824/labels{/name}","comments_url":"https://api.github.com/repos/flutter/flutter/issues/24824/comments","events_url":"https://api.github.com/repos/flutter/flutter/issues/24824/events","html_url":"https://github.com/flutter/flutter/issues/24824","id":385427481,"node_id":"MDU6SXNzdWUzODU0Mjc0ODE=","number":24824,"title":"BottomNavigationBarItem should cache icon widgets","user":{"login":"lifenautjoe","id":12737509,"node_id":"MDQ6VXNlcjEyNzM3NTA5","avatar_url":"https://avatars1.githubusercontent.com/u/12737509?v=4","gravatar_id":"","url":"https://api.github.com/users/lifenautjoe","html_url":"https://github.com/lifenautjoe","followers_url":"https://api.github.com/users/lifenautjoe/followers","following_url":"https://api.github.com/users/lifenautjoe/following{/other_user}","gists_url":"https://api.github.com/users/lifenautjoe/gists{/gist_id}","starred_url":"https://api.github.com/users/lifenautjoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lifenautjoe/subscriptions","organizations_url":"https://api.github.com/users/lifenautjoe/orgs","repos_url":"https://api.github.com/users/lifenautjoe/repos","events_url":"https://api.github.com/users/lifenautjoe/events{/privacy}","received_events_url":"https://api.github.com/users/lifenautjoe/received_events","type":"User","site_admin":false},"labels":[{"id":284437560,"node_id":"MDU6TGFiZWwyODQ0Mzc1NjA=","url":"https://api.github.com/repos/flutter/flutter/labels/framework","name":"framework","color":"207de5","default":false},{"id":298590876,"node_id":"MDU6TGFiZWwyOTg1OTA4NzY=","url":"https://api.github.com/repos/flutter/flutter/labels/severe:%20performance","name":"severe: performance","color":"e11d21","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/flutter/flutter/milestones/22","html_url":"https://github.com/flutter/flutter/milestone/22","labels_url":"https://api.github.com/repos/flutter/flutter/milestones/22/labels","id":2270094,"node_id":"MDk6TWlsZXN0b25lMjI3MDA5NA==","number":22,"title":"Goals","description":"P2: These are tasks we think are worth fixing in the coming years. It includes issues we've identified that might block fully shipping broad consumer-facing apps, correctness issues, and bugs relating to polish and quality.\r\n\r\nThe date on this milestone is utterly arbitrary and just intended to sort the milestone appropriately.","creator":{"login":"Hixie","id":551196,"node_id":"MDQ6VXNlcjU1MTE5Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/551196?v=4","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},"open_issues":1615,"closed_issues":715,"state":"open","created_at":"2017-01-23T00:27:59Z","updated_at":"2018-11-29T16:49:00Z","due_on":"2031-01-01T08:00:00Z","closed_at":null},"comments":3,"created_at":"2018-11-28T19:43:04Z","updated_at":"2018-11-29T16:49:00Z","closed_at":"2018-11-29T16:49:00Z","author_association":"NONE","body":"<!-- Thank you for using Flutter!\r\n\r\n     If you are looking for support, please check out our documentation\r\n     or consider asking a question on Stack Overflow:\r\n      * https://flutter.io/\r\n      * https://docs.flutter.io/\r\n      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent\r\n\r\n     If you have found a bug or if our documentation doesn't have an answer\r\n     to what you're looking for, then fill our the template below. Please read\r\n     our guide to filing a bug first:  https://flutter.io/bug-reports/\r\n-->\r\n\r\n## Steps to Reproduce\r\n\r\n### Desired outcome\r\n\r\nSelected BottomNavigationBarItem should have a border when active.\r\n\r\n![example-flutter](https://user-images.githubusercontent.com/12737509/49177178-d74cd180-f34c-11e8-9884-ad6b4d6dd884.png)\r\n\r\n### Implementation\r\n\r\nGiven \r\n\r\n```dart\r\n  Widget _createTabBar() {\r\n    return OBCupertinoTabBar(\r\n      // ...\r\n      items: [\r\n        // ..\r\n        BottomNavigationBarItem(\r\n            title: Container(),\r\n            icon: OBLoggedInUserAvatar(\r\n              size: OBUserAvatarSize.small,\r\n            ),\r\n            activeIcon: Container(\r\n              decoration: BoxDecoration(\r\n                  borderRadius: BorderRadius.circular(500),\r\n                  border: Border.all(color: Colors.red)),\r\n              padding: EdgeInsets.all(2.0),\r\n              child: OBLoggedInUserAvatar(\r\n                size: OBUserAvatarSize.small,\r\n              ),\r\n            )),\r\n        // ..\r\n      ],\r\n    );\r\n  }\r\n```\r\n\r\nWhere the `OBLoggedInUserAvatar` is a widget which fetches the user avatar either from file system cache or the internet.\r\n\r\n## Outcome\r\n\r\n![outcome](https://user-images.githubusercontent.com/12737509/49177321-3ca0c280-f34d-11e8-8ac3-7c9c476a0473.gif)\r\n\r\nAs you can tell, the `activeIcon` is being rebuilt every-time pressed or changed. This results in a \"flash\" of the placeholder image for the component.\r\n\r\n## Proposed fix\r\n\r\nWhy are the navigation items rebuilt on every tab switch? Perhaps these should be cached? Or if not, the icons employed by them to avoid flashes of rebuilt items?\r\n\r\n## Full disclosure\r\n\r\nPerhaps there's a better approach to doing this, feedback is very much welcome.\r\n\r\n## Doctor logs\r\n\r\n<!-- Finally, paste the output of running `flutter doctor -v` here. -->\r\n\r\n```\r\n✓] Flutter (Channel dev, v0.11.9, on Mac OS X 10.14 18A391,\r\n    locale en-NL)\r\n    • Flutter version 0.11.9 at\r\n      /Users/joelhernandez/Documents/code/flutter\r\n    • Framework revision d48e6e433c (8 days ago), 2018-11-20\r\n      22:05:23 -0500\r\n    • Engine revision 5c8147450d\r\n    • Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)\r\n\r\n[✓] Android toolchain - develop for Android devices (Android SDK\r\n    28.0.2)\r\n    • Android SDK at /Users/joelhernandez/Library/Android/sdk\r\n    • Android NDK location not configured (optional; useful for\r\n      native profiling support)\r\n    • Platform android-28, build-tools 28.0.2\r\n    • Java binary at: /Applications/Android\r\n      Studio.app/Contents/jre/jdk/Contents/Home/bin/java\r\n    • Java version OpenJDK Runtime Environment (build\r\n      1.8.0_152-release-1024-b01)\r\n    • All Android licenses accepted.\r\n\r\n[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)\r\n    • Xcode at /Applications/Xcode.app/Contents/Developer\r\n    • Xcode 10.1, Build version 10B61\r\n    • ios-deploy 1.9.4\r\n    • CocoaPods version 1.5.3\r\n\r\n[✓] Android Studio (version 3.1)\r\n    • Android Studio at /Applications/Android Studio.app/Contents\r\n    • Flutter plugin version 27.1.1\r\n    • Dart plugin version 173.4700\r\n    • Java version OpenJDK Runtime Environment (build\r\n      1.8.0_152-release-1024-b01)\r\n\r\n[✓] IntelliJ IDEA Ultimate Edition (version 2018.2.4)\r\n    • IntelliJ at /Applications/IntelliJ IDEA.app\r\n    • Flutter plugin version 29.1.3\r\n    • Dart plugin version 182.4999\r\n\r\n[!] VS Code (version 1.25.1)\r\n    • VS Code at /Applications/Visual Studio Code.app/Contents\r\n    • Flutter extension not installed; install from\r\n      https://marketplace.visualstudio.com/items?itemName=Dart-Cod\r\n      e.flutter\r\n\r\n[✓] Connected device (1 available)\r\n    • iPhone X • 8968109C-4432-45F0-A010-94DAC8575087 • ios • iOS\r\n      12.1 (simulator)\r\n\r\n! Doctor found issues in 1 category.\r\n```\r\n\r\nThanks!"}}
{"actor":{"display_login":"jonahwilliams"}}