diff --git a/lib/pages/dynamics/view.dart b/lib/pages/dynamics/view.dart index bf25c7a9..897a00db 100644 --- a/lib/pages/dynamics/view.dart +++ b/lib/pages/dynamics/view.dart @@ -287,7 +287,7 @@ class _CreatePanelState extends State { } } dynamic result = await MsgHttp.createDynamic( - mid: GStorage.userInfo.get('userInfoCache').mid, + mid: GStorage.userInfo.get('userInfoCache')?.mid, rawText: _ctr.text, pics: pics, publishTime: _publishTime != null diff --git a/lib/pages/dynamics/widgets/action_panel.dart b/lib/pages/dynamics/widgets/action_panel.dart index 82cfc6ed..348f9109 100644 --- a/lib/pages/dynamics/widgets/action_panel.dart +++ b/lib/pages/dynamics/widgets/action_panel.dart @@ -196,7 +196,7 @@ class _RepostPanelState extends State { Future _onRepost() async { dynamic result = await MsgHttp.createDynamic( - mid: GStorage.userInfo.get('userInfoCache').mid, + mid: GStorage.userInfo.get('userInfoCache')?.mid, dynIdStr: widget.item.idStr, rawText: _ctr.text, ); diff --git a/lib/pages/dynamics/widgets/author_panel.dart b/lib/pages/dynamics/widgets/author_panel.dart index 986c27b8..aa778c13 100644 --- a/lib/pages/dynamics/widgets/author_panel.dart +++ b/lib/pages/dynamics/widgets/author_panel.dart @@ -232,7 +232,7 @@ class MorePanel extends StatelessWidget { minLeadingWidth: 0, ), if (item.modules.moduleAuthor.mid == - GStorage.userInfo.get('userInfoCache').mid) + GStorage.userInfo.get('userInfoCache')?.mid) ListTile( onTap: () async { Get.back(); diff --git a/lib/pages/dynamics/widgets/author_panel_grpc.dart b/lib/pages/dynamics/widgets/author_panel_grpc.dart index 72977024..1cac623b 100644 --- a/lib/pages/dynamics/widgets/author_panel_grpc.dart +++ b/lib/pages/dynamics/widgets/author_panel_grpc.dart @@ -232,7 +232,7 @@ class MorePanel extends StatelessWidget { minLeadingWidth: 0, ), if (item.modules.moduleAuthor.mid == - GStorage.userInfo.get('userInfoCache').mid) + GStorage.userInfo.get('userInfoCache')?.mid) ListTile( onTap: () async { Get.back(); diff --git a/lib/pages/media/controller.dart b/lib/pages/media/controller.dart index ec515023..1b6fe554 100644 --- a/lib/pages/media/controller.dart +++ b/lib/pages/media/controller.dart @@ -71,6 +71,6 @@ class MediaController extends CommonController { Future customGetData() => UserHttp.userfavFolder( pn: 1, ps: 5, - mid: mid ?? GStorage.userInfo.get('userInfoCache').mid, + mid: mid ?? GStorage.userInfo.get('userInfoCache')?.mid, ); } diff --git a/lib/pages/whisper_detail/widget/chat_item.dart b/lib/pages/whisper_detail/widget/chat_item.dart index 4fda3c99..bdc7245c 100644 --- a/lib/pages/whisper_detail/widget/chat_item.dart +++ b/lib/pages/whisper_detail/widget/chat_item.dart @@ -51,7 +51,8 @@ class ChatItem extends StatelessWidget { @override Widget build(BuildContext context) { - bool isOwner = item.senderUid == GStorage.userInfo.get('userInfoCache').mid; + bool isOwner = + item.senderUid == GStorage.userInfo.get('userInfoCache')?.mid; bool isPic = item.msgType == MsgType.pic.value; // 图片 bool isText = item.msgType == MsgType.text.value; // 文本