fix: null error

This commit is contained in:
guozhigq
2024-10-14 00:02:12 +08:00
parent 51ff684aaf
commit 0c993bceee
2 changed files with 5 additions and 4 deletions

View File

@ -282,9 +282,10 @@ class VideoStat extends StatelessWidget {
Widget build(BuildContext context) {
return Row(
children: [
StatView(view: videoItem.stat.view),
if (videoItem.stat.view != null) StatView(view: videoItem.stat.view),
const SizedBox(width: 8),
StatDanMu(danmu: videoItem.stat.danmu),
if (videoItem.stat.danmu != null)
StatDanMu(danmu: videoItem.stat.danmu),
if (videoItem is RecVideoItemModel) ...<Widget>[
crossAxisCount > 1 ? const Spacer() : const SizedBox(width: 8),
RichText(

View File

@ -228,7 +228,7 @@ class SessionItem extends StatelessWidget {
parameters: {
'talkerId': sessionItem.talkerId.toString(),
'name': sessionItem.accountInfo.name,
'face': sessionItem.accountInfo.face,
'face': sessionItem.accountInfo.face ?? '',
'mid': (sessionItem.accountInfo?.mid ?? 0).toString(),
'heroTag': heroTag,
},
@ -244,7 +244,7 @@ class SessionItem extends StatelessWidget {
width: 45,
height: 45,
type: 'avatar',
src: sessionItem.accountInfo.face,
src: sessionItem.accountInfo.face ?? '',
),
),
),