Commit b672a3d4 authored by Adam Barth's avatar Adam Barth

Stocks input field for company name doesn't work

We weren't listening to the onChange handler.

Fixes #1850
parent a724d6cc
...@@ -262,18 +262,8 @@ class StockHomeState extends State<StockHome> { ...@@ -262,18 +262,8 @@ class StockHomeState extends State<StockHome> {
void _handleCreateCompany() { void _handleCreateCompany() {
showModalBottomSheet( showModalBottomSheet(
// TODO(ianh): Fill this out.
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) => new _CreateCompanySheet()
return new Column(
children: <Widget>[
new Input(
autofocus: true,
hintText: 'Company Name'
),
]
);
}
); );
} }
...@@ -303,3 +293,31 @@ class StockHomeState extends State<StockHome> { ...@@ -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