diff --git a/lib/common/widgets/video_card_v.dart b/lib/common/widgets/video_card_v.dart index 327ed42e..d36c7a2e 100644 --- a/lib/common/widgets/video_card_v.dart +++ b/lib/common/widgets/video_card_v.dart @@ -133,7 +133,7 @@ class VideoCardV extends StatelessWidget { default: SmartDialog.showToast(videoItem.goto); Get.toNamed( - '/webviewnew', + '/webview', parameters: { 'url': videoItem.uri, 'type': 'url', diff --git a/lib/common/widgets/video_card_v_member_home.dart b/lib/common/widgets/video_card_v_member_home.dart index 8ca3f1f5..0d1e8b70 100644 --- a/lib/common/widgets/video_card_v_member_home.dart +++ b/lib/common/widgets/video_card_v_member_home.dart @@ -116,7 +116,7 @@ class VideoCardVMemberHome extends StatelessWidget { default: SmartDialog.showToast(goto); Get.toNamed( - '/webviewnew', + '/webview', parameters: { 'url': videoItem.uri ?? '', 'type': 'url', diff --git a/lib/pages/bangumi/widgets/bangumi_panel.dart b/lib/pages/bangumi/widgets/bangumi_panel.dart index 3ebdfa50..2e2c2b62 100644 --- a/lib/pages/bangumi/widgets/bangumi_panel.dart +++ b/lib/pages/bangumi/widgets/bangumi_panel.dart @@ -33,7 +33,6 @@ class BangumiPanel extends StatefulWidget { class _BangumiPanelState extends State { late int currentIndex; final ScrollController listViewScrollCtr = ScrollController(); - final ScrollController listViewScrollCtr_2 = ScrollController(); dynamic userInfo; // 默认未开通 int vipStatus = 0; @@ -66,7 +65,6 @@ class _BangumiPanelState extends State { void dispose() { _listener?.cancel(); listViewScrollCtr.dispose(); - listViewScrollCtr_2.dispose(); super.dispose(); } @@ -88,8 +86,12 @@ class _BangumiPanelState extends State { void scrollToIndex() { WidgetsBinding.instance.addPostFrameCallback((_) { // 在回调函数中获取更新后的状态 - listViewScrollCtr.animateTo(currentIndex * 150, - duration: const Duration(milliseconds: 500), curve: Curves.easeInOut); + listViewScrollCtr.animateTo( + (currentIndex * 150.0).clamp(listViewScrollCtr.position.minScrollExtent, + listViewScrollCtr.position.maxScrollExtent), + duration: const Duration(milliseconds: 500), + curve: Curves.easeInOut, + ); }); } @@ -149,7 +151,9 @@ class _BangumiPanelState extends State { itemBuilder: (BuildContext context, int i) { return Container( width: 150, - margin: const EdgeInsets.only(right: 10), + margin: EdgeInsets.only( + right: i == widget.pages.length - 1 ? 0 : 10, + ), child: Material( color: Theme.of(context).colorScheme.onInverseSurface, borderRadius: BorderRadius.circular(6), diff --git a/lib/pages/dynamics/controller.dart b/lib/pages/dynamics/controller.dart index 74416acf..d18baf36 100644 --- a/lib/pages/dynamics/controller.dart +++ b/lib/pages/dynamics/controller.dart @@ -115,7 +115,7 @@ class DynamicsController extends GetxController }); } else { Utils.toDupNamed( - '/webviewnew', + '/webview', parameters: { 'url': 'https:$url', 'type': 'note', diff --git a/lib/pages/dynamics/widgets/forward_panel.dart b/lib/pages/dynamics/widgets/forward_panel.dart index f693af78..f90aae9f 100644 --- a/lib/pages/dynamics/widgets/forward_panel.dart +++ b/lib/pages/dynamics/widgets/forward_panel.dart @@ -233,7 +233,7 @@ Widget forWard(item, context, ctr, source, {floor = 1}) { case 'DYNAMIC_TYPE_COMMON_SQUARE': return InkWell( onTap: () { - Get.toNamed('/webviewnew', parameters: { + Get.toNamed('/webview', parameters: { 'url': item.modules.moduleDynamic.major.common['jump_url'], 'type': 'url', 'pageTitle': item.modules.moduleDynamic.major.common['title'] @@ -284,7 +284,7 @@ Widget forWard(item, context, ctr, source, {floor = 1}) { final Map music = item.modules.moduleDynamic.major.music; return InkWell( onTap: () { - Get.toNamed('/webviewnew', parameters: { + Get.toNamed('/webview', parameters: { 'url': "https:${music['jump_url']}", 'type': 'url', 'pageTitle': music['title'] diff --git a/lib/pages/dynamics/widgets/rich_node_panel.dart b/lib/pages/dynamics/widgets/rich_node_panel.dart index 18c3a8da..3d7f0d9c 100644 --- a/lib/pages/dynamics/widgets/rich_node_panel.dart +++ b/lib/pages/dynamics/widgets/rich_node_panel.dart @@ -108,7 +108,7 @@ InlineSpan? richNode(item, context) { return; } Get.toNamed( - '/webviewnew', + '/webview', parameters: { 'url': url.startsWith('//') ? "https://${url.split('//').last}" @@ -136,7 +136,7 @@ InlineSpan? richNode(item, context) { try { String dynamicId = item.basic['comment_id_str']; Get.toNamed( - '/webviewnew', + '/webview', parameters: { 'url': 'https://t.bilibili.com/vote/h5/index/#/result?vote_id=${i.rid}&dynamic_id=$dynamicId&isWeb=1', diff --git a/lib/pages/history/widgets/item.dart b/lib/pages/history/widgets/item.dart index 236e518e..8a1ac797 100644 --- a/lib/pages/history/widgets/item.dart +++ b/lib/pages/history/widgets/item.dart @@ -45,7 +45,7 @@ class HistoryItem extends StatelessWidget { // // videoItem.history.oid ?? // await SearchHttp.ab2c(aid: aid, bvid: bvid); // Get.toNamed( - // '/webviewnew', + // '/webview', // parameters: { // 'url': 'https://www.bilibili.com/read/cv$cid', // 'type': 'note', diff --git a/lib/pages/html/view.dart b/lib/pages/html/view.dart index 918e5914..fbfd2c0d 100644 --- a/lib/pages/html/view.dart +++ b/lib/pages/html/view.dart @@ -200,7 +200,7 @@ class _HtmlRenderPageState extends State IconButton( tooltip: '用内置浏览器打开', onPressed: () { - Get.toNamed('/webviewnew', parameters: { + Get.toNamed('/webview', parameters: { 'url': url.startsWith('http') ? url : 'https:$url', 'type': 'url', 'pageTitle': title, @@ -226,7 +226,7 @@ class _HtmlRenderPageState extends State ), PopupMenuItem( onTap: () => { - Get.toNamed('/webviewnew', parameters: { + Get.toNamed('/webview', parameters: { 'url': url.startsWith('http') ? url : 'https:$url', 'type': 'url', 'pageTitle': title, diff --git a/lib/pages/live_room/view.dart b/lib/pages/live_room/view.dart index 9c4790af..0f10f23a 100644 --- a/lib/pages/live_room/view.dart +++ b/lib/pages/live_room/view.dart @@ -295,7 +295,7 @@ class _LiveRoomPageState extends State tooltip: '内置浏览器打开', onPressed: () { Get.offNamed( - '/webviewnew', + '/webview', parameters: { 'url': 'https://live.bilibili.com/h5/${_liveRoomController.roomId}', diff --git a/lib/pages/login/view.dart b/lib/pages/login/view.dart index 910e4d62..02efa8bb 100644 --- a/lib/pages/login/view.dart +++ b/lib/pages/login/view.dart @@ -273,7 +273,7 @@ class _LoginPageState extends State { dense: false, onTap: () async { Get.back(); - Get.toNamed('/webviewnew', parameters: { + Get.toNamed('/webview', parameters: { 'url': 'https://passport.bilibili.com/h5-app/passport/login/findPassword', 'type': 'url', @@ -291,7 +291,7 @@ class _LoginPageState extends State { dense: false, onTap: () async { Get.back(); - Get.toNamed('/webviewnew', parameters: { + Get.toNamed('/webview', parameters: { 'url': 'https://passport.bilibili.com/pc/passport/findPassword', 'type': 'url', diff --git a/lib/pages/media/controller.dart b/lib/pages/media/controller.dart index d9dcc5ef..e4eb0a33 100644 --- a/lib/pages/media/controller.dart +++ b/lib/pages/media/controller.dart @@ -1,7 +1,6 @@ import 'package:PiliPalaX/http/loading_state.dart'; import 'package:PiliPalaX/pages/common/common_controller.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:get/get.dart'; import 'package:PiliPalaX/http/user.dart'; import 'package:PiliPalaX/utils/storage.dart'; @@ -9,13 +8,13 @@ import 'package:PiliPalaX/utils/storage.dart'; class MediaController extends CommonController { RxBool userLogin = false.obs; List list = [ - { - 'icon': Icons.file_download_outlined, - 'title': '离线缓存', - 'onTap': () { - SmartDialog.showToast('功能开发中'); - }, - }, + // { + // 'icon': Icons.file_download_outlined, + // 'title': '离线缓存', + // 'onTap': () { + // SmartDialog.showToast('功能开发中'); + // }, + // }, { 'icon': Icons.history, 'title': '观看记录', @@ -33,8 +32,8 @@ class MediaController extends CommonController { }, { 'icon': Icons.create_outlined, - 'title': '创作中心(web)', - 'onTap': () => Get.toNamed('/webviewnew', parameters: { + 'title': '创作中心', + 'onTap': () => Get.toNamed('/webview', parameters: { 'url': 'https://member.bilibili.com/platform/home', 'type': 'url', 'pageTitle': "创作中心(建议浏览器打开)", diff --git a/lib/pages/media/view.dart b/lib/pages/media/view.dart index 2d4c11ea..02a8540d 100644 --- a/lib/pages/media/view.dart +++ b/lib/pages/media/view.dart @@ -187,7 +187,7 @@ class _MediaPageState extends State ), SizedBox( height: MediaQuery.paddingOf(context).bottom + 100, - ) + ), ], ); } diff --git a/lib/pages/member/new/content/member_contribute/content/video/member_video.dart b/lib/pages/member/new/content/member_contribute/content/video/member_video.dart index 8084fb04..d3d3a48e 100644 --- a/lib/pages/member/new/content/member_contribute/content/video/member_video.dart +++ b/lib/pages/member/new/content/member_contribute/content/video/member_video.dart @@ -102,6 +102,7 @@ class _MemberVideoState extends State label: Text( _controller.episodicButton?.text ?? '播放全部', style: TextStyle( + fontSize: 13, color: Theme.of(context) .colorScheme .secondary, diff --git a/lib/pages/member/widgets/profile.dart b/lib/pages/member/widgets/profile.dart index c162063c..f2941c28 100644 --- a/lib/pages/member/widgets/profile.dart +++ b/lib/pages/member/widgets/profile.dart @@ -233,7 +233,7 @@ class ProfilePanel extends StatelessWidget { if (ctr.ownerMid == ctr.mid && ctr.ownerMid != -1) ...[ TextButton( onPressed: () { - Get.toNamed('/webviewnew', parameters: { + Get.toNamed('/webview', parameters: { 'url': 'https://account.bilibili.com/account/home', 'pageTitle': '个人中心(建议浏览器打开)', 'type': 'url' diff --git a/lib/pages/mine/controller.dart b/lib/pages/mine/controller.dart index 7331e977..ebad5b4a 100644 --- a/lib/pages/mine/controller.dart +++ b/lib/pages/mine/controller.dart @@ -42,7 +42,7 @@ class MineController extends GetxController { onLogin() async { if (!userLogin.value) { // Get.toNamed( - // '/webviewnew', + // '/webview', // parameters: { // 'url': 'https://passport.bilibili.com/h5-app/passport/login', // 'type': 'login', diff --git a/lib/pages/video/detail/introduction/view.dart b/lib/pages/video/detail/introduction/view.dart index 212e4f07..1a523456 100644 --- a/lib/pages/video/detail/introduction/view.dart +++ b/lib/pages/video/detail/introduction/view.dart @@ -936,7 +936,7 @@ class _VideoInfoState extends State with TickerProviderStateMixin { // 处理点击事件 try { Get.toNamed( - '/webviewnew', + '/webview', parameters: { 'url': match.group(0)!, 'type': 'url', diff --git a/lib/pages/video/detail/introduction/widgets/intro_detail.dart b/lib/pages/video/detail/introduction/widgets/intro_detail.dart index 0b38ec62..972eef7c 100644 --- a/lib/pages/video/detail/introduction/widgets/intro_detail.dart +++ b/lib/pages/video/detail/introduction/widgets/intro_detail.dart @@ -168,7 +168,7 @@ class IntroDetail extends StatelessWidget { // 处理点击事件 try { Get.toNamed( - '/webviewnew', + '/webview', parameters: { 'url': match.group(0)!, 'type': 'url', diff --git a/lib/pages/video/detail/introduction/widgets/page.dart b/lib/pages/video/detail/introduction/widgets/page.dart index fe024e1a..7e830881 100644 --- a/lib/pages/video/detail/introduction/widgets/page.dart +++ b/lib/pages/video/detail/introduction/widgets/page.dart @@ -50,7 +50,8 @@ class _PagesPanelState extends State { if (!mounted) return; setState(() {}); const double itemWidth = 150; // 每个列表项的宽度 - final double targetOffset = min((pageIndex * itemWidth) - (itemWidth / 2), + final double targetOffset = (pageIndex * itemWidth - itemWidth / 2).clamp( + _scrollController.position.minScrollExtent, _scrollController.position.maxScrollExtent); // 滑动至目标位置 _scrollController.animateTo( diff --git a/lib/pages/video/detail/reply/widgets/reply_item.dart b/lib/pages/video/detail/reply/widgets/reply_item.dart index c98feccb..510c1695 100644 --- a/lib/pages/video/detail/reply/widgets/reply_item.dart +++ b/lib/pages/video/detail/reply/widgets/reply_item.dart @@ -599,7 +599,7 @@ class ReplyItem extends StatelessWidget { ), recognizer: TapGestureRecognizer() ..onTap = () => Get.toNamed( - '/webviewnew', + '/webview', parameters: { 'url': content.vote['url'], 'type': 'vote', @@ -811,7 +811,7 @@ class ReplyItem extends StatelessWidget { // ); // } else { // Get.toNamed( - // '/webviewnew', + // '/webview', // parameters: { // 'url': redirectUrl, // 'type': 'url', @@ -839,7 +839,7 @@ class ReplyItem extends StatelessWidget { ); } else { Get.toNamed( - '/webviewnew', + '/webview', parameters: { 'url': redirectUrl, 'type': 'url', @@ -849,7 +849,7 @@ class ReplyItem extends StatelessWidget { } } else { Get.toNamed( - '/webviewnew', + '/webview', parameters: { 'url': matchStr, 'type': 'url', @@ -922,7 +922,7 @@ class ReplyItem extends StatelessWidget { recognizer: TapGestureRecognizer() ..onTap = () { Get.toNamed( - '/webviewnew', + '/webview', parameters: { 'url': patternStr, 'type': 'url', @@ -971,7 +971,7 @@ class ReplyItem extends StatelessWidget { ), recognizer: TapGestureRecognizer() ..onTap = () => Get.toNamed( - '/webviewnew', + '/webview', parameters: { 'url': content.richText['note']['click_url'], 'type': 'note', @@ -998,7 +998,7 @@ class MorePanel extends StatelessWidget { case 'report': Get.back(); dynamic result = await Get.toNamed( - '/webviewnew', + '/webview', parameters: { 'url': 'https://www.bilibili.com/h5/comment/report?mid=${item.mid}&oid=${item.oid}&pageType=1&rpid=${item.rpid}&platform=android', diff --git a/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart b/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart index 5673902d..4b974239 100644 --- a/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart +++ b/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart @@ -625,7 +625,7 @@ class ReplyItemGrpc extends StatelessWidget { ), recognizer: TapGestureRecognizer()..onTap = () {} // Get.toNamed( - // '/webviewnew', + // '/webview', // parameters: { // 'url': content.vote['url'], // 'type': 'vote', @@ -837,7 +837,7 @@ class ReplyItemGrpc extends StatelessWidget { // ); // } else { // Get.toNamed( - // '/webviewnew', + // '/webview', // parameters: { // 'url': redirectUrl, // 'type': 'url', @@ -865,7 +865,7 @@ class ReplyItemGrpc extends StatelessWidget { ); } else { Get.toNamed( - '/webviewnew', + '/webview', parameters: { 'url': redirectUrl, 'type': 'url', @@ -875,7 +875,7 @@ class ReplyItemGrpc extends StatelessWidget { } } else { Get.toNamed( - '/webviewnew', + '/webview', parameters: { 'url': matchStr, 'type': 'url', @@ -917,7 +917,7 @@ class ReplyItemGrpc extends StatelessWidget { ), recognizer: TapGestureRecognizer() ..onTap = () => Get.toNamed( - '/webviewnew', + '/webview', parameters: {'url': matchStr}, ), ), @@ -961,7 +961,7 @@ class ReplyItemGrpc extends StatelessWidget { recognizer: TapGestureRecognizer() ..onTap = () { Get.toNamed( - '/webviewnew', + '/webview', parameters: { 'url': patternStr, 'type': 'url', @@ -1022,7 +1022,7 @@ class ReplyItemGrpc extends StatelessWidget { ), recognizer: TapGestureRecognizer() ..onTap = () => Get.toNamed( - '/webviewnew', + '/webview', parameters: { 'url': content.richText.note.clickUrl, 'type': 'note', @@ -1047,7 +1047,7 @@ class ReplyItemGrpc extends StatelessWidget { case 'report': Get.back(); dynamic result = await Get.toNamed( - '/webviewnew', + '/webview', parameters: { 'url': 'https://www.bilibili.com/h5/comment/report?mid=${item.mid}&oid=${item.oid}&pageType=1&rpid=${item.id}&platform=android', diff --git a/lib/pages/video/detail/view.dart b/lib/pages/video/detail/view.dart index 5234fac3..a15c42cf 100644 --- a/lib/pages/video/detail/view.dart +++ b/lib/pages/video/detail/view.dart @@ -1043,7 +1043,7 @@ class _VideoDetailPageState extends State if (videoDetailController.userInfo == null) { SmartDialog.showToast('账号未登录'); } else { - Get.toNamed('/webviewnew', parameters: { + Get.toNamed('/webview', parameters: { 'url': 'https://www.bilibili.com/appeal/?avid=${IdUtils.bv2av(videoDetailController.bvid)}&bvid=${videoDetailController.bvid}' }); diff --git a/lib/pages/video/detail/widgets/ai_detail.dart b/lib/pages/video/detail/widgets/ai_detail.dart index bab7c6d3..f29a4eb5 100644 --- a/lib/pages/video/detail/widgets/ai_detail.dart +++ b/lib/pages/video/detail/widgets/ai_detail.dart @@ -191,7 +191,7 @@ class AiDetail extends StatelessWidget { // 处理点击事件 try { Get.toNamed( - '/webviewnew', + '/webview', parameters: { 'url': match.group(0)!, 'type': 'url', diff --git a/lib/pages/video/detail/widgets/header_control.dart b/lib/pages/video/detail/widgets/header_control.dart index d37eec5f..02d9f418 100644 --- a/lib/pages/video/detail/widgets/header_control.dart +++ b/lib/pages/video/detail/widgets/header_control.dart @@ -465,7 +465,7 @@ class _HeaderControlState extends State { return; } Get.back(); - Get.toNamed('/webviewnew', parameters: { + Get.toNamed('/webview', parameters: { 'url': 'https://www.bilibili.com/appeal/?avid=${IdUtils.bv2av(widget.videoDetailCtr.bvid)}&bvid=${widget.videoDetailCtr.bvid}' }); diff --git a/lib/pages/whisper/view.dart b/lib/pages/whisper/view.dart index f6eb27cd..b84d3ebd 100644 --- a/lib/pages/whisper/view.dart +++ b/lib/pages/whisper/view.dart @@ -59,7 +59,7 @@ class _WhisperPageState extends State { color: Theme.of(context).colorScheme.primary), tooltip: '用浏览器打开', onPressed: () { - Get.toNamed('/webviewnew', parameters: { + Get.toNamed('/webview', parameters: { 'url': 'https://message.bilibili.com', 'type': 'whisper', 'pageTitle': '消息中心', diff --git a/lib/pages/whisper_detail/widget/chat_item.dart b/lib/pages/whisper_detail/widget/chat_item.dart index 76590df6..50169745 100644 --- a/lib/pages/whisper_detail/widget/chat_item.dart +++ b/lib/pages/whisper_detail/widget/chat_item.dart @@ -312,7 +312,7 @@ class ChatItem extends StatelessWidget { } } else { SmartDialog.showToast('未匹配到 BV 号'); - Get.toNamed('/webviewnew', + Get.toNamed('/webview', arguments: {'url': i['jump_url']}); } }, diff --git a/lib/router/app_pages.dart b/lib/router/app_pages.dart index a9681e85..ae3822fd 100644 --- a/lib/router/app_pages.dart +++ b/lib/router/app_pages.dart @@ -66,7 +66,7 @@ class Routes { // 视频详情 CustomGetPage(name: '/video', page: () => const VideoDetailPage()), // - CustomGetPage(name: '/webviewnew', page: () => const WebviewPageNew()), + CustomGetPage(name: '/webview', page: () => const WebviewPageNew()), // 设置 CustomGetPage(name: '/setting', page: () => const SettingPage()), // diff --git a/lib/utils/app_scheme.dart b/lib/utils/app_scheme.dart index f1e50227..420ff025 100644 --- a/lib/utils/app_scheme.dart +++ b/lib/utils/app_scheme.dart @@ -97,7 +97,7 @@ class PiliScheme { if (path.startsWith('/detail')) { var opusId = path.split('/').last; Utils.toDupNamed( - '/webviewnew', + '/webview', parameters: { 'url': 'https://www.bilibili.com/opus/$opusId', 'type': 'url', @@ -160,7 +160,7 @@ class PiliScheme { void getToOpusWeb() { var opusId = path.split('/').last; Utils.toDupNamed( - '/webviewnew', + '/webview', parameters: { 'url': 'https://m.bilibili.com/dynamic/$opusId', 'type': 'url', @@ -200,7 +200,7 @@ class PiliScheme { debugPrint('$value'); SmartDialog.showToast('未知路径:$value,请截图反馈给开发者'); //Utils.toDupNamed( - // '/webviewnew', + // '/webview', // parameters: { // 'url': value.dataString ?? "", // 'type': 'url', @@ -345,7 +345,7 @@ class PiliScheme { ); } else { Utils.toDupNamed( - '/webviewnew', + '/webview', parameters: {'url': redirectUrl, 'type': 'url', 'pageTitle': ''}, ); } @@ -355,7 +355,7 @@ class PiliScheme { List pathPart = path.split('/'); if (pathPart.length < 3) { Utils.toDupNamed( - '/webviewnew', + '/webview', parameters: {'url': value.toString()}, ); return; @@ -415,7 +415,7 @@ class PiliScheme { } else { SmartDialog.showToast('未知路径或匹配错误:$value,先采用浏览器打开'); Utils.toDupNamed( - '/webviewnew', + '/webview', parameters: { 'url': value.toString(), 'type': 'url', diff --git a/lib/utils/url_utils.dart b/lib/utils/url_utils.dart index 8e5158c4..e7ca4189 100644 --- a/lib/utils/url_utils.dart +++ b/lib/utils/url_utils.dart @@ -54,7 +54,7 @@ class UrlUtils { ); } else { await Get.toNamed( - '/webviewnew', + '/webview', parameters: { 'url': redirectUrl, 'type': 'url',