opt up panel

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-12-03 21:47:12 +08:00
parent c42468e2c8
commit 2785248615

View File

@@ -16,6 +16,7 @@ class UpPanel extends StatefulWidget {
required this.dynamicsController, required this.dynamicsController,
super.key, super.key,
}); });
final DynamicsController dynamicsController; final DynamicsController dynamicsController;
@override @override
@@ -141,74 +142,73 @@ class _UpPanelState extends State<UpPanel> {
Widget upItemBuild(ThemeData theme, UpItem data) { Widget upItemBuild(ThemeData theme, UpItem data) {
final currentMid = controller.currentMid; final currentMid = controller.currentMid;
final isLive = data is LiveUserItem; final isLive = data is LiveUserItem;
bool isCurrent = isLive || currentMid == data.mid || currentMid == -1; final isCurrent = isLive || currentMid == data.mid || currentMid == -1;
final isAll = data.mid == -1; final isAll = data.mid == -1;
void toMemberPage() => Get.toNamed('/member?mid=${data.mid}'); void toMemberPage() => Get.toNamed('/member?mid=${data.mid}');
Widget avatar;
if (isAll) {
avatar = const CircleAvatar(
backgroundColor: Color(0xFF5CB67B),
backgroundImage: AssetImage('assets/images/logo/logo.png'),
);
} else {
avatar = Stack(
clipBehavior: Clip.none,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 4),
child: NetworkImgLayer(
width: 38,
height: 38,
src: data.face,
type: ImageType.avatar,
),
),
Positioned(
top: isLive && !isTop ? -5 : 0,
right: isLive ? -6 : 4,
child: Badge(
smallSize: 8,
label: isLive ? const Text(' Live ') : null,
textColor: theme.colorScheme.onSecondaryContainer,
alignment: AlignmentDirectional.topStart,
isLabelVisible: isLive || (data.hasUpdate ?? false),
backgroundColor: isLive
? theme.colorScheme.secondaryContainer.withValues(
alpha: 0.75,
)
: theme.colorScheme.primary,
),
),
],
);
}
return SizedBox( return SizedBox(
height: 76, height: 76,
width: isTop ? 70 : null, width: isTop ? 70 : null,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
feedBack(); feedBack();
switch (data) { if (isLive) {
case LiveUserItem(): PageUtils.toLiveRoom(data.roomId);
PageUtils.toLiveRoom(data.roomId); } else {
case UpItem(): _onSelect(data);
_onSelect(data);
break;
} }
}, },
// onDoubleTap: isLive ? () => _onSelect(data) : null, // onDoubleTap: isLive ? () => _onSelect(data) : null,
onLongPress: !isAll ? toMemberPage : null, onLongPress: !isAll ? toMemberPage : null,
onSecondaryTap: !isAll && !Utils.isMobile ? toMemberPage : null, onSecondaryTap: !isAll && !Utils.isMobile ? toMemberPage : null,
child: AnimatedOpacity( child: Opacity(
opacity: isCurrent ? 1 : 0.6, opacity: isCurrent ? 1 : 0.6,
duration: const Duration(milliseconds: 200),
curve: Curves.easeInOut,
child: Column( child: Column(
spacing: 4,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Stack( avatar,
clipBehavior: Clip.none,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 4),
child: data.face != ''
? NetworkImgLayer(
width: 38,
height: 38,
src: data.face,
type: ImageType.avatar,
)
: const CircleAvatar(
backgroundColor: Color(0xFF5CB67B),
backgroundImage: AssetImage(
'assets/images/logo/logo.png',
),
),
),
Positioned(
top: isLive && !isTop ? -5 : 0,
right: isLive ? -6 : 4,
child: Badge(
smallSize: 8,
label: isLive ? const Text(' Live ') : null,
textColor: theme.colorScheme.onSecondaryContainer,
alignment: AlignmentDirectional.topStart,
isLabelVisible: isLive || (data.hasUpdate ?? false),
backgroundColor: isLive
? theme.colorScheme.secondaryContainer.withValues(
alpha: 0.75,
)
: theme.colorScheme.primary,
),
),
],
),
const SizedBox(height: 4),
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 4), padding: const EdgeInsets.symmetric(horizontal: 4),
child: Text( child: Text(