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