Commit 7b7e13e4 authored by 杜欣's avatar 杜欣

add message

parent d15d271d
......@@ -107,7 +107,9 @@ class _MessagePageState extends State<MessagePage> {
child: Column(
children: <Widget>[
topCard(),
StreamBuilder<MyMessageEntity>(
Container(
color: ALColors.ColorFFFFFF,
child: StreamBuilder<MyMessageEntity>(
stream: _messageModel.myMessageLive.stream,
initialData: _messageModel.myMessageLive.data ,
builder: (BuildContext context, data){
......@@ -122,24 +124,20 @@ class _MessagePageState extends State<MessagePage> {
print('++++++====================${dataList.length}=================');
return ListView.builder(
itemCount: dataList.length + 1,
itemExtent: 50,
itemBuilder: (BuildContext context, int index) {
print('============${index}++++++++${dataList.length}=============');
if (index == dataList.length) {
return _loadingView();
} else {
return Container(
color: ALColors.ColorFFFFFF,
child: Column(
children: <Widget>[
messageList(dataList[index])
],
),
);
return messageList(dataList[index]);
}
},
controller: _scrollController,
);
},
)
)
]
),
),
......@@ -147,7 +145,6 @@ class _MessagePageState extends State<MessagePage> {
);
}
topCard(){
return Container(
color: ALColors.ColorFFFFFF,
......
import 'package:common_utils/common_utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:gmalpha_flutter/commonModel/ui/ALColors.dart';
messageTitle(String text) {
return Text(
text,
......@@ -101,6 +103,7 @@ getNum([int count]) {
}
messageList(list) {
var contentText = {1: '评论了你', 2: '评论了你的评论', 3: '评论了你', 4: '评论了你的评论', 5: '关注了你的问题'};
return Container(
padding: EdgeInsets.only(left: width, right: width),
margin: EdgeInsets.only(bottom: ScreenUtil().setHeight(25)),
......@@ -118,7 +121,7 @@ messageList(list) {
decoration: BoxDecoration(
shape: BoxShape.circle,
image: DecorationImage(
image: NetworkImage('http://alpha-s.gmeiapp.com/2018/12/23/c909726bc2-w')
image: NetworkImage(list.icon)
),
),
),
......@@ -131,7 +134,7 @@ messageList(list) {
Row(
children: <Widget>[
Text(
'参白',
list.name,
style: TextStyle(
color: ALColors.Color323232,
fontSize: ScreenUtil().setSp(13),
......@@ -140,7 +143,7 @@ messageList(list) {
),
SizedBox(width: ScreenUtil().setWidth(10)),
Text(
'评论了你',
contentText[list.repliedContent?.type],
style: TextStyle(
color: ALColors.Color323232,
fontSize: ScreenUtil().setSp(13)
......@@ -149,7 +152,7 @@ messageList(list) {
],
),
Text(
'半框眼镜真的很搭配',
list.content,
style: TextStyle(
color: ALColors.Color323232,
fontSize: ScreenUtil().setSp(13)
......@@ -158,7 +161,11 @@ messageList(list) {
overflow: TextOverflow.ellipsis
),
Text(
'12小时',
// TimelineUtil.format(list.time,
// locTimeMillis: DateTime.now().millisecondsSinceEpoch,
// locale: 'zh',
// dayFormat: DayFormat.Full),
list.time.toString(),
style: TextStyle(
color: Color(0xfff8e8e8e),
fontSize: ScreenUtil().setSp(10)
......@@ -170,7 +177,7 @@ messageList(list) {
],
),
Image.network(
'http://alpha-s.gmeiapp.com/2018/12/24/2b9fca0930-w',
list.repliedContent.content,
width: ScreenUtil().setWidth(48),
fit: BoxFit.fill,
)
......
......@@ -31,6 +31,7 @@ dependencies:
# gengmei_flutter_plugin: ^0.0.731
cached_network_image: ^1.1.1
flutter_screenutil: ^0.5.3
common_utils: ^1.1.3
gengmei_flutter_plugin:
git:
url: 'git@git.wanmeizhensuo.com:linshengyu/flutter_plugin.git'
......
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