feat: 原网页查看专栏

This commit is contained in:
guozhigq
2024-10-03 16:30:47 +08:00
parent 09d8980001
commit 0654f601f4
6 changed files with 37 additions and 18 deletions

View File

@ -22,6 +22,7 @@ class ReadPageController extends GetxController {
title.value = Get.parameters['title'] ?? '';
id = Get.parameters['id']!;
articleType = Get.parameters['articleType']!;
url = 'https://www.bilibili.com/read/cv$id';
scrollController.addListener(_scrollListener);
fetchViewInfo();
}
@ -85,6 +86,15 @@ class ReadPageController extends GetxController {
ReadHttp.getViewInfo(id: id);
}
// 跳转webview
void onJumpWebview() {
Get.toNamed('/webview', parameters: {
'url': url,
'type': 'webview',
'pageTitle': title.value,
});
}
@override
void onClose() {
scrollController.removeListener(_scrollListener);

View File

@ -72,9 +72,14 @@ class _ReadPageState extends State<ReadPage> {
},
),
actions: [
IconButton(
icon: const Icon(Icons.more_vert_rounded),
onPressed: () {},
PopupMenuButton(
icon: const Icon(Icons.more_vert_outlined),
itemBuilder: (BuildContext context) => <PopupMenuEntry>[
PopupMenuItem(
onTap: controller.onJumpWebview,
child: const Text('查看原网页'),
)
],
),
const SizedBox(width: 16),
],