Commit 70689afb authored by 杜欣's avatar 杜欣

bug 处理

parent 0a4e2416
import 'dart:async';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
......@@ -83,7 +82,9 @@ class _MessagePageState extends BasePage<MessagePage> {
),
elevation: 0,
),
body: SmartRefresher(
body: Container(
color: ALColors.ColorFFFFFF,
child: SmartRefresher(
enablePullDown: false,
enablePullUp: true,
footer: CustomFooter(
......@@ -130,11 +131,17 @@ class _MessagePageState extends BasePage<MessagePage> {
),
controller: _refreshController,
onLoading: () => _onLoading(context),
child: Container(
color: ALColors.ColorFFFFFF,
child: SingleChildScrollView(
child: Column(
children: <Widget>[topCard(), getListView()])))));
child: CustomScrollView(
slivers: <Widget>[
SliverToBoxAdapter(
child: topCard(),
),
getListView()
],
)
),
)
);
}
Widget getListView() {
......@@ -144,13 +151,19 @@ class _MessagePageState extends BasePage<MessagePage> {
builder: (BuildContext context, data) {
var dataList = data?.data?.data;
if (dataList == null) {
return noData();
return SliverFillViewport(
delegate: SliverChildListDelegate([
Container()
])
);
}
return ListView.builder(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (c, i) => messageList(dataList[i]),
itemCount: dataList.length,
return SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
return messageList(dataList[index]);
},
childCount: dataList.length
),
);
});
}
......
......@@ -213,11 +213,16 @@ Widget messageList(Data list) {
'alpha://topic_detail?topic_id=${list.repliedContent.topicId}'
});
},
child: Image.network(
list.repliedContent.content,
child: Container(
width: ScreenUtil.instance.setWidth(48),
fit: BoxFit.fill,
))
height: ScreenUtil.instance.setHeight(48),
child: Image.network(
list.repliedContent.content != null ? list.repliedContent.content : 'http://alpha.iyanzhi.com/topic/2019/08/16/63ef62d019-w',
width: ScreenUtil.instance.setWidth(48),
height: ScreenUtil.instance.setHeight(48)
),
)
)
],
));
}
......
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