mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-01 00:28:18 +08:00
opt up panel
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -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,53 +142,28 @@ 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}');
|
||||||
|
|
||||||
return SizedBox(
|
Widget avatar;
|
||||||
height: 76,
|
if (isAll) {
|
||||||
width: isTop ? 70 : null,
|
avatar = const CircleAvatar(
|
||||||
child: InkWell(
|
backgroundColor: Color(0xFF5CB67B),
|
||||||
onTap: () {
|
backgroundImage: AssetImage('assets/images/logo/logo.png'),
|
||||||
feedBack();
|
);
|
||||||
switch (data) {
|
} else {
|
||||||
case LiveUserItem():
|
avatar = Stack(
|
||||||
PageUtils.toLiveRoom(data.roomId);
|
|
||||||
case UpItem():
|
|
||||||
_onSelect(data);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// onDoubleTap: isLive ? () => _onSelect(data) : null,
|
|
||||||
onLongPress: !isAll ? toMemberPage : null,
|
|
||||||
onSecondaryTap: !isAll && !Utils.isMobile ? toMemberPage : null,
|
|
||||||
child: AnimatedOpacity(
|
|
||||||
opacity: isCurrent ? 1 : 0.6,
|
|
||||||
duration: const Duration(milliseconds: 200),
|
|
||||||
curve: Curves.easeInOut,
|
|
||||||
child: Column(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Stack(
|
|
||||||
clipBehavior: Clip.none,
|
clipBehavior: Clip.none,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 4),
|
padding: const EdgeInsets.symmetric(horizontal: 4),
|
||||||
child: data.face != ''
|
child: NetworkImgLayer(
|
||||||
? NetworkImgLayer(
|
|
||||||
width: 38,
|
width: 38,
|
||||||
height: 38,
|
height: 38,
|
||||||
src: data.face,
|
src: data.face,
|
||||||
type: ImageType.avatar,
|
type: ImageType.avatar,
|
||||||
)
|
|
||||||
: const CircleAvatar(
|
|
||||||
backgroundColor: Color(0xFF5CB67B),
|
|
||||||
backgroundImage: AssetImage(
|
|
||||||
'assets/images/logo/logo.png',
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Positioned(
|
Positioned(
|
||||||
@@ -207,8 +183,32 @@ class _UpPanelState extends State<UpPanel> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
);
|
||||||
const SizedBox(height: 4),
|
}
|
||||||
|
|
||||||
|
return SizedBox(
|
||||||
|
height: 76,
|
||||||
|
width: isTop ? 70 : null,
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () {
|
||||||
|
feedBack();
|
||||||
|
if (isLive) {
|
||||||
|
PageUtils.toLiveRoom(data.roomId);
|
||||||
|
} else {
|
||||||
|
_onSelect(data);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// onDoubleTap: isLive ? () => _onSelect(data) : null,
|
||||||
|
onLongPress: !isAll ? toMemberPage : null,
|
||||||
|
onSecondaryTap: !isAll && !Utils.isMobile ? toMemberPage : null,
|
||||||
|
child: Opacity(
|
||||||
|
opacity: isCurrent ? 1 : 0.6,
|
||||||
|
child: Column(
|
||||||
|
spacing: 4,
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
avatar,
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 4),
|
padding: const EdgeInsets.symmetric(horizontal: 4),
|
||||||
child: Text(
|
child: Text(
|
||||||
|
|||||||
Reference in New Issue
Block a user