Merge branch 'main' into fix

This commit is contained in:
guozhigq
2024-11-16 15:34:40 +08:00
74 changed files with 229 additions and 379 deletions

View File

@ -39,9 +39,7 @@ class _AboutPageState extends State<AboutPage> {
TextStyle subTitleStyle =
TextStyle(fontSize: 13, color: Theme.of(context).colorScheme.outline);
return Scaffold(
appBar: AppBar(
title: Text('关于', style: Theme.of(context).textTheme.titleMedium),
),
appBar: AppBar(title: const Text('关于')),
body: SingleChildScrollView(
child: Column(
children: [

View File

@ -55,14 +55,9 @@ class _BlackListPageState extends State<BlackListPage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
elevation: 0,
scrolledUnderElevation: 0,
titleSpacing: 0,
centerTitle: false,
title: Obx(
() => Text(
'黑名单管理 ${_blackListController.total.value == 0 ? '' : '- ${_blackListController.total.value}'}',
style: Theme.of(context).textTheme.titleMedium,
),
),
),

View File

@ -123,4 +123,15 @@ class DynamicDetailController extends GetxController {
Future onLoad() async {
queryReplyList(reqType: 'onLoad');
}
Future removeReply(int? rpid, int? frpid) async {
// 移除一楼评论
if (rpid != null) {
replyList.removeWhere((item) {
return item.rpid == rpid;
});
}
/// TODO 移除二楼评论
}
}

View File

@ -111,14 +111,7 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
int rpid = replyItem.rpid!;
Get.to(
() => Scaffold(
appBar: AppBar(
titleSpacing: 0,
centerTitle: false,
title: Text(
'评论详情',
style: Theme.of(context).textTheme.titleMedium,
),
),
appBar: AppBar(title: const Text('评论详情')),
body: VideoReplyReplyPanel(
oid: oid,
rpid: rpid,
@ -192,10 +185,7 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
elevation: 0,
scrolledUnderElevation: 1,
centerTitle: false,
titleSpacing: 0,
title: StreamBuilder(
stream: titleStreamC.stream,
initialData: false,
@ -335,6 +325,8 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
.replies!
.add(replyItem);
},
onDelete:
_dynamicDetailController.removeReply,
);
}
},

View File

@ -78,8 +78,6 @@ class _DynamicsPageState extends State<DynamicsPage>
super.build(context);
return Scaffold(
appBar: AppBar(
elevation: 0,
scrolledUnderElevation: 0,
title: SizedBox(
height: 34,
child: Stack(

View File

@ -49,13 +49,8 @@ class _FansPageState extends State<FansPage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
elevation: 0,
scrolledUnderElevation: 0,
centerTitle: false,
titleSpacing: 0,
title: Text(
_fansController.isOwner.value ? '我的粉丝' : '${_fansController.name}的粉丝',
style: Theme.of(context).textTheme.titleMedium,
),
),
body: RefreshIndicator(

View File

@ -40,11 +40,8 @@ class _FavPageState extends State<FavPage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
centerTitle: false,
titleSpacing: 0,
title: Obx(() => Text(
'${_favController.isOwner.value ? '' : 'Ta'}的收藏',
style: Theme.of(context).textTheme.titleMedium,
)),
actions: [
Obx(() => !_favController.isOwner.value

View File

@ -19,8 +19,6 @@ class _FavEditPageState extends State<FavEditPage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
elevation: 0,
scrolledUnderElevation: 0,
title: Obx(
() => _favEditController.type.value == 'add'
? Text(
@ -32,7 +30,6 @@ class _FavEditPageState extends State<FavEditPage> {
style: Theme.of(context).textTheme.titleMedium,
),
),
centerTitle: false,
actions: [
Obx(
() => _favEditController.privacy.value == 0

View File

@ -47,7 +47,6 @@ class _FavSearchPageState extends State<FavSearchPage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
titleSpacing: 0,
actions: [
IconButton(
onPressed: () => _favSearchCtr.submit(),

View File

@ -27,15 +27,10 @@ class _FollowPageState extends State<FollowPage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
elevation: 0,
scrolledUnderElevation: 0,
titleSpacing: 0,
centerTitle: false,
title: Text(
_followController.isOwner.value
? '我的关注'
: '${_followController.name}的关注',
style: Theme.of(context).textTheme.titleMedium,
),
actions: [
IconButton(

View File

@ -47,7 +47,6 @@ class _FollowSearchPageState extends State<FollowSearchPage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
titleSpacing: 0,
actions: [
IconButton(
onPressed: reRequest,

View File

@ -69,12 +69,7 @@ class _HistoryPageState extends State<HistoryPage> {
appBar: AppBarWidget(
visible: _historyController.enableMultiple.value,
child1: AppBar(
titleSpacing: 0,
centerTitle: false,
title: Text(
'观看记录',
style: Theme.of(context).textTheme.titleMedium,
),
title: const Text('观看记录'),
actions: [
IconButton(
onPressed: () => Get.toNamed('/historySearch'),
@ -127,8 +122,6 @@ class _HistoryPageState extends State<HistoryPage> {
],
),
child2: AppBar(
titleSpacing: 0,
centerTitle: false,
leading: IconButton(
onPressed: () {
_historyController.enableMultiple.value = false;
@ -143,7 +136,6 @@ class _HistoryPageState extends State<HistoryPage> {
title: Obx(
() => Text(
'已选择${_historyController.checkedCount.value}',
style: Theme.of(context).textTheme.titleMedium,
),
),
actions: [

View File

@ -45,7 +45,6 @@ class _HistorySearchPageState extends State<HistorySearchPage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
titleSpacing: 0,
actions: [
IconButton(
onPressed: () => _hisCtr.submit(),

View File

@ -54,7 +54,6 @@ class _HomePageState extends State<HomePage>
backgroundColor: Colors.transparent,
appBar: AppBar(
toolbarHeight: 0,
elevation: 0,
backgroundColor: Colors.transparent,
systemOverlayStyle: Platform.isAndroid
? SystemUiOverlayStyle(

View File

@ -28,7 +28,6 @@ class HomeAppBar extends StatelessWidget {
background: Column(
children: [
AppBar(
centerTitle: false,
title: const Text(
'PiLiPaLa',
style: TextStyle(
@ -73,8 +72,6 @@ class HomeAppBar extends StatelessWidget {
const SizedBox(width: 10)
],
elevation: 0,
scrolledUnderElevation: 0,
),
],
),

View File

@ -104,14 +104,7 @@ class _HtmlRenderPageState extends State<HtmlRenderPage>
int rpid = replyItem.rpid!;
Get.to(
() => Scaffold(
appBar: AppBar(
titleSpacing: 0,
centerTitle: false,
title: Text(
'评论详情',
style: Theme.of(context).textTheme.titleMedium,
),
),
appBar: AppBar(title: const Text('评论详情')),
body: VideoReplyReplyPanel(
oid: oid,
rpid: rpid,
@ -127,12 +120,7 @@ class _HtmlRenderPageState extends State<HtmlRenderPage>
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
centerTitle: false,
titleSpacing: 0,
title: Text(
title,
style: Theme.of(context).textTheme.titleMedium,
),
title: Text(title),
actions: [
const SizedBox(width: 4),
IconButton(

View File

@ -28,18 +28,12 @@ class _LaterPageState extends State<LaterPage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
titleSpacing: 0,
centerTitle: false,
title: Obx(
() => _laterController.laterList.isNotEmpty
? Text(
'稍后再看 (${_laterController.laterList.length})',
style: Theme.of(context).textTheme.titleMedium,
)
: Text(
'稍后再看',
style: Theme.of(context).textTheme.titleMedium,
),
: const Text('稍后再看'),
),
actions: [
Obx(

View File

@ -42,13 +42,8 @@ class _LiveFollowPageState extends State<LiveFollowPage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
elevation: 0,
scrolledUnderElevation: 0,
titleSpacing: 0,
centerTitle: false,
title: Obx(() => Text(
'${_liveFollowController.liveFollowingCount}人正在直播中',
style: Theme.of(context).textTheme.titleMedium,
)),
),
body: Container(

View File

@ -259,8 +259,6 @@ class _LiveRoomPageState extends State<LiveRoomPage>
left: 0,
right: 0,
child: AppBar(
centerTitle: false,
titleSpacing: 0,
backgroundColor: Colors.transparent,
foregroundColor: Colors.white,
toolbarHeight: isPortrait ? 56 : 0,

View File

@ -47,10 +47,7 @@ class _BottomControlState extends State<BottomControl> {
return AppBar(
backgroundColor: Colors.transparent,
foregroundColor: Colors.white,
elevation: 0,
scrolledUnderElevation: 0,
primary: false,
centerTitle: false,
automaticallyImplyLeading: false,
titleSpacing: 14,
title: Row(

View File

@ -122,7 +122,7 @@ class ProfilePanel extends StatelessWidget {
),
child: Row(children: [
Image.asset(
'assets/images/live.gif',
'assets/images/live.png',
height: 10,
),
Text(

View File

@ -47,12 +47,9 @@ class _MemberArchivePageState extends State<MemberArchivePage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
titleSpacing: 0,
centerTitle: false,
title: Obx(
() => Text(
'${_memberArchivesController.isOwner.value ? '' : 'Ta'}的投稿 - ${_memberArchivesController.currentOrder['label']}',
style: Theme.of(context).textTheme.titleMedium,
),
),
actions: [

View File

@ -48,12 +48,9 @@ class _MemberArticlePageState extends State<MemberArticlePage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
titleSpacing: 0,
centerTitle: false,
title: Obx(
() => Text(
'${_memberArticleController.isOwner.value ? '' : 'Ta'}的图文',
style: Theme.of(context).textTheme.titleMedium,
),
),
),

View File

@ -20,7 +20,6 @@ class MemberCoinsItem extends StatelessWidget {
Widget build(BuildContext context) {
String heroTag = Utils.makeHeroTag(coinItem.aid);
return Card(
elevation: 0,
clipBehavior: Clip.hardEdge,
margin: EdgeInsets.zero,
child: InkWell(

View File

@ -54,12 +54,9 @@ class _MemberDynamicsPageState extends State<MemberDynamicsPage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
titleSpacing: 0,
centerTitle: false,
title: Obx(
() => Text(
'${_memberDynamicController.isOwner.value ? '' : 'Ta'}的动态',
style: Theme.of(context).textTheme.titleMedium,
),
),
),

View File

@ -49,7 +49,6 @@ class _MemberSearchPageState extends State<MemberSearchPage>
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
titleSpacing: 0,
actions: [
IconButton(
onPressed: () => _memberSearchCtr.submit(),

View File

@ -41,12 +41,7 @@ class _MemberSeasonsPageState extends State<MemberSeasonsPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
titleSpacing: 0,
centerTitle: false,
title: Text(Get.parameters['seasonName']!,
style: Theme.of(context).textTheme.titleMedium),
),
appBar: AppBar(title: Text(Get.parameters['seasonName']!)),
body: Padding(
padding: const EdgeInsets.only(
left: StyleString.safeSpace,

View File

@ -47,9 +47,7 @@ class _MessageAtPageState extends State<MessageAtPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('@我的'),
),
appBar: AppBar(title: const Text('@我的')),
body: RefreshIndicator(
onRefresh: () async {
await _messageAtCtr.queryMessageAt(type: 'init');
@ -129,7 +127,7 @@ class AtItem extends StatelessWidget {
return InkWell(
onTap: () async {
MessageUtils.onClickMessage(context, uri, nativeUri, type);
MessageUtils.onClickMessage(context, uri, nativeUri, type, null);
},
child: Padding(
padding: const EdgeInsets.all(14),

View File

@ -47,9 +47,7 @@ class _MessageLikePageState extends State<MessageLikePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('收到的赞'),
),
appBar: AppBar(title: const Text('收到的赞')),
body: RefreshIndicator(
onRefresh: () async {
await _messageLikeCtr.queryMessageLike(type: 'init');
@ -127,7 +125,7 @@ class LikeItem extends StatelessWidget {
final String type = item.item!.type!;
return InkWell(
onTap: () async {
MessageUtils.onClickMessage(context, uri, nativeUri, type);
MessageUtils.onClickMessage(context, uri, nativeUri, type, null);
},
child: Stack(
children: [

View File

@ -48,9 +48,7 @@ class _MessageReplyPageState extends State<MessageReplyPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('回复我的'),
),
appBar: AppBar(title: const Text('回复我的')),
body: RefreshIndicator(
onRefresh: () async {
await _messageReplyCtr.queryMessageReply(type: 'init');
@ -119,7 +117,7 @@ class ReplyItem extends StatelessWidget {
final String type = item.item!.type!;
return InkWell(
onTap: () async {
MessageUtils.onClickMessage(context, uri, nativeUri, type);
MessageUtils.onClickMessage(context, uri, nativeUri, type, item.item!);
},
child: Padding(
padding: const EdgeInsets.all(14),
@ -157,6 +155,9 @@ class ReplyItem extends StatelessWidget {
text: '回复了我的评论',
style: TextStyle(color: outline),
),
if (item.item!.type! == 'dynamic')
TextSpan(
text: '对我的动态发表了评论', style: TextStyle(color: outline)),
])),
const SizedBox(height: 6),
Text.rich(
@ -199,11 +200,32 @@ class ReplyItem extends StatelessWidget {
),
),
if (item.item!.type! == 'video')
NetworkImgLayer(
// NetworkImgLayer(
// width: 60,
// height: 60,
// src: item.item!.image,
// radius: 6,
// ),
Container(
width: 60,
height: 60,
src: item.item!.image,
radius: 6,
clipBehavior: Clip.hardEdge,
decoration: const BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6)),
),
child: Image.network(item.item!.image!, fit: BoxFit.cover),
),
if (item.item!.type! == 'dynamic')
Container(
width: 60,
height: 80,
padding: const EdgeInsets.all(4),
child: Text(
item.item!.title!,
maxLines: 4,
style: const TextStyle(fontSize: 12, letterSpacing: 0.3),
overflow: TextOverflow.ellipsis,
),
),
],
),

View File

@ -29,9 +29,7 @@ class _MessageSystemPageState extends State<MessageSystemPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('系统通知'),
),
appBar: AppBar(title: const Text('系统通知')),
body: RefreshIndicator(
onRefresh: () async {
await _messageSystemCtr.queryAndProcessMessages();

View File

@ -3,6 +3,7 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart';
import 'package:pilipala/http/search.dart';
import 'package:pilipala/models/common/reply_type.dart';
import 'package:pilipala/models/msg/reply.dart';
import 'package:pilipala/pages/video/detail/reply_reply/index.dart';
import 'package:pilipala/utils/app_scheme.dart';
import 'package:pilipala/utils/utils.dart';
@ -10,7 +11,12 @@ import 'package:pilipala/utils/utils.dart';
class MessageUtils {
// 回复我的、收到的赞点击
static void onClickMessage(
BuildContext context, Uri uri, Uri nativeUri, String type) async {
BuildContext context,
Uri uri,
Uri nativeUri,
String type,
ReplyContentItem? item,
) async {
final String path = uri.path;
final String bvid = path.split('/').last;
String? sourceType;
@ -24,8 +30,8 @@ class MessageUtils {
if (nativePath.contains('detail')) {
// 动态详情
sourceType = 'opus';
oid = nativePath.split('/')[3];
commentRootId = nativePath.split('/')[4];
oid = item?.subjectId!.toString() ?? nativePath.split('/')[3];
commentRootId = item?.sourceId!.toString() ?? nativePath.split('/')[4];
}
switch (type) {
case 'video':
@ -47,6 +53,7 @@ class MessageUtils {
}
break;
case 'reply':
case 'dynamic':
debugPrint('commentRootId: $oid, $commentRootId');
navigateToComment(
context,

View File

@ -44,8 +44,6 @@ class _MinePageState extends State<MinePage>
super.build(context);
return Scaffold(
appBar: AppBar(
scrolledUnderElevation: 0,
elevation: 0,
actions: [
IconButton(
icon: const Icon(Icons.search_outlined),
@ -355,7 +353,8 @@ class _MinePageState extends State<MinePage>
itemBuilder: (context, index) {
if (flag && index == favFolderList.length) {
return Padding(
padding: const EdgeInsets.only(right: 14),
padding:
const EdgeInsets.only(right: 14, bottom: 70),
child: Center(
child: IconButton(
style: ButtonStyle(
@ -488,7 +487,7 @@ class FavFolderItem extends StatelessWidget {
child: NetworkImgLayer(
src: item!.cover,
width: 180,
height: 110,
height: MediaQuery.textScalerOf(context).scale(110),
),
),
),

View File

@ -23,9 +23,7 @@ class _MineEditPageState extends State<MineEditPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('编辑资料'),
),
appBar: AppBar(title: const Text('编辑资料')),
body: SingleChildScrollView(
padding: const EdgeInsets.all(16.0),
child: FutureBuilder(

View File

@ -38,7 +38,6 @@ class _RankPageState extends State<RankPage>
backgroundColor: Colors.transparent,
appBar: AppBar(
toolbarHeight: 0,
elevation: 0,
backgroundColor: Colors.transparent,
systemOverlayStyle: Platform.isAndroid
? SystemUiOverlayStyle(

View File

@ -49,7 +49,6 @@ class _SearchPageState extends State<SearchPage> with RouteAware {
width: 1,
),
),
titleSpacing: 0,
actions: [
IconButton(
onPressed: () => _searchController.submit(),

View File

@ -51,8 +51,6 @@ class _SearchResultPageState extends State<SearchResultPage>
width: 1,
),
),
titleSpacing: 0,
centerTitle: false,
title: GestureDetector(
onTap: () => Get.back(),
child: SizedBox(

View File

@ -131,14 +131,7 @@ class _ExtraSettingState extends State<ExtraSetting> {
.labelMedium!
.copyWith(color: Theme.of(context).colorScheme.outline);
return Scaffold(
appBar: AppBar(
centerTitle: false,
titleSpacing: 0,
title: Text(
'其他设置',
style: Theme.of(context).textTheme.titleMedium,
),
),
appBar: AppBar(title: const Text('其他设置')),
body: ListView(
children: [
const SetSwitchItem(

View File

@ -38,10 +38,7 @@ class _ColorSelectPageState extends State<ColorSelectPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
centerTitle: false,
title: const Text('选择应用主题'),
),
appBar: AppBar(title: const Text('选择应用主题')),
body: ListView(
children: [
Obx(

View File

@ -100,9 +100,7 @@ class _LogsPageState extends State<LogsPage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
centerTitle: false,
titleSpacing: 0,
title: Text('日志', style: Theme.of(context).textTheme.titleMedium),
title: const Text('日志'),
actions: [
PopupMenuButton<String>(
onSelected: (String type) {

View File

@ -34,14 +34,7 @@ class _PlayGesturePageState extends State<PlayGesturePage> {
.labelMedium!
.copyWith(color: Theme.of(context).colorScheme.outline);
return Scaffold(
appBar: AppBar(
centerTitle: false,
titleSpacing: 0,
title: Text(
'手势设置',
style: Theme.of(context).textTheme.titleMedium,
),
),
appBar: AppBar(title: const Text('手势设置')),
body: ListView(
children: [
ListTile(

View File

@ -204,16 +204,7 @@ class _PlaySpeedPageState extends State<PlaySpeedPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
elevation: 0,
scrolledUnderElevation: 0,
titleSpacing: 0,
centerTitle: false,
title: Text(
'倍速设置',
style: Theme.of(context).textTheme.titleMedium,
),
),
appBar: AppBar(title: const Text('倍速设置')),
body: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,

View File

@ -67,14 +67,7 @@ class _PlaySettingState extends State<PlaySetting> {
.labelMedium!
.copyWith(color: Theme.of(context).colorScheme.outline);
return Scaffold(
appBar: AppBar(
centerTitle: false,
titleSpacing: 0,
title: Text(
'播放设置',
style: Theme.of(context).textTheme.titleMedium,
),
),
appBar: AppBar(title: const Text('播放设置')),
body: ListView(
children: [
ListTile(

View File

@ -32,14 +32,7 @@ class _PrivacySettingState extends State<PrivacySetting> {
.labelMedium!
.copyWith(color: Theme.of(context).colorScheme.outline);
return Scaffold(
appBar: AppBar(
centerTitle: false,
titleSpacing: 0,
title: Text(
'隐私设置',
style: Theme.of(context).textTheme.titleMedium,
),
),
appBar: AppBar(title: const Text('隐私设置')),
body: Column(
children: [
ListTile(

View File

@ -53,14 +53,7 @@ class _RecommendSettingState extends State<RecommendSetting> {
.labelMedium!
.copyWith(color: Theme.of(context).colorScheme.outline);
return Scaffold(
appBar: AppBar(
centerTitle: false,
titleSpacing: 0,
title: Text(
'推荐设置',
style: Theme.of(context).textTheme.titleMedium,
),
),
appBar: AppBar(title: const Text('推荐设置')),
body: ListView(
children: [
ListTile(

View File

@ -49,14 +49,7 @@ class _StyleSettingState extends State<StyleSetting> {
.labelMedium!
.copyWith(color: Theme.of(context).colorScheme.outline);
return Scaffold(
appBar: AppBar(
centerTitle: false,
titleSpacing: 0,
title: Text(
'外观设置',
style: Theme.of(context).textTheme.titleMedium,
),
),
appBar: AppBar(title: const Text('外观设置')),
body: ListView(
children: [
Obx(

View File

@ -9,14 +9,7 @@ class SettingPage extends StatelessWidget {
Widget build(BuildContext context) {
final SettingController settingController = Get.put(SettingController());
return Scaffold(
appBar: AppBar(
centerTitle: false,
titleSpacing: 0,
title: Text(
'设置',
style: Theme.of(context).textTheme.titleMedium,
),
),
appBar: AppBar(title: const Text('设置')),
body: Column(
children: [
ListTile(

View File

@ -40,12 +40,8 @@ class _SubPageState extends State<SubPage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
centerTitle: false,
titleSpacing: 0,
title: Obx(() => Text(
'${_subController.isOwner.value ? '' : 'Ta'}的订阅',
style: Theme.of(context).textTheme.titleMedium,
)),
title:
Obx(() => Text('${_subController.isOwner.value ? '' : 'Ta'}的订阅')),
),
body: FutureBuilder(
future: _futureBuilderFuture,

View File

@ -30,8 +30,6 @@ class _FavPanelState extends State<FavPanel> {
return Column(
children: [
AppBar(
centerTitle: false,
elevation: 0,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(
top: Radius.circular(20),

View File

@ -57,8 +57,6 @@ class _GroupPanelState extends State<GroupPanel> {
return Column(
children: <Widget>[
AppBar(
centerTitle: false,
elevation: 0,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(
top: Radius.circular(20),

View File

@ -156,7 +156,7 @@ class _PagesPanelState extends State<PagesPanel> {
children: <Widget>[
if (isCurrentIndex) ...<Widget>[
Image.asset(
'assets/images/live.gif',
'assets/images/live.png',
color: Theme.of(context).colorScheme.primary,
height: 12,
),

View File

@ -101,7 +101,7 @@ class _SeasonPanelState extends State<SeasonPanel> {
dense: false,
leading: isCurrentIndex
? Image.asset(
'assets/images/live.gif',
'assets/images/live.png',
color: primary,
height: 12,
)
@ -159,7 +159,7 @@ class _SeasonPanelState extends State<SeasonPanel> {
),
const SizedBox(width: 15),
Image.asset(
'assets/images/live.gif',
'assets/images/live.png',
color: Theme.of(context).colorScheme.primary,
height: 12,
),

View File

@ -132,4 +132,32 @@ class VideoReplyController extends GetxController {
queryReplyList(type: 'init');
});
}
// 移除评论
Future removeReply(int? rpid, int? frpid) async {
// 移除一楼评论
if (rpid != null) {
replyList.removeWhere((item) {
return item.rpid == rpid;
});
}
// 移除二楼评论
if (frpid != 0 && frpid != null) {
replyList.value = replyList.map((item) {
if (item.rpid! == frpid) {
item.replies!.removeWhere((reply) => reply.rpid == rpid);
// 【共xx条回复】
if (item.replyControl != null &&
item.replyControl!.entryTextNum! >= 1) {
item.replyControl!.entryTextNum =
item.replyControl!.entryTextNum! - 1;
item.rcount = item.replyControl!.entryTextNum;
}
return item;
} else {
return item;
}
}).toList();
}
}
}

View File

@ -242,10 +242,9 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
.replyList[index],
showReplyRow: true,
replyLevel: replyLevel,
replyReply: (replyItem, currentReply,
loadMore) =>
replyReply(replyItem, currentReply,
loadMore),
replyReply: replyReply,
onDelete:
_videoReplyController.removeReply,
replyType: ReplyType.video,
);
}

View File

@ -37,6 +37,7 @@ class ReplyItem extends StatelessWidget {
this.replyReply,
this.replyType,
this.replySave = false,
this.onDelete,
super.key,
});
final ReplyItemModel? replyItem;
@ -46,6 +47,7 @@ class ReplyItem extends StatelessWidget {
final Function? replyReply;
final ReplyType? replyType;
final bool replySave;
final Function(int? rpid, int? frpid)? onDelete;
@override
Widget build(BuildContext context) {
@ -75,6 +77,7 @@ class ReplyItem extends StatelessWidget {
item: replyItem,
mainFloor: true,
isOwner: isOwner,
onDelete: onDelete,
);
},
);
@ -275,6 +278,7 @@ class ReplyItem extends StatelessWidget {
// f_rpid: replyItem!.rpid,
replyItem: replyItem,
replyReply: replyReply,
onDelete: onDelete,
),
),
],
@ -371,15 +375,15 @@ class ReplyItemRow extends StatelessWidget {
super.key,
this.replies,
this.replyControl,
// this.f_rpid,
this.replyItem,
this.replyReply,
this.onDelete,
});
final List? replies;
ReplyControl? replyControl;
// int? f_rpid;
ReplyItemModel? replyItem;
Function? replyReply;
final Function(int? rpid, int? frpid)? onDelete;
@override
Widget build(BuildContext context) {
@ -410,12 +414,18 @@ class ReplyItemRow extends StatelessWidget {
},
onLongPress: () {
feedBack();
final bool isOwner = int.parse(replyItem!.member!.mid!) ==
(GlobalDataCache().userInfo?.mid ?? -1);
showModalBottomSheet(
context: context,
useRootNavigator: true,
isScrollControlled: true,
builder: (context) {
return MorePanel(item: replies![i]);
return MorePanel(
item: replies![i],
isOwner: isOwner,
onDelete: onDelete,
);
},
);
},
@ -493,7 +503,7 @@ class ReplyItemRow extends StatelessWidget {
if (replyControl!.upReply!)
const TextSpan(text: 'up主等人 '),
TextSpan(
text: replyControl!.entryText!,
text: '查看${replyControl!.entryTextNum}条回复',
style: TextStyle(
color: colorScheme.primary,
),
@ -1019,11 +1029,13 @@ class MorePanel extends StatelessWidget {
final dynamic item;
final bool mainFloor;
final bool isOwner;
final Function(int? rpid, int? frpid)? onDelete;
const MorePanel({
super.key,
required this.item,
this.mainFloor = false,
this.isOwner = false,
this.onDelete,
});
Future<dynamic> menuActionHandler(String type) async {
@ -1083,7 +1095,7 @@ class MorePanel extends StatelessWidget {
rpid: item.rpid!,
);
if (result['status']) {
SmartDialog.showToast('评论删除成功,需手动刷新');
onDelete?.call(item.rpid!, item.root);
Get.back();
} else {
SmartDialog.showToast(result['msg']);

View File

@ -84,6 +84,16 @@ class VideoReplyReplyController extends GetxController {
return res;
}
// 移除评论
Future removeReply(int? rpid, int? frpid) async {
// 移除一楼评论
if (rpid != null) {
replyList.removeWhere((item) {
return item.rpid == rpid;
});
}
}
@override
void onClose() {
currentPage = 0;

View File

@ -89,7 +89,6 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
return AppBar(
toolbarHeight: 45,
automaticallyImplyLeading: false,
centerTitle: false,
title: Text(
'评论详情',
style: Theme.of(context).textTheme.titleSmall,
@ -118,6 +117,7 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
},
replyType: widget.replyType,
replyReply: (replyItem) => replyReply(replyItem),
onDelete: _videoReplyReplyController.removeReply,
);
}

View File

@ -614,8 +614,6 @@ class _VideoDetailPageState extends State<VideoDetailPage>
builder: ((context, snapshot) {
return AppBar(
backgroundColor: Colors.black,
elevation: 0,
scrolledUnderElevation: 0,
);
}),
),
@ -861,12 +859,8 @@ class _VideoDetailPageState extends State<VideoDetailPage>
return AppBar(
backgroundColor: Colors.transparent, // 使背景透明
foregroundColor: Colors.white,
elevation: 0,
scrolledUnderElevation: 0,
primary: false,
centerTitle: false,
automaticallyImplyLeading: false,
titleSpacing: 0,
title: Container(
height: kToolbarHeight,
padding: const EdgeInsets.symmetric(horizontal: 14),

View File

@ -33,8 +33,6 @@ class ScrollAppBar extends StatelessWidget {
padding: EdgeInsets.only(top: statusBarHeight),
child: AppBar(
primary: false,
elevation: 0,
scrolledUnderElevation: 0,
centerTitle: true,
title: TextButton(
onPressed: () => callback(),

View File

@ -1155,10 +1155,7 @@ class _HeaderControlState extends State<HeaderControl> {
return AppBar(
backgroundColor: Colors.transparent,
foregroundColor: Colors.white,
elevation: 0,
scrolledUnderElevation: 0,
primary: false,
centerTitle: false,
automaticallyImplyLeading: false,
titleSpacing: 14,
title: Row(

View File

@ -85,7 +85,6 @@ class _MediaListPanelState extends State<MediaListPanel> {
AppBar(
toolbarHeight: 45,
automaticallyImplyLeading: false,
centerTitle: false,
title: Text(
widget.panelTitle ?? '稍后再看',
style: Theme.of(context).textTheme.titleSmall,

View File

@ -19,12 +19,7 @@ class _WebviewPageState extends State<WebviewPage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
centerTitle: false,
titleSpacing: 0,
title: Text(
_webviewController.pageTitle,
style: Theme.of(context).textTheme.titleMedium,
),
title: Text(_webviewController.pageTitle),
actions: [
const SizedBox(width: 4),
IconButton(

View File

@ -1,6 +1,5 @@
import 'package:easy_debounce/easy_throttle.dart';
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart';
import 'package:pilipala/common/constants.dart';
import 'package:pilipala/common/skeleton/skeleton.dart';
@ -45,9 +44,7 @@ class _WhisperPageState extends State<WhisperPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('消息'),
),
appBar: AppBar(title: const Text('消息')),
body: RefreshIndicator(
onRefresh: () async {
_whisperController.unread();