feat: 顶栏收起

This commit is contained in:
guozhigq
2023-08-06 21:05:51 +08:00
parent 930282b7bd
commit acfe556c26
10 changed files with 303 additions and 110 deletions

View File

@ -60,26 +60,29 @@ class _SearchPageState extends State<SearchPage> with RouteAware {
),
const SizedBox(width: 10)
],
title: Obx(
() => TextField(
autofocus: true,
focusNode: _searchController.searchFocusNode,
controller: _searchController.controller.value,
textInputAction: TextInputAction.search,
onChanged: (value) => _searchController.onChange(value),
decoration: InputDecoration(
hintText: '搜索',
border: InputBorder.none,
suffixIcon: IconButton(
icon: Icon(
Icons.clear,
size: 22,
color: Theme.of(context).colorScheme.outline,
title: Hero(
tag: 'searchWrap',
child: Obx(
() => TextField(
autofocus: true,
focusNode: _searchController.searchFocusNode,
controller: _searchController.controller.value,
textInputAction: TextInputAction.search,
onChanged: (value) => _searchController.onChange(value),
decoration: InputDecoration(
hintText: _searchController.hintText,
border: InputBorder.none,
suffixIcon: IconButton(
icon: Icon(
Icons.clear,
size: 22,
color: Theme.of(context).colorScheme.outline,
),
onPressed: () => _searchController.onClear(),
),
onPressed: () => _searchController.onClear(),
),
onSubmitted: (String value) => _searchController.submit(),
),
onSubmitted: (String value) => _searchController.submit(),
),
),
),