Merge branch 'design'

This commit is contained in:
guozhigq
2024-12-14 20:24:55 +08:00

View File

@ -50,8 +50,32 @@ class _SearchPageState extends State<SearchPage> with RouteAware {
),
),
actions: [
Obx(() {
RxString searchKeyWord = _searchController.searchKeyWord;
return searchKeyWord.value.isNotEmpty
? Row(
mainAxisSize: MainAxisSize.min,
children: [
if (RegExp(r'^\d+$').hasMatch(searchKeyWord.value))
IconButton(
tooltip: '直达up主页',
icon: const Icon(Icons.person_outline, size: 22),
onPressed: () {
_searchController.cacheHistory();
Get.toNamed('/member?mid=${searchKeyWord.value}',
arguments: {'face': null});
},
),
IconButton(
icon: const Icon(Icons.clear, size: 22),
onPressed: _searchController.onClear,
),
],
)
: const SizedBox();
}),
IconButton(
onPressed: () => _searchController.submit(),
onPressed: _searchController.submit,
icon: const Icon(Icons.search),
),
const SizedBox(width: 10)
@ -66,31 +90,6 @@ class _SearchPageState extends State<SearchPage> with RouteAware {
decoration: InputDecoration(
hintText: _searchController.hintText,
border: InputBorder.none,
suffix: Obx(() {
RxString searchKeyWord = _searchController.searchKeyWord;
if (searchKeyWord.value.isEmpty) {
return const SizedBox();
}
return Row(
mainAxisSize: MainAxisSize.min,
children: [
if (RegExp(r'^\d+$').hasMatch(searchKeyWord.value))
IconButton(
tooltip: '直达up主页',
icon: const Icon(Icons.person_outline, size: 22),
onPressed: () {
_searchController.cacheHistory();
Get.toNamed('/member?mid=${searchKeyWord.value}',
arguments: {'face': null});
},
),
IconButton(
icon: const Icon(Icons.clear, size: 22),
onPressed: () => _searchController.onClear(),
),
],
);
}),
),
onSubmitted: (String value) => _searchController.submit(),
),