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

bug 处理

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