1
0
mirror of https://github.com/git-touch/git-touch synced 2025-02-21 14:01:02 +01:00

feat: text field placeholder

This commit is contained in:
Rongjian Zhang 2019-10-03 10:46:53 +08:00
parent 755aba7727
commit cb87c32de7

View File

@ -112,6 +112,7 @@ class _SearchScreenState extends State<SearchScreen> {
); );
default: default:
return TextField( return TextField(
decoration: InputDecoration.collapsed(hintText: 'Search'),
textInputAction: TextInputAction.go, textInputAction: TextInputAction.go,
onSubmitted: (_) => _query(), onSubmitted: (_) => _query(),
controller: _controller, controller: _controller,
@ -153,31 +154,30 @@ class _SearchScreenState extends State<SearchScreen> {
final scaffold = CommonScaffold( final scaffold = CommonScaffold(
title: _buildInput(), title: _buildInput(),
body: SingleChildScrollView( body: SingleChildScrollView(
child: _loading child: Column(
? Loading() children: [
: Column( if (theme == AppThemeType.cupertino)
children: [ Center(
if (theme == AppThemeType.cupertino) child: Padding(
Center( padding: EdgeInsets.symmetric(vertical: 8),
child: Padding( child: CupertinoSegmentedControl(
padding: EdgeInsets.symmetric(vertical: 8), groupValue: _activeTab,
child: CupertinoSegmentedControl( onValueChanged: _onTabSwitch,
groupValue: _activeTab, children: tabs.asMap().map((key, text) => MapEntry(
onValueChanged: _onTabSwitch, key,
children: tabs.asMap().map((key, text) => MapEntry( Padding(
key, padding: const EdgeInsets.symmetric(horizontal: 8),
Padding( child: Text(text, style: TextStyle(fontSize: 14)),
padding: ))),
const EdgeInsets.symmetric(horizontal: 8), ),
child: ),
Text(text, style: TextStyle(fontSize: 14)),
))),
),
),
),
..._payloads[_activeTab].map(_buildItem).toList(),
],
), ),
if (_loading)
Loading()
else
..._payloads[_activeTab].map(_buildItem).toList(),
],
),
), ),
bottom: TabBar( bottom: TabBar(
onTap: _onTabSwitch, onTap: _onTabSwitch,