mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-26 13:25:49 +08:00
mod: lint
mod: tweaks opt: publish page Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -96,7 +96,7 @@ class SSearchController extends GetxController {
|
||||
}
|
||||
|
||||
// 搜索
|
||||
void submit() async {
|
||||
Future<void> submit() async {
|
||||
if (controller.text.isEmpty) {
|
||||
if (hintText.isEmpty) {
|
||||
return;
|
||||
@@ -106,8 +106,9 @@ class SSearchController extends GetxController {
|
||||
}
|
||||
|
||||
if (recordSearchHistory.value) {
|
||||
historyList.remove(controller.text);
|
||||
historyList.insert(0, controller.text);
|
||||
historyList
|
||||
..remove(controller.text)
|
||||
..insert(0, controller.text);
|
||||
GStorage.historyWord.put('cacheList', historyList);
|
||||
}
|
||||
|
||||
@@ -153,12 +154,12 @@ class SSearchController extends GetxController {
|
||||
}
|
||||
}
|
||||
|
||||
onLongSelect(word) {
|
||||
void onLongSelect(word) {
|
||||
historyList.remove(word);
|
||||
GStorage.historyWord.put('cacheList', historyList);
|
||||
}
|
||||
|
||||
onClearHistory() {
|
||||
void onClearHistory() {
|
||||
showConfirmDialog(
|
||||
context: Get.context!,
|
||||
title: '确定清空搜索历史?',
|
||||
|
||||
@@ -7,9 +7,9 @@ import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'controller.dart';
|
||||
import 'widgets/hot_keyword.dart';
|
||||
import 'widgets/search_text.dart';
|
||||
import 'package:PiliPlus/pages/search/controller.dart';
|
||||
import 'package:PiliPlus/pages/search/widgets/hot_keyword.dart';
|
||||
import 'package:PiliPlus/pages/search/widgets/search_text.dart';
|
||||
|
||||
class SearchPage extends StatefulWidget {
|
||||
const SearchPage({super.key});
|
||||
@@ -121,9 +121,7 @@ class _SearchPageState extends State<SearchPage> {
|
||||
children: _searchController.searchSuggestList
|
||||
.map(
|
||||
(item) => InkWell(
|
||||
customBorder: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(4)),
|
||||
onTap: () => _searchController.onClickKeyword(item.term!),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
@@ -197,8 +195,8 @@ class _SearchPageState extends State<SearchPage> {
|
||||
SizedBox(
|
||||
height: 34,
|
||||
child: TextButton.icon(
|
||||
style: ButtonStyle(
|
||||
padding: const WidgetStatePropertyAll(
|
||||
style: const ButtonStyle(
|
||||
padding: WidgetStatePropertyAll(
|
||||
EdgeInsets.symmetric(horizontal: 10, vertical: 6)),
|
||||
),
|
||||
onPressed: isHot
|
||||
@@ -254,7 +252,7 @@ class _SearchPageState extends State<SearchPage> {
|
||||
children: [
|
||||
Text(
|
||||
'搜索历史',
|
||||
strutStyle: StrutStyle(leading: 0, height: 1),
|
||||
strutStyle: const StrutStyle(leading: 0, height: 1),
|
||||
style: theme.textTheme.titleMedium!
|
||||
.copyWith(height: 1, fontWeight: FontWeight.bold),
|
||||
),
|
||||
|
||||
@@ -15,7 +15,7 @@ class HotKeyword extends StatelessWidget {
|
||||
required this.hotSearchList,
|
||||
this.onClick,
|
||||
this.showMore = true,
|
||||
}) : this.width = width / 2 - 4;
|
||||
}) : width = width / 2 - 4;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
@@ -27,7 +27,7 @@ class SearchText extends StatelessWidget {
|
||||
late final theme = Theme.of(context);
|
||||
return Material(
|
||||
color: bgColor ?? theme.colorScheme.onInverseSurface,
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(6)),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
onTap?.call(text);
|
||||
@@ -37,7 +37,7 @@ class SearchText extends StatelessWidget {
|
||||
onLongPress!(text);
|
||||
}
|
||||
: null,
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(6)),
|
||||
child: Padding(
|
||||
padding: padding ??
|
||||
const EdgeInsets.symmetric(horizontal: 11, vertical: 5),
|
||||
|
||||
Reference in New Issue
Block a user