fix: dynamic push & style

This commit is contained in:
guozhigq
2024-12-03 23:07:44 +08:00
parent 7e8f7cf68e
commit 5693c9beda
3 changed files with 38 additions and 29 deletions

View File

@ -117,20 +117,23 @@ class DynamicsController extends GetxController {
/// 点击评论action 直接查看评论 /// 点击评论action 直接查看评论
if (action == 'comment') { if (action == 'comment') {
Get.toNamed('/dynamicDetail', Get.toNamed('/dynamicDetail',
arguments: {'item': item, 'floor': floor, 'action': action}); arguments: {'item': item, 'floor': floor, 'action': action},
preventDuplicates: false);
return false; return false;
} }
switch (item!.type) { switch (item!.type) {
/// 转发的动态 /// 转发的动态
case 'DYNAMIC_TYPE_FORWARD': case 'DYNAMIC_TYPE_FORWARD':
Get.toNamed('/dynamicDetail', Get.toNamed('/dynamicDetail',
arguments: {'item': item, 'floor': floor}); arguments: {'item': item, 'floor': floor},
preventDuplicates: false);
break; break;
/// 图文动态查看 /// 图文动态查看
case 'DYNAMIC_TYPE_DRAW': case 'DYNAMIC_TYPE_DRAW':
Get.toNamed('/dynamicDetail', Get.toNamed('/dynamicDetail',
arguments: {'item': item, 'floor': floor}); arguments: {'item': item, 'floor': floor},
preventDuplicates: false);
break; break;
case 'DYNAMIC_TYPE_AV': case 'DYNAMIC_TYPE_AV':
String bvid = item.modules.moduleDynamic.major.archive.bvid; String bvid = item.modules.moduleDynamic.major.archive.bvid;
@ -188,7 +191,8 @@ class DynamicsController extends GetxController {
case 'DYNAMIC_TYPE_WORD': case 'DYNAMIC_TYPE_WORD':
print('纯文本'); print('纯文本');
Get.toNamed('/dynamicDetail', Get.toNamed('/dynamicDetail',
arguments: {'item': item, 'floor': floor}); arguments: {'item': item, 'floor': floor},
preventDuplicates: false);
break; break;
case 'DYNAMIC_TYPE_LIVE_RCMD': case 'DYNAMIC_TYPE_LIVE_RCMD':
DynamicLiveModel liveRcmd = item.modules.moduleDynamic.major.liveRcmd; DynamicLiveModel liveRcmd = item.modules.moduleDynamic.major.liveRcmd;

View File

@ -1,3 +1,5 @@
import 'dart:ui';
import 'package:easy_debounce/easy_throttle.dart'; import 'package:easy_debounce/easy_throttle.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -61,6 +63,7 @@ class _OverlayPanelState extends State<OverlayPanel>
void onClickUp(data, i, {type = 'click'}) { void onClickUp(data, i, {type = 'click'}) {
if (type == 'click') { if (type == 'click') {
data.hasUpdate = false;
pageController.jumpToPage(i); pageController.jumpToPage(i);
} }
} }
@ -81,11 +84,11 @@ class _OverlayPanelState extends State<OverlayPanel>
color: Colors.transparent, color: Colors.transparent,
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
), ),
child: Column( child: BackdropFilter(
children: [ filter: ImageFilter.blur(sigmaX: 8.0, sigmaY: 8.0),
SizedBox( child: Column(
height: 50, children: [
child: TabBar( TabBar(
controller: _tabController, controller: _tabController,
dividerColor: Colors.transparent, dividerColor: Colors.transparent,
automaticIndicatorColorAdjustment: false, automaticIndicatorColorAdjustment: false,
@ -106,25 +109,26 @@ class _OverlayPanelState extends State<OverlayPanel>
}); });
}, },
), ),
), Expanded(
Expanded( child: PageView.builder(
child: PageView.builder( itemCount: upList.length,
itemCount: upList.length, controller: pageController,
controller: pageController, itemBuilder: (BuildContext context, int index) {
itemBuilder: (BuildContext context, int index) { return Container(
return Container( clipBehavior: Clip.antiAlias,
clipBehavior: Clip.antiAlias, margin: const EdgeInsets.fromLTRB(10, 12, 10, 0),
margin: const EdgeInsets.fromLTRB(10, 12, 10, 0), decoration: BoxDecoration(
decoration: BoxDecoration( color: Theme.of(context).colorScheme.surface,
color: Theme.of(context).colorScheme.surface, borderRadius: BorderRadius.circular(20),
borderRadius: BorderRadius.circular(20), ),
), child:
child: UpDyanmicsPage(upInfo: upList[index], ctr: widget.ctr), UpDyanmicsPage(upInfo: upList[index], ctr: widget.ctr),
); );
}, },
),
), ),
), ],
], ),
), ),
); );
} }
@ -139,8 +143,8 @@ class _OverlayPanelState extends State<OverlayPanel>
duration: const Duration(milliseconds: 200), duration: const Duration(milliseconds: 200),
scale: currentMid == data.mid ? 1 : 0.9, scale: currentMid == data.mid ? 1 : 0.9,
child: NetworkImgLayer( child: NetworkImgLayer(
width: contentWidth, width: 46,
height: contentWidth, height: 46,
src: data.face, src: data.face,
type: 'avatar', type: 'avatar',
), ),

View File

@ -44,6 +44,7 @@ class _UpPanelState extends State<UpPanel> {
void onClickUp(data, i) { void onClickUp(data, i) {
currentMid.value = data.mid; currentMid.value = data.mid;
data.hasUpdate = false;
Navigator.push( Navigator.push(
context, context,
PlPopupRoute( PlPopupRoute(