diff --git a/examples/stocks/lib/stock_home.dart b/examples/stocks/lib/stock_home.dart index 3692bffed3..e90edb3486 100644 --- a/examples/stocks/lib/stock_home.dart +++ b/examples/stocks/lib/stock_home.dart @@ -262,18 +262,8 @@ class StockHomeState extends State { void _handleCreateCompany() { showModalBottomSheet( - // TODO(ianh): Fill this out. context: context, - builder: (BuildContext context) { - return new Column( - children: [ - new Input( - autofocus: true, - hintText: 'Company Name' - ), - ] - ); - } + builder: (BuildContext context) => new _CreateCompanySheet() ); } @@ -303,3 +293,31 @@ class StockHomeState extends State { ); } } + +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: [ + new Input( + autofocus: true, + hintText: 'Company Name', + value: _companyName, + onChanged: _handleCompanyNameChanged + ), + ] + ); + } +}