Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
gmalpha_flutter
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile
gmalpha_flutter
Commits
7b7e13e4
Commit
7b7e13e4
authored
Oct 15, 2019
by
杜欣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add message
parent
d15d271d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
38 deletions
+43
-38
MessagePage.dart
lib/NewMessageModel/page/MessagePage.dart
+29
-32
common.dart
lib/NewMessageModel/page/common.dart
+13
-6
pubspec.yaml
pubspec.yaml
+1
-0
No files found.
lib/NewMessageModel/page/MessagePage.dart
View file @
7b7e13e4
...
@@ -107,38 +107,36 @@ class _MessagePageState extends State<MessagePage> {
...
@@ -107,38 +107,36 @@ class _MessagePageState extends State<MessagePage> {
child:
Column
(
child:
Column
(
children:
<
Widget
>[
children:
<
Widget
>[
topCard
(),
topCard
(),
StreamBuilder
<
MyMessageEntity
>(
Container
(
stream:
_messageModel
.
myMessageLive
.
stream
,
color:
ALColors
.
ColorFFFFFF
,
initialData:
_messageModel
.
myMessageLive
.
data
,
child:
StreamBuilder
<
MyMessageEntity
>(
builder:
(
BuildContext
context
,
data
){
stream:
_messageModel
.
myMessageLive
.
stream
,
var
dataList
=
data
.
data
?.
data
;
initialData:
_messageModel
.
myMessageLive
.
data
,
if
(
dataList
==
null
)
{
builder:
(
BuildContext
context
,
data
){
return
Container
(
var
dataList
=
data
.
data
?.
data
;
color:
ALColors
.
ColorFFFFFF
,
if
(
dataList
==
null
)
{
height:
ScreenUtil
().
setHeight
(
430
),
return
Container
(
child:
Center
(
child:
Text
(
'暂无相关内容'
,
style:
TextStyle
(
color:
ALColors
.
Color999999
,
fontSize:
ScreenUtil
().
setSp
(
16
))))
color:
ALColors
.
ColorFFFFFF
,
height:
ScreenUtil
().
setHeight
(
430
),
child:
Center
(
child:
Text
(
'暂无相关内容'
,
style:
TextStyle
(
color:
ALColors
.
Color999999
,
fontSize:
ScreenUtil
().
setSp
(
16
))))
);
}
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
messageList
(
dataList
[
index
]);
}
},
controller:
_scrollController
,
);
);
}
},
print
(
'++++++====================
${dataList.length}
================='
);
)
return
ListView
.
builder
(
itemCount:
dataList
.
length
+
1
,
itemBuilder:
(
BuildContext
context
,
int
index
)
{
if
(
index
==
dataList
.
length
)
{
return
_loadingView
();
}
else
{
return
Container
(
color:
ALColors
.
ColorFFFFFF
,
child:
Column
(
children:
<
Widget
>[
messageList
(
dataList
[
index
])
],
),
);
}
},
controller:
_scrollController
,
);
},
)
)
]
]
),
),
...
@@ -147,7 +145,6 @@ class _MessagePageState extends State<MessagePage> {
...
@@ -147,7 +145,6 @@ class _MessagePageState extends State<MessagePage> {
);
);
}
}
topCard
(){
topCard
(){
return
Container
(
return
Container
(
color:
ALColors
.
ColorFFFFFF
,
color:
ALColors
.
ColorFFFFFF
,
...
...
lib/NewMessageModel/page/common.dart
View file @
7b7e13e4
import
'package:common_utils/common_utils.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter_screenutil/flutter_screenutil.dart'
;
import
'package:flutter_screenutil/flutter_screenutil.dart'
;
import
'package:gmalpha_flutter/commonModel/ui/ALColors.dart'
;
import
'package:gmalpha_flutter/commonModel/ui/ALColors.dart'
;
messageTitle
(
String
text
)
{
messageTitle
(
String
text
)
{
return
Text
(
return
Text
(
text
,
text
,
...
@@ -101,6 +103,7 @@ getNum([int count]) {
...
@@ -101,6 +103,7 @@ getNum([int count]) {
}
}
messageList
(
list
)
{
messageList
(
list
)
{
var
contentText
=
{
1
:
'评论了你'
,
2
:
'评论了你的评论'
,
3
:
'评论了你'
,
4
:
'评论了你的评论'
,
5
:
'关注了你的问题'
};
return
Container
(
return
Container
(
padding:
EdgeInsets
.
only
(
left:
width
,
right:
width
),
padding:
EdgeInsets
.
only
(
left:
width
,
right:
width
),
margin:
EdgeInsets
.
only
(
bottom:
ScreenUtil
().
setHeight
(
25
)),
margin:
EdgeInsets
.
only
(
bottom:
ScreenUtil
().
setHeight
(
25
)),
...
@@ -118,7 +121,7 @@ messageList(list) {
...
@@ -118,7 +121,7 @@ messageList(list) {
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
shape:
BoxShape
.
circle
,
shape:
BoxShape
.
circle
,
image:
DecorationImage
(
image:
DecorationImage
(
image:
NetworkImage
(
'http://alpha-s.gmeiapp.com/2018/12/23/c909726bc2-w'
)
image:
NetworkImage
(
list
.
icon
)
),
),
),
),
),
),
...
@@ -131,7 +134,7 @@ messageList(list) {
...
@@ -131,7 +134,7 @@ messageList(list) {
Row
(
Row
(
children:
<
Widget
>[
children:
<
Widget
>[
Text
(
Text
(
'参白'
,
list
.
name
,
style:
TextStyle
(
style:
TextStyle
(
color:
ALColors
.
Color323232
,
color:
ALColors
.
Color323232
,
fontSize:
ScreenUtil
().
setSp
(
13
),
fontSize:
ScreenUtil
().
setSp
(
13
),
...
@@ -140,7 +143,7 @@ messageList(list) {
...
@@ -140,7 +143,7 @@ messageList(list) {
),
),
SizedBox
(
width:
ScreenUtil
().
setWidth
(
10
)),
SizedBox
(
width:
ScreenUtil
().
setWidth
(
10
)),
Text
(
Text
(
'评论了你'
,
contentText
[
list
.
repliedContent
?.
type
]
,
style:
TextStyle
(
style:
TextStyle
(
color:
ALColors
.
Color323232
,
color:
ALColors
.
Color323232
,
fontSize:
ScreenUtil
().
setSp
(
13
)
fontSize:
ScreenUtil
().
setSp
(
13
)
...
@@ -149,7 +152,7 @@ messageList(list) {
...
@@ -149,7 +152,7 @@ messageList(list) {
],
],
),
),
Text
(
Text
(
'半框眼镜真的很搭配'
,
list
.
content
,
style:
TextStyle
(
style:
TextStyle
(
color:
ALColors
.
Color323232
,
color:
ALColors
.
Color323232
,
fontSize:
ScreenUtil
().
setSp
(
13
)
fontSize:
ScreenUtil
().
setSp
(
13
)
...
@@ -158,7 +161,11 @@ messageList(list) {
...
@@ -158,7 +161,11 @@ messageList(list) {
overflow:
TextOverflow
.
ellipsis
overflow:
TextOverflow
.
ellipsis
),
),
Text
(
Text
(
'12小时'
,
// TimelineUtil.format(list.time,
// locTimeMillis: DateTime.now().millisecondsSinceEpoch,
// locale: 'zh',
// dayFormat: DayFormat.Full),
list
.
time
.
toString
(),
style:
TextStyle
(
style:
TextStyle
(
color:
Color
(
0xfff8e8e8e
),
color:
Color
(
0xfff8e8e8e
),
fontSize:
ScreenUtil
().
setSp
(
10
)
fontSize:
ScreenUtil
().
setSp
(
10
)
...
@@ -170,7 +177,7 @@ messageList(list) {
...
@@ -170,7 +177,7 @@ messageList(list) {
],
],
),
),
Image
.
network
(
Image
.
network
(
'http://alpha-s.gmeiapp.com/2018/12/24/2b9fca0930-w'
,
list
.
repliedContent
.
content
,
width:
ScreenUtil
().
setWidth
(
48
),
width:
ScreenUtil
().
setWidth
(
48
),
fit:
BoxFit
.
fill
,
fit:
BoxFit
.
fill
,
)
)
...
...
pubspec.yaml
View file @
7b7e13e4
...
@@ -31,6 +31,7 @@ dependencies:
...
@@ -31,6 +31,7 @@ dependencies:
# gengmei_flutter_plugin: ^0.0.731
# gengmei_flutter_plugin: ^0.0.731
cached_network_image
:
^1.1.1
cached_network_image
:
^1.1.1
flutter_screenutil
:
^0.5.3
flutter_screenutil
:
^0.5.3
common_utils
:
^1.1.3
gengmei_flutter_plugin
:
gengmei_flutter_plugin
:
git
:
git
:
url
:
'
git@git.wanmeizhensuo.com:linshengyu/flutter_plugin.git'
url
:
'
git@git.wanmeizhensuo.com:linshengyu/flutter_plugin.git'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment