mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
@@ -133,7 +133,7 @@ class VideoCardV extends StatelessWidget {
|
||||
default:
|
||||
SmartDialog.showToast(videoItem.goto);
|
||||
Get.toNamed(
|
||||
'/webviewnew',
|
||||
'/webview',
|
||||
parameters: {
|
||||
'url': videoItem.uri,
|
||||
'type': 'url',
|
||||
|
||||
@@ -116,7 +116,7 @@ class VideoCardVMemberHome extends StatelessWidget {
|
||||
default:
|
||||
SmartDialog.showToast(goto);
|
||||
Get.toNamed(
|
||||
'/webviewnew',
|
||||
'/webview',
|
||||
parameters: {
|
||||
'url': videoItem.uri ?? '',
|
||||
'type': 'url',
|
||||
|
||||
@@ -33,7 +33,6 @@ class BangumiPanel extends StatefulWidget {
|
||||
class _BangumiPanelState extends State<BangumiPanel> {
|
||||
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<BangumiPanel> {
|
||||
void dispose() {
|
||||
_listener?.cancel();
|
||||
listViewScrollCtr.dispose();
|
||||
listViewScrollCtr_2.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@@ -88,8 +86,12 @@ class _BangumiPanelState extends State<BangumiPanel> {
|
||||
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<BangumiPanel> {
|
||||
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),
|
||||
|
||||
@@ -115,7 +115,7 @@ class DynamicsController extends GetxController
|
||||
});
|
||||
} else {
|
||||
Utils.toDupNamed(
|
||||
'/webviewnew',
|
||||
'/webview',
|
||||
parameters: {
|
||||
'url': 'https:$url',
|
||||
'type': 'note',
|
||||
|
||||
@@ -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']
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -200,7 +200,7 @@ class _HtmlRenderPageState extends State<HtmlRenderPage>
|
||||
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<HtmlRenderPage>
|
||||
),
|
||||
PopupMenuItem(
|
||||
onTap: () => {
|
||||
Get.toNamed('/webviewnew', parameters: {
|
||||
Get.toNamed('/webview', parameters: {
|
||||
'url': url.startsWith('http') ? url : 'https:$url',
|
||||
'type': 'url',
|
||||
'pageTitle': title,
|
||||
|
||||
@@ -295,7 +295,7 @@ class _LiveRoomPageState extends State<LiveRoomPage>
|
||||
tooltip: '内置浏览器打开',
|
||||
onPressed: () {
|
||||
Get.offNamed(
|
||||
'/webviewnew',
|
||||
'/webview',
|
||||
parameters: {
|
||||
'url':
|
||||
'https://live.bilibili.com/h5/${_liveRoomController.roomId}',
|
||||
|
||||
@@ -273,7 +273,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||
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<LoginPage> {
|
||||
dense: false,
|
||||
onTap: () async {
|
||||
Get.back();
|
||||
Get.toNamed('/webviewnew', parameters: {
|
||||
Get.toNamed('/webview', parameters: {
|
||||
'url':
|
||||
'https://passport.bilibili.com/pc/passport/findPassword',
|
||||
'type': 'url',
|
||||
|
||||
@@ -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': "创作中心(建议浏览器打开)",
|
||||
|
||||
@@ -187,7 +187,7 @@ class _MediaPageState extends State<MediaPage>
|
||||
),
|
||||
SizedBox(
|
||||
height: MediaQuery.paddingOf(context).bottom + 100,
|
||||
)
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -102,6 +102,7 @@ class _MemberVideoState extends State<MemberVideo>
|
||||
label: Text(
|
||||
_controller.episodicButton?.text ?? '播放全部',
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.secondary,
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -936,7 +936,7 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
|
||||
// 处理点击事件
|
||||
try {
|
||||
Get.toNamed(
|
||||
'/webviewnew',
|
||||
'/webview',
|
||||
parameters: {
|
||||
'url': match.group(0)!,
|
||||
'type': 'url',
|
||||
|
||||
@@ -168,7 +168,7 @@ class IntroDetail extends StatelessWidget {
|
||||
// 处理点击事件
|
||||
try {
|
||||
Get.toNamed(
|
||||
'/webviewnew',
|
||||
'/webview',
|
||||
parameters: {
|
||||
'url': match.group(0)!,
|
||||
'type': 'url',
|
||||
|
||||
@@ -50,7 +50,8 @@ class _PagesPanelState extends State<PagesPanel> {
|
||||
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(
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -1043,7 +1043,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
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}'
|
||||
});
|
||||
|
||||
@@ -191,7 +191,7 @@ class AiDetail extends StatelessWidget {
|
||||
// 处理点击事件
|
||||
try {
|
||||
Get.toNamed(
|
||||
'/webviewnew',
|
||||
'/webview',
|
||||
parameters: {
|
||||
'url': match.group(0)!,
|
||||
'type': 'url',
|
||||
|
||||
@@ -465,7 +465,7 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
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}'
|
||||
});
|
||||
|
||||
@@ -59,7 +59,7 @@ class _WhisperPageState extends State<WhisperPage> {
|
||||
color: Theme.of(context).colorScheme.primary),
|
||||
tooltip: '用浏览器打开',
|
||||
onPressed: () {
|
||||
Get.toNamed('/webviewnew', parameters: {
|
||||
Get.toNamed('/webview', parameters: {
|
||||
'url': 'https://message.bilibili.com',
|
||||
'type': 'whisper',
|
||||
'pageTitle': '消息中心',
|
||||
|
||||
@@ -312,7 +312,7 @@ class ChatItem extends StatelessWidget {
|
||||
}
|
||||
} else {
|
||||
SmartDialog.showToast('未匹配到 BV 号');
|
||||
Get.toNamed('/webviewnew',
|
||||
Get.toNamed('/webview',
|
||||
arguments: {'url': i['jump_url']});
|
||||
}
|
||||
},
|
||||
|
||||
@@ -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()),
|
||||
//
|
||||
|
||||
@@ -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<String> 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',
|
||||
|
||||
@@ -54,7 +54,7 @@ class UrlUtils {
|
||||
);
|
||||
} else {
|
||||
await Get.toNamed(
|
||||
'/webviewnew',
|
||||
'/webview',
|
||||
parameters: {
|
||||
'url': redirectUrl,
|
||||
'type': 'url',
|
||||
|
||||
Reference in New Issue
Block a user