{"action":"created","issue":{"url":"https://api.github.com/repos/flutter/flutter/issues/6422","repository_url":"https://api.github.com/repos/flutter/flutter","labels_url":"https://api.github.com/repos/flutter/flutter/issues/6422/labels{/name}","comments_url":"https://api.github.com/repos/flutter/flutter/issues/6422/comments","events_url":"https://api.github.com/repos/flutter/flutter/issues/6422/events","html_url":"https://github.com/flutter/flutter/issues/6422","id":184282456,"number":6422,"title":"Dropdown null selection & hints","user":{"login":"tvolkert","id":15253456,"avatar_url":"https://avatars.githubusercontent.com/u/15253456?v=3","gravatar_id":"","url":"https://api.github.com/users/tvolkert","html_url":"https://github.com/tvolkert","followers_url":"https://api.github.com/users/tvolkert/followers","following_url":"https://api.github.com/users/tvolkert/following{/other_user}","gists_url":"https://api.github.com/users/tvolkert/gists{/gist_id}","starred_url":"https://api.github.com/users/tvolkert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tvolkert/subscriptions","organizations_url":"https://api.github.com/users/tvolkert/orgs","repos_url":"https://api.github.com/users/tvolkert/repos","events_url":"https://api.github.com/users/tvolkert/events{/privacy}","received_events_url":"https://api.github.com/users/tvolkert/received_events","type":"User","site_admin":false},"labels":[{"id":288585660,"url":"https://api.github.com/repos/flutter/flutter/labels/affects:%20material%20design","name":"affects: material design","color":"207de5","default":false},{"id":330257136,"url":"https://api.github.com/repos/flutter/flutter/labels/customer:%20leafy","name":"customer: leafy","color":"bfe5bf","default":false},{"id":283479235,"url":"https://api.github.com/repos/flutter/flutter/labels/%E2%9A%A0%20brand%20new%20feature","name":"⚠ brand new feature","color":"fbca04","default":false}],"state":"closed","locked":false,"assignee":{"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},"assignees":[{"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}],"milestone":{"url":"https://api.github.com/repos/flutter/flutter/milestones/19","html_url":"https://github.com/flutter/flutter/milestones/1:%20Top%20Customer%20Requests","labels_url":"https://api.github.com/repos/flutter/flutter/milestones/19/labels","id":1999049,"number":19,"title":"1: Top Customer Requests","description":"These are issues that our customers have informed us are high priority items where if we failed to address these issues it would put their products at risk.","creator":{"login":"sethladd","id":5479,"avatar_url":"https://avatars.githubusercontent.com/u/5479?v=3","gravatar_id":"","url":"https://api.github.com/users/sethladd","html_url":"https://github.com/sethladd","followers_url":"https://api.github.com/users/sethladd/followers","following_url":"https://api.github.com/users/sethladd/following{/other_user}","gists_url":"https://api.github.com/users/sethladd/gists{/gist_id}","starred_url":"https://api.github.com/users/sethladd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sethladd/subscriptions","organizations_url":"https://api.github.com/users/sethladd/orgs","repos_url":"https://api.github.com/users/sethladd/repos","events_url":"https://api.github.com/users/sethladd/events{/privacy}","received_events_url":"https://api.github.com/users/sethladd/received_events","type":"User","site_admin":false},"open_issues":11,"closed_issues":40,"state":"open","created_at":"2016-09-12T17:40:30Z","updated_at":"2016-11-22T17:07:21Z","due_on":"2016-11-30T00:00:00Z","closed_at":null},"comments":2,"created_at":"2016-10-20T16:47:11Z","updated_at":"2016-11-22T19:16:20Z","closed_at":"2016-11-22T00:36:19Z","body":"Feature request from Customer Leafy:\r\n\r\n- [ ] Add the ability to show a dropdown which does not have a selection (yet)\r\n- [ ] Add \"hint\" text to display in the dropdown when no value is selected\r\n- [ ] Add ability to show error-text for dropdowns, as we'd need to show that a \"None\" selection would not be valid when submitting a form\r\n"},"comment":{"url":"https://api.github.com/repos/flutter/flutter/issues/comments/262337023","html_url":"https://github.com/flutter/flutter/issues/6422#issuecomment-262337023","issue_url":"https://api.github.com/repos/flutter/flutter/issues/6422","id":262337023,"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},"created_at":"2016-11-22T19:16:20Z","updated_at":"2016-11-22T19:16:20Z","body":"Here's an example that demos the requested features.\r\n\r\n```\r\nimport 'package:flutter/material.dart';\r\n\r\nclass InputContainerDemo extends StatefulWidget {\r\n  @override\r\n  _InputContainerDemoState createState() => new _InputContainerDemoState();\r\n}\r\n\r\nclass _InputContainerDemoState extends State<InputContainerDemo> {\r\n  static final List<String> _dropdownItems = <String>['One', 'Two', 'Free', 'Four'];\r\n  String _dropdownValue = 'One';\r\n  String _errorText;\r\n\r\n  @override\r\n  Widget build(BuildContext context) {\r\n    return new Scaffold(\r\n      appBar: new AppBar(title: new Text('InputContainer Demo')),\r\n      body: new Padding(\r\n        padding: const EdgeInsets.all(32.0),\r\n        child: new DropdownButtonHideUnderline(\r\n          child: new Column(\r\n            crossAxisAlignment: CrossAxisAlignment.stretch,\r\n            children: <Widget>[\r\n              new InputContainer(\r\n                labelText: _dropdownValue == null ? 'Where are you from' : 'From',\r\n                errorText: _errorText,\r\n                isEmpty: _dropdownValue == null,\r\n                child: new DropdownButton<String>(\r\n                  value: _dropdownValue,\r\n                  isDense: true,\r\n                  onChanged: (String newValue) {\r\n                    setState(() {\r\n                      _dropdownValue = newValue;\r\n                    });\r\n                  },\r\n                  items: _dropdownItems.map((String value) {\r\n                    return new DropdownMenuItem<String>(\r\n                      value: value,\r\n                      child: new Text(value),\r\n                    );\r\n                  }).toList(),\r\n                ),\r\n              ),\r\n              new SizedBox(height: 32.0),\r\n              new Row(\r\n                children: <Widget> [\r\n                  new RaisedButton(\r\n                    onPressed: () {\r\n                      setState((){\r\n                        _dropdownValue = null;\r\n                      });\r\n                    },\r\n                    child: new Text('VALUE'),\r\n                  ),\r\n                  new SizedBox(width: 32.0),\r\n                  new RaisedButton(\r\n                    onPressed: () {\r\n                      setState(() {\r\n                        _errorText = _errorText != null ? null : 'error';\r\n                      });\r\n                    },\r\n                    child: new Text('ERROR'),\r\n                  ),\r\n                ],\r\n              ),\r\n            ],\r\n          ),\r\n        ),\r\n      )\r\n    );\r\n  }\r\n}\r\n\r\nvoid main() {\r\n  runApp(new MaterialApp(home: new InputContainerDemo()));\r\n}\r\n```\r\n"}}
{"actor":{"display_login":"HansMuller"}}