mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
mod: msg item
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:PiliPlus/common/widgets/badge.dart';
|
import 'package:PiliPlus/common/widgets/badge.dart';
|
||||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
import 'package:PiliPlus/common/widgets/pendant_avatar.dart';
|
||||||
import 'package:PiliPlus/grpc/bilibili/app/im/v1.pb.dart'
|
import 'package:PiliPlus/grpc/bilibili/app/im/v1.pb.dart'
|
||||||
show Session, UnreadStyle;
|
show Session, UnreadStyle;
|
||||||
import 'package:PiliPlus/models/common/badge_type.dart';
|
import 'package:PiliPlus/models/common/badge_type.dart';
|
||||||
@@ -31,7 +31,10 @@ class WhisperSessionItem extends StatelessWidget {
|
|||||||
: null;
|
: null;
|
||||||
final ThemeData theme = Theme.of(context);
|
final ThemeData theme = Theme.of(context);
|
||||||
return ListTile(
|
return ListTile(
|
||||||
tileColor: item.isPinned ? theme.colorScheme.onInverseSurface : null,
|
tileColor: item.isPinned
|
||||||
|
? theme.colorScheme.onInverseSurface
|
||||||
|
.withOpacity(Get.isDarkMode ? 0.4 : 0.8)
|
||||||
|
: null,
|
||||||
onLongPress: () {
|
onLongPress: () {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
@@ -89,13 +92,32 @@ class WhisperSessionItem extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
leading: Builder(
|
leading: Builder(
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
Widget buildAvatar() => NetworkImgLayer(
|
Widget buildAvatar() {
|
||||||
width: 45,
|
final pendant = item.sessionInfo.avatar.fallbackLayers.layers
|
||||||
height: 45,
|
.getOrNull(1)
|
||||||
type: 'avatar',
|
?.resource;
|
||||||
src: item.sessionInfo.avatar.fallbackLayers.layers.first
|
final offcial = item.sessionInfo.avatar.fallbackLayers.layers
|
||||||
.resource.resImage.imageSrc.remote.url,
|
.lastOrNull?.resource.resImage.imageSrc;
|
||||||
);
|
return PendantAvatar(
|
||||||
|
size: 42,
|
||||||
|
badgeSize: 14,
|
||||||
|
avatar: item.sessionInfo.avatar.fallbackLayers.layers.first
|
||||||
|
.resource.resImage.imageSrc.remote.url,
|
||||||
|
garbPendantImage:
|
||||||
|
pendant?.resImage.imageSrc.remote.hasUrl() == true
|
||||||
|
? pendant!.resImage.imageSrc.remote.url
|
||||||
|
: pendant?.resAnimation.webpSrc.remote.url,
|
||||||
|
isVip: vipInfo?['status'] != null && vipInfo!['status'] > 0,
|
||||||
|
officialType: offcial?.hasLocalValue() == true
|
||||||
|
? switch (offcial!.localValue) {
|
||||||
|
3 => 0,
|
||||||
|
4 => 1,
|
||||||
|
_ => null,
|
||||||
|
}
|
||||||
|
: null,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: item.sessionInfo.avatar.hasMid()
|
onTap: item.sessionInfo.avatar.hasMid()
|
||||||
? () {
|
? () {
|
||||||
@@ -122,6 +144,7 @@ class WhisperSessionItem extends StatelessWidget {
|
|||||||
Text(
|
Text(
|
||||||
item.sessionInfo.sessionName,
|
item.sessionInfo.sessionName,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
|
fontSize: 15,
|
||||||
color: vipInfo?['status'] != null &&
|
color: vipInfo?['status'] != null &&
|
||||||
vipInfo!['status'] > 0 &&
|
vipInfo!['status'] > 0 &&
|
||||||
vipInfo['type'] == 2
|
vipInfo['type'] == 2
|
||||||
|
|||||||
Reference in New Issue
Block a user