Commit ea361866 authored by Adam Barth's avatar Adam Barth

Merge pull request #1880 from abarth/create_company

Stocks input field for company name doesn't work
parents efa47a6f b672a3d4
......@@ -262,18 +262,8 @@ class StockHomeState extends State<StockHome> {
void _handleCreateCompany() {
showModalBottomSheet(
// TODO(ianh): Fill this out.
context: context,
builder: (BuildContext context) {
return new Column(
children: <Widget>[
new Input(
autofocus: true,
hintText: 'Company Name'
),
]
);
}
builder: (BuildContext context) => new _CreateCompanySheet()
);
}
......@@ -303,3 +293,31 @@ class StockHomeState extends State<StockHome> {
);
}
}
class _CreateCompanySheet extends StatefulComponent {
_CreateCompanySheetState createState() => new _CreateCompanySheetState();
}
class _CreateCompanySheetState extends State<_CreateCompanySheet> {
InputValue _companyName = InputValue.empty;
void _handleCompanyNameChanged(InputValue value) {
setState(() {
_companyName = value;
});
}
Widget build(BuildContext context) {
// TODO(ianh): Fill this out.
return new Column(
children: <Widget>[
new Input(
autofocus: true,
hintText: 'Company Name',
value: _companyName,
onChanged: _handleCompanyNameChanged
),
]
);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment