Commit 85ae7098 authored by 郑智刚's avatar 郑智刚

tesePage路由修改,同志街面增加loading和错误处理

parent 09da21c9
......@@ -123,6 +123,27 @@ class _AttentionPageState extends BasePage<AttentionPage> {
);
}
Widget loadingItem() {
return Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
CircularProgressIndicator(),
Padding(
padding: const EdgeInsets.all(10.0),
child: Text('加载中...'),
)
],
),
);
}
Widget errorItem(String reason) {
return Center(
child: Text("$reason"),
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
......@@ -145,6 +166,12 @@ class _AttentionPageState extends BasePage<AttentionPage> {
stream: _model.zzgLive.stream,
initialData: _model.zzgLive.data,
builder: (context, data) {
if (data.data == null) {
return loadingItem();
}
if (data.data.error != 0 || data.data.data == null) {
return errorItem(data.data.message);
}
noData = data.data.noData;
_noticeLists = data.data.data;
isPerformingRequest = false;
......
......@@ -46,12 +46,13 @@ class TestPage extends StatelessWidget {
}
testMessagePage(BuildContext context) {
return base(
return base(context, () {
Navigator.push(
context,
RouterCenterImpl()
.findNewMessageRouter()
?.getMessagePage(''),
"消息页面");
new CustomRoute(RouterCenterImpl()
.findNewMessageRouter()?.getMessagePage(''))
);
}, "消息页面");
}
testReportPage(BuildContext context) {
......@@ -94,10 +95,12 @@ class TestPage extends StatelessWidget {
}
attentionPage(BuildContext context) {
return base(
return base(context, () {
Navigator.push(
context,
RouterCenterImpl()
.findNewMessageRouter()?.getAttentionPage('message_home'),
"通知页面");
new CustomRoute(RouterCenterImpl()
.findNewMessageRouter()?.getAttentionPage('message_home'))
);
}, "通知页面");
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment