mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-30 23:58:13 +08:00
opt history pause tip
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -38,9 +38,7 @@ class _HistoryPageState extends State<HistoryPage>
|
|||||||
tag: _historyController.tabs[index - 1].type,
|
tag: _historyController.tabs[index - 1].type,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (_) {
|
} catch (_) {}
|
||||||
return _historyController;
|
|
||||||
}
|
|
||||||
return _historyController;
|
return _historyController;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,6 +69,7 @@ class _HistoryPageState extends State<HistoryPage>
|
|||||||
visible: enableMultiSelect,
|
visible: enableMultiSelect,
|
||||||
child1: AppBar(
|
child1: AppBar(
|
||||||
title: const Text('观看记录'),
|
title: const Text('观看记录'),
|
||||||
|
bottom: _buildPauseTip,
|
||||||
actions: [
|
actions: [
|
||||||
IconButton(
|
IconButton(
|
||||||
tooltip: '搜索',
|
tooltip: '搜索',
|
||||||
@@ -155,6 +154,7 @@ class _HistoryPageState extends State<HistoryPage>
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
child2: AppBar(
|
child2: AppBar(
|
||||||
|
bottom: _buildPauseTip,
|
||||||
leading: IconButton(
|
leading: IconButton(
|
||||||
tooltip: '取消',
|
tooltip: '取消',
|
||||||
onPressed: currCtr().handleSelect,
|
onPressed: currCtr().handleSelect,
|
||||||
@@ -297,23 +297,7 @@ class _HistoryPageState extends State<HistoryPage>
|
|||||||
childCount: response!.length,
|
childCount: response!.length,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: Builder(
|
: HttpError(onReload: _historyController.onReload),
|
||||||
builder: (context) {
|
|
||||||
final pauseStatus =
|
|
||||||
_historyController.baseCtr.pauseStatus.value;
|
|
||||||
return HttpError(
|
|
||||||
errMsg: pauseStatus ? '历史记录功能已关闭' : null,
|
|
||||||
btnText: pauseStatus ? '点击开启' : null,
|
|
||||||
onReload: () {
|
|
||||||
if (pauseStatus) {
|
|
||||||
_historyController.baseCtr.onPauseHistory(context);
|
|
||||||
} else {
|
|
||||||
_historyController.onReload();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
Error(:var errMsg) => HttpError(
|
Error(:var errMsg) => HttpError(
|
||||||
errMsg: errMsg,
|
errMsg: errMsg,
|
||||||
onReload: _historyController.onReload,
|
onReload: _historyController.onReload,
|
||||||
@@ -321,6 +305,57 @@ class _HistoryPageState extends State<HistoryPage>
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PreferredSizeWidget? get _buildPauseTip {
|
||||||
|
if (_historyController.baseCtr.pauseStatus.value) {
|
||||||
|
final theme = Theme.of(context).colorScheme;
|
||||||
|
return PreferredSize(
|
||||||
|
preferredSize: const Size.fromHeight(38),
|
||||||
|
child: Container(
|
||||||
|
height: 38,
|
||||||
|
color: theme.secondaryContainer.withValues(alpha: 0.8),
|
||||||
|
padding: const EdgeInsets.only(left: 16, right: 6),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
Icons.info_outline,
|
||||||
|
size: 18,
|
||||||
|
color: theme.onSecondaryContainer,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 4),
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
'历史记录功能已关闭',
|
||||||
|
strutStyle: const StrutStyle(height: 1, leading: 0),
|
||||||
|
style: TextStyle(
|
||||||
|
height: 1,
|
||||||
|
color: theme.onSecondaryContainer,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
GestureDetector(
|
||||||
|
behavior: HitTestBehavior.opaque,
|
||||||
|
onTap: () => _historyController.baseCtr.onPauseHistory(context),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
vertical: 6,
|
||||||
|
horizontal: 10,
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
'点击开启',
|
||||||
|
strutStyle: const StrutStyle(height: 1, leading: 0),
|
||||||
|
style: TextStyle(height: 1, color: theme.primary),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool get wantKeepAlive => widget.type != null;
|
bool get wantKeepAlive => widget.type != null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user