mod: 本地缓存字段修改、登录状态

This commit is contained in:
guozhigq
2023-08-20 14:28:50 +08:00
parent 8627869309
commit 83341cd62b
29 changed files with 217 additions and 167 deletions

View File

@ -18,19 +18,25 @@ class _WebviewPageState extends State<WebviewPage> {
return Scaffold(
appBar: AppBar(
centerTitle: false,
titleSpacing: 0,
title: Text(
_webviewController.pageTitle,
style: Theme.of(context).textTheme.titleMedium,
),
actions: [
IconButton(
TextButton(
onPressed: () {
_webviewController.controller.reload();
},
icon: const Icon(
Icons.refresh,
size: 22,
),
child: const Text('刷新'),
),
Obx(
() => _webviewController.type.value == 'login'
? TextButton(
onPressed: () => _webviewController.confirmLogin(null),
child: const Text('刷新登录状态'),
)
: const SizedBox(),
),
const SizedBox(width: 10)
],
@ -48,6 +54,13 @@ class _WebviewPageState extends State<WebviewPage> {
),
),
),
Container(
width: double.infinity,
color: Theme.of(context).colorScheme.onInverseSurface,
padding:
const EdgeInsets.only(left: 12, right: 12, top: 6, bottom: 6),
child: const Text('登录成功未自动跳转? 请点击右上角「刷新登录状态」'),
),
Expanded(
child: WebViewWidget(controller: _webviewController.controller),
),