mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-15 13:43:56 +08:00
@@ -22,10 +22,8 @@ import 'package:PiliPlus/utils/date_utils.dart';
|
||||
import 'package:PiliPlus/utils/duration_utils.dart';
|
||||
import 'package:PiliPlus/utils/extension/num_ext.dart';
|
||||
import 'package:PiliPlus/utils/id_utils.dart';
|
||||
import 'package:PiliPlus/utils/platform_utils.dart';
|
||||
import 'package:PiliPlus/utils/storage_pref.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:connectivity_plus/connectivity_plus.dart';
|
||||
import 'package:flutter/foundation.dart' show kDebugMode, kReleaseMode;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
@@ -149,22 +147,6 @@ class _DownloadPanelState extends State<DownloadPanel> {
|
||||
),
|
||||
),
|
||||
),
|
||||
if (kDebugMode || PlatformUtils.isMobile) ...[
|
||||
const Spacer(),
|
||||
StreamBuilder(
|
||||
stream: Connectivity().onConnectivityChanged,
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.data case final data?) {
|
||||
final network = data.contains(ConnectivityResult.wifi)
|
||||
? 'WIFI'
|
||||
: '数据';
|
||||
return Text('当前网络:$network', style: textStyle);
|
||||
}
|
||||
return const SizedBox.shrink();
|
||||
},
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
],
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -94,12 +94,6 @@ class _LocalIntroPanelState extends State<LocalIntroPanel>
|
||||
cacheHeight: cacheWidth
|
||||
? null
|
||||
: 88.cacheSize(context),
|
||||
colorBlendMode: NetworkImgLayer.reduce
|
||||
? BlendMode.modulate
|
||||
: null,
|
||||
color: NetworkImgLayer.reduce
|
||||
? NetworkImgLayer.reduceLuxColor
|
||||
: null,
|
||||
),
|
||||
)
|
||||
: NetworkImgLayer(
|
||||
|
||||
@@ -21,7 +21,6 @@ import 'package:PiliPlus/pages/video/reply/controller.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/models/play_repeat.dart';
|
||||
import 'package:PiliPlus/services/service_locator.dart';
|
||||
import 'package:PiliPlus/utils/extension/iterable_ext.dart';
|
||||
import 'package:PiliPlus/utils/feed_back.dart';
|
||||
import 'package:PiliPlus/utils/global_data.dart';
|
||||
import 'package:PiliPlus/utils/id_utils.dart';
|
||||
import 'package:PiliPlus/utils/page_utils.dart';
|
||||
@@ -417,7 +416,6 @@ class PgcIntroController extends CommonIntroController {
|
||||
// 一键三连
|
||||
@override
|
||||
Future<void> actionTriple() async {
|
||||
feedBack();
|
||||
if (!isLogin) {
|
||||
SmartDialog.showToast('账号未登录');
|
||||
return;
|
||||
|
||||
@@ -33,7 +33,6 @@ import 'package:PiliPlus/utils/accounts.dart';
|
||||
import 'package:PiliPlus/utils/device_utils.dart';
|
||||
import 'package:PiliPlus/utils/extension/size_ext.dart';
|
||||
import 'package:PiliPlus/utils/extension/string_ext.dart';
|
||||
import 'package:PiliPlus/utils/feed_back.dart';
|
||||
import 'package:PiliPlus/utils/global_data.dart';
|
||||
import 'package:PiliPlus/utils/id_utils.dart';
|
||||
import 'package:PiliPlus/utils/page_utils.dart';
|
||||
@@ -189,7 +188,6 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
|
||||
// 一键三连
|
||||
@override
|
||||
Future<void> actionTriple() async {
|
||||
feedBack();
|
||||
if (!isLogin) {
|
||||
SmartDialog.showToast('账号未登录');
|
||||
return;
|
||||
|
||||
@@ -30,7 +30,6 @@ import 'package:PiliPlus/utils/extension/iterable_ext.dart';
|
||||
import 'package:PiliPlus/utils/extension/num_ext.dart';
|
||||
import 'package:PiliPlus/utils/extension/string_ext.dart';
|
||||
import 'package:PiliPlus/utils/extension/theme_ext.dart';
|
||||
import 'package:PiliPlus/utils/feed_back.dart';
|
||||
import 'package:PiliPlus/utils/id_utils.dart';
|
||||
import 'package:PiliPlus/utils/num_utils.dart';
|
||||
import 'package:PiliPlus/utils/page_utils.dart';
|
||||
@@ -109,7 +108,6 @@ class _UgcIntroPanelState extends State<UgcIntroPanel> {
|
||||
if (isLoading) {
|
||||
return;
|
||||
}
|
||||
feedBack();
|
||||
introController.expandableCtr.toggle();
|
||||
},
|
||||
child: Column(
|
||||
@@ -128,7 +126,6 @@ class _UgcIntroPanelState extends State<UgcIntroPanel> {
|
||||
theme,
|
||||
() {
|
||||
if (mid != null) {
|
||||
feedBack();
|
||||
if (!isPortrait &&
|
||||
introController.horizontalMemberPage) {
|
||||
widget.onShowMemberPage(mid);
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import 'package:PiliPlus/utils/feed_back.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ActionRowLineItem extends StatelessWidget {
|
||||
@@ -27,10 +26,7 @@ class ActionRowLineItem extends StatelessWidget {
|
||||
borderRadius: const BorderRadius.all(Radius.circular(30)),
|
||||
child: InkWell(
|
||||
borderRadius: const BorderRadius.all(Radius.circular(30)),
|
||||
onTap: () => {
|
||||
feedBack(),
|
||||
onTap?.call(),
|
||||
},
|
||||
onTap: () => onTap?.call(),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.fromLTRB(13, 5.5, 13, 4.5),
|
||||
decoration: BoxDecoration(
|
||||
|
||||
@@ -10,7 +10,6 @@ import 'package:PiliPlus/pages/common/fab_mixin.dart';
|
||||
import 'package:PiliPlus/pages/video/reply/controller.dart';
|
||||
import 'package:PiliPlus/pages/video/reply/widgets/reply_item_grpc.dart';
|
||||
import 'package:PiliPlus/pages/video/reply_reply/view.dart';
|
||||
import 'package:PiliPlus/utils/feed_back.dart';
|
||||
import 'package:easy_debounce/easy_throttle.dart';
|
||||
import 'package:extended_nested_scroll_view/extended_nested_scroll_view.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -144,14 +143,11 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
|
||||
),
|
||||
child: FloatingActionButton(
|
||||
heroTag: null,
|
||||
onPressed: () {
|
||||
feedBack();
|
||||
_videoReplyController.onReply(
|
||||
null,
|
||||
oid: _videoReplyController.aid,
|
||||
replyType: _videoReplyController.videoType.replyType,
|
||||
);
|
||||
},
|
||||
onPressed: () => _videoReplyController.onReply(
|
||||
null,
|
||||
oid: _videoReplyController.aid,
|
||||
replyType: _videoReplyController.videoType.replyType,
|
||||
),
|
||||
tooltip: '发表评论',
|
||||
child: const Icon(Icons.reply),
|
||||
),
|
||||
|
||||
@@ -13,8 +13,6 @@ import 'package:PiliPlus/common/widgets/image_grid/image_grid_view.dart';
|
||||
import 'package:PiliPlus/common/widgets/pendant_avatar.dart';
|
||||
import 'package:PiliPlus/grpc/bilibili/main/community/reply/v1.pb.dart'
|
||||
show ReplyInfo, ReplyControl, Content, Url;
|
||||
import 'package:PiliPlus/grpc/reply.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/http/reply.dart';
|
||||
import 'package:PiliPlus/http/video.dart';
|
||||
import 'package:PiliPlus/models/common/badge_type.dart';
|
||||
@@ -34,13 +32,11 @@ import 'package:PiliPlus/utils/duration_utils.dart';
|
||||
import 'package:PiliPlus/utils/extension/context_ext.dart';
|
||||
import 'package:PiliPlus/utils/extension/num_ext.dart';
|
||||
import 'package:PiliPlus/utils/extension/theme_ext.dart';
|
||||
import 'package:PiliPlus/utils/feed_back.dart';
|
||||
import 'package:PiliPlus/utils/global_data.dart';
|
||||
import 'package:PiliPlus/utils/image_utils.dart';
|
||||
import 'package:PiliPlus/utils/page_utils.dart';
|
||||
import 'package:PiliPlus/utils/platform_utils.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:PiliPlus/utils/storage_pref.dart';
|
||||
import 'package:PiliPlus/utils/url_utils.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
@@ -84,8 +80,6 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
|
||||
static final _voteRegExp = RegExp(r"^\{vote:\d+?\}$");
|
||||
static final _timeRegExp = RegExp(r'^(?:\d+[::])?\d+[::]\d+$');
|
||||
static bool enableWordRe = Pref.enableWordRe;
|
||||
static int? replyLengthLimit = Pref.replyLengthLimit;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -140,10 +134,7 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
Widget _buildHeader(BuildContext context, ThemeData theme) {
|
||||
final member = replyItem.member;
|
||||
Widget header = GestureDetector(
|
||||
onTap: () {
|
||||
feedBack();
|
||||
Get.toNamed('/member?mid=${replyItem.mid}');
|
||||
},
|
||||
onTap: () => Get.toNamed('/member?mid=${replyItem.mid}'),
|
||||
child: ExtraHitTestWidget(
|
||||
width: 46,
|
||||
child: Row(
|
||||
@@ -310,7 +301,6 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
height: 1.75,
|
||||
fontSize: theme.textTheme.bodyMedium!.fontSize,
|
||||
),
|
||||
maxLines: replyLevel == 1 ? replyLengthLimit : null,
|
||||
TextSpan(
|
||||
children: [
|
||||
if (replyControl.isUpTop) ...[
|
||||
@@ -330,9 +320,7 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
_buildMessage(
|
||||
context,
|
||||
theme,
|
||||
replyControl.showTranslation
|
||||
? replyItem.translatedContent
|
||||
: replyItem.content,
|
||||
replyItem.content,
|
||||
replyControl,
|
||||
),
|
||||
],
|
||||
@@ -371,72 +359,6 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildTranslateBtn(
|
||||
BuildContext context,
|
||||
ThemeData theme,
|
||||
ReplyControl replyControl,
|
||||
TextStyle textStyle,
|
||||
ButtonStyle buttonStyle,
|
||||
) {
|
||||
late bool isProcessing = false;
|
||||
final color = replyControl.showTranslation
|
||||
? theme.colorScheme.primary
|
||||
: theme.colorScheme.outline.withValues(alpha: 0.8);
|
||||
return SizedBox(
|
||||
height: 32,
|
||||
child: TextButton(
|
||||
style: buttonStyle,
|
||||
onPressed: () async {
|
||||
if (replyControl.showTranslation) {
|
||||
replyControl.showTranslation = false;
|
||||
(context as Element).markNeedsBuild();
|
||||
} else {
|
||||
if (isProcessing) {
|
||||
return;
|
||||
}
|
||||
if (replyItem.hasTranslatedContent()) {
|
||||
replyControl.showTranslation = true;
|
||||
(context as Element).markNeedsBuild();
|
||||
return;
|
||||
}
|
||||
isProcessing = true;
|
||||
final res = await ReplyGrpc.translateReply(
|
||||
type: replyItem.type,
|
||||
oid: replyItem.oid,
|
||||
rpid: replyItem.id,
|
||||
);
|
||||
if (res case Success(:final response)) {
|
||||
final item = response.translatedReplies[replyItem.id];
|
||||
if (item != null && item.hasTranslatedContent()) {
|
||||
replyControl.showTranslation = true;
|
||||
replyItem.translatedContent = item.translatedContent;
|
||||
if (context.mounted) {
|
||||
(context as Element).markNeedsBuild();
|
||||
}
|
||||
} else {
|
||||
SmartDialog.showToast('翻译结果为空');
|
||||
}
|
||||
} else if (res case Error(:final errMsg)) {
|
||||
SmartDialog.showToast('翻译失败: $errMsg');
|
||||
}
|
||||
isProcessing = false;
|
||||
}
|
||||
},
|
||||
child: Row(
|
||||
spacing: 3,
|
||||
mainAxisSize: .min,
|
||||
children: [
|
||||
Icon(Icons.translate, size: 16, color: color),
|
||||
Text(
|
||||
replyControl.showTranslation ? '原文' : '翻译',
|
||||
style: textStyle.copyWith(color: color),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget buttonAction(
|
||||
BuildContext context,
|
||||
ThemeData theme,
|
||||
@@ -460,10 +382,7 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
height: 32,
|
||||
child: TextButton(
|
||||
style: buttonStyle,
|
||||
onPressed: () {
|
||||
feedBack();
|
||||
onReply?.call(replyItem);
|
||||
},
|
||||
onPressed: () => onReply?.call(replyItem),
|
||||
child: Row(
|
||||
spacing: 3,
|
||||
mainAxisSize: .min,
|
||||
@@ -479,17 +398,7 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 2),
|
||||
if (replyControl.translationSwitch ==
|
||||
.TRANSLATION_SWITCH_SHOW_TRANSLATION) ...[
|
||||
_buildTranslateBtn(
|
||||
context,
|
||||
theme,
|
||||
replyControl,
|
||||
textStyle,
|
||||
buttonStyle,
|
||||
),
|
||||
const SizedBox(width: 2),
|
||||
] else if (replyItem.replyControl.cardLabels.isNotEmpty) ...[
|
||||
if (replyItem.replyControl.cardLabels.isNotEmpty) ...[
|
||||
Text(
|
||||
replyItem.replyControl.cardLabels
|
||||
.map((e) => e.textContent)
|
||||
@@ -598,12 +507,9 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
color: theme.colorScheme.primary,
|
||||
),
|
||||
recognizer: NoDeadlineTapGestureRecognizer()
|
||||
..onTap = () {
|
||||
feedBack();
|
||||
Get.toNamed(
|
||||
'/member?mid=${childReply.member.mid}',
|
||||
);
|
||||
},
|
||||
..onTap = () => Get.toNamed(
|
||||
'/member?mid=${childReply.member.mid}',
|
||||
),
|
||||
),
|
||||
if (childReply.mid == upMid) ...[
|
||||
const TextSpan(text: ' '),
|
||||
@@ -709,7 +615,7 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
}
|
||||
|
||||
void addUrl(String matchStr, Url url, {bool addPlainText = false}) {
|
||||
if (url.extra.isWordSearch && !enableWordRe) {
|
||||
if (url.extra.isWordSearch) {
|
||||
if (addPlainText) {
|
||||
addPlainTextSpan(matchStr);
|
||||
}
|
||||
@@ -796,13 +702,7 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
spanChildren.add(
|
||||
WidgetSpan(
|
||||
child: NetworkImgLayer(
|
||||
/// remove gif
|
||||
src: emote.url,
|
||||
// src: emote.hasWebpUrl()
|
||||
// ? emote.webpUrl
|
||||
// : emote.hasGifUrl()
|
||||
// ? emote.gifUrl
|
||||
// : emote.url,
|
||||
type: ImageType.emote,
|
||||
width: size,
|
||||
height: size,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'package:PiliPlus/grpc/bilibili/main/community/reply/v1.pb.dart'
|
||||
show ReplyInfo;
|
||||
import 'package:PiliPlus/http/reply.dart';
|
||||
import 'package:PiliPlus/utils/feed_back.dart';
|
||||
import 'package:PiliPlus/utils/num_utils.dart';
|
||||
import 'package:fixnum/fixnum.dart' as $fixnum;
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -27,7 +26,6 @@ class ZanButtonGrpc extends StatelessWidget {
|
||||
return;
|
||||
}
|
||||
isProcessing = true;
|
||||
feedBack();
|
||||
final int oid = replyItem.oid.toInt();
|
||||
final int rpid = replyItem.id.toInt();
|
||||
// 1 已点赞 2 不喜欢 0 未操作
|
||||
@@ -68,7 +66,6 @@ class ZanButtonGrpc extends StatelessWidget {
|
||||
return;
|
||||
}
|
||||
isProcessing = true;
|
||||
feedBack();
|
||||
final int oid = replyItem.oid.toInt();
|
||||
final int rpid = replyItem.id.toInt();
|
||||
// 1 已点赞 2 不喜欢 0 未操作
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import 'dart:async';
|
||||
import 'dart:async' show Timer;
|
||||
import 'dart:convert' show jsonDecode, utf8;
|
||||
import 'dart:io';
|
||||
import 'dart:io' show Platform, File;
|
||||
import 'dart:math';
|
||||
import 'dart:typed_data' show Uint8List;
|
||||
|
||||
import 'package:PiliPlus/common/constants.dart';
|
||||
import 'package:PiliPlus/common/widgets/button/icon_button.dart';
|
||||
@@ -59,7 +60,7 @@ import 'package:dio/dio.dart';
|
||||
import 'package:easy_debounce/easy_throttle.dart';
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:floating/floating.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/foundation.dart' show compute;
|
||||
import 'package:flutter/material.dart' hide showBottomSheet;
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
|
||||
Reference in New Issue
Block a user