mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
mod: search history
Closes #488 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -32,7 +32,7 @@ Widget content(context, item, source, callback) {
|
||||
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||
padding: const EdgeInsets.fromLTRB(12, 0, 12, 6),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
|
||||
@@ -20,7 +20,7 @@ class MineController extends GetxController {
|
||||
RxBool isLogin = false.obs;
|
||||
|
||||
Rx<ThemeType> themeType = ThemeType.system.obs;
|
||||
static Box get setting => GStorage.setting;
|
||||
Box get setting => GStorage.setting;
|
||||
static RxBool anonymity = (Accounts.account.isNotEmpty &&
|
||||
!Accounts.get(AccountType.heartbeat).isLogin)
|
||||
.obs;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import 'package:PiliPlus/common/widgets/dialog.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/pages/mine/controller.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:PiliPlus/http/search.dart';
|
||||
@@ -88,9 +90,12 @@ class SSearchController extends GetxController {
|
||||
validateUid();
|
||||
}
|
||||
|
||||
if (MineController.anonymity.value.not) {
|
||||
historyList.remove(controller.text);
|
||||
historyList.insert(0, controller.text);
|
||||
GStorage.historyWord.put('cacheList', historyList);
|
||||
}
|
||||
|
||||
searchFocusNode.unfocus();
|
||||
|
||||
await Get.toNamed(
|
||||
|
||||
Reference in New Issue
Block a user