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

View File

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