mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: save rcmd
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -43,9 +43,10 @@ class _HomePageState extends State<HomePage>
|
|||||||
if (!_homeController.useSideBar) customAppBar,
|
if (!_homeController.useSideBar) customAppBar,
|
||||||
if (_homeController.tabs.length > 1) ...[
|
if (_homeController.tabs.length > 1) ...[
|
||||||
const SizedBox(height: 4),
|
const SizedBox(height: 4),
|
||||||
Container(
|
Material(
|
||||||
height: 42,
|
|
||||||
color: Theme.of(context).colorScheme.surface,
|
color: Theme.of(context).colorScheme.surface,
|
||||||
|
child: SizedBox(
|
||||||
|
height: 42,
|
||||||
child: TabBar(
|
child: TabBar(
|
||||||
controller: _homeController.tabController,
|
controller: _homeController.tabController,
|
||||||
tabs: [
|
tabs: [
|
||||||
@@ -64,6 +65,7 @@ class _HomePageState extends State<HomePage>
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
] else
|
] else
|
||||||
const SizedBox(height: 6),
|
const SizedBox(height: 6),
|
||||||
Expanded(
|
Expanded(
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class RcmdController extends CommonController {
|
|||||||
bool shouldSaveLast = enableSaveLastData && currentPage == 0;
|
bool shouldSaveLast = enableSaveLastData && currentPage == 0;
|
||||||
if (shouldSaveLast) {
|
if (shouldSaveLast) {
|
||||||
int length = currentList.length;
|
int length = currentList.length;
|
||||||
shouldSaveLast = shouldSaveLast && length > 0 && length < 500;
|
shouldSaveLast = length > 0 && length < 500;
|
||||||
}
|
}
|
||||||
lastRefreshAt = shouldSaveLast && savedRcmdTip ? dataList.length : null;
|
lastRefreshAt = shouldSaveLast && savedRcmdTip ? dataList.length : null;
|
||||||
return shouldSaveLast ? dataList + currentList : null;
|
return shouldSaveLast ? dataList + currentList : null;
|
||||||
|
|||||||
@@ -1136,7 +1136,11 @@ List<SettingsModel> get recommendSettings => [
|
|||||||
defaultVal: true,
|
defaultVal: true,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
try {
|
try {
|
||||||
Get.find<RcmdController>().savedRcmdTip = value;
|
RcmdController ctr = Get.find<RcmdController>();
|
||||||
|
ctr.savedRcmdTip = value;
|
||||||
|
if (value.not) {
|
||||||
|
ctr.lastRefreshAt = null;
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
debugPrint('$e');
|
debugPrint('$e');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user