fix: reply model null error
This commit is contained in:
@ -73,7 +73,7 @@ class ReplyCursor {
|
||||
isEnd = json['is_end'];
|
||||
mode = json['mode'];
|
||||
modeText = json['mode_text'];
|
||||
allCount = json['all_count'];
|
||||
allCount = json['all_count'] ?? 0;
|
||||
supportMode = json['support_mode'].cast<int>();
|
||||
name = json['name'];
|
||||
paginationReply = json['pagination_reply'] != null
|
||||
|
@ -31,7 +31,7 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
||||
with TickerProviderStateMixin {
|
||||
late DynamicDetailController _dynamicDetailController;
|
||||
late AnimationController fabAnimationCtr;
|
||||
Future? _futureBuilderFuture;
|
||||
late Future _futureBuilderFuture;
|
||||
late StreamController<bool> titleStreamC =
|
||||
StreamController<bool>.broadcast(); // appBar title
|
||||
late ScrollController scrollController;
|
||||
@ -278,8 +278,8 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
||||
future: _futureBuilderFuture,
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.done) {
|
||||
Map data = snapshot.data as Map;
|
||||
if (snapshot.data['status']) {
|
||||
Map? data = snapshot.data;
|
||||
if (data != null && snapshot.data['status']) {
|
||||
RxList<ReplyItemModel> replyList =
|
||||
_dynamicDetailController.replyList;
|
||||
// 请求成功
|
||||
@ -345,8 +345,11 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
||||
} else {
|
||||
// 请求错误
|
||||
return HttpError(
|
||||
errMsg: data['msg'],
|
||||
fn: () => setState(() {}),
|
||||
errMsg: data?['msg'] ?? '请求异常',
|
||||
fn: () => setState(() {
|
||||
_futureBuilderFuture =
|
||||
_dynamicDetailController.queryReplyList();
|
||||
}),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user