From cb87c32de7482bac8d718102e5ecf5adc8a44eed Mon Sep 17 00:00:00 2001 From: Rongjian Zhang Date: Thu, 3 Oct 2019 10:46:53 +0800 Subject: [PATCH] feat: text field placeholder --- lib/screens/search.dart | 48 ++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/lib/screens/search.dart b/lib/screens/search.dart index 88aed08..32e45a7 100644 --- a/lib/screens/search.dart +++ b/lib/screens/search.dart @@ -112,6 +112,7 @@ class _SearchScreenState extends State { ); default: return TextField( + decoration: InputDecoration.collapsed(hintText: 'Search'), textInputAction: TextInputAction.go, onSubmitted: (_) => _query(), controller: _controller, @@ -153,31 +154,30 @@ class _SearchScreenState extends State { final scaffold = CommonScaffold( title: _buildInput(), body: SingleChildScrollView( - child: _loading - ? Loading() - : Column( - children: [ - if (theme == AppThemeType.cupertino) - Center( - child: Padding( - padding: EdgeInsets.symmetric(vertical: 8), - child: CupertinoSegmentedControl( - groupValue: _activeTab, - onValueChanged: _onTabSwitch, - children: tabs.asMap().map((key, text) => MapEntry( - key, - Padding( - padding: - const EdgeInsets.symmetric(horizontal: 8), - child: - Text(text, style: TextStyle(fontSize: 14)), - ))), - ), - ), - ), - ..._payloads[_activeTab].map(_buildItem).toList(), - ], + child: Column( + children: [ + if (theme == AppThemeType.cupertino) + Center( + child: Padding( + padding: EdgeInsets.symmetric(vertical: 8), + child: CupertinoSegmentedControl( + groupValue: _activeTab, + onValueChanged: _onTabSwitch, + children: tabs.asMap().map((key, text) => MapEntry( + key, + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: Text(text, style: TextStyle(fontSize: 14)), + ))), + ), + ), ), + if (_loading) + Loading() + else + ..._payloads[_activeTab].map(_buildItem).toList(), + ], + ), ), bottom: TabBar( onTap: _onTabSwitch,