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
1ca8ceec
Commit
1ca8ceec
authored
Oct 17, 2019
by
郑智刚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
消息模块 通知裂变滚动
parent
53e588eb
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
19 deletions
+19
-19
AttentionListItem.dart
lib/NewMessageModel/page/AttentionListItem.dart
+8
-7
AttentionModel.dart
lib/NewMessageModel/page/AttentionModel.dart
+11
-12
AttentionPage.dart
lib/NewMessageModel/page/AttentionPage.dart
+0
-0
No files found.
lib/NewMessageModel/page/AttentionListItem.dart
View file @
1ca8ceec
import
'package:flutter/material.dart'
;
import
'package:flutter_screenutil/flutter_screenutil.dart'
;
import
'package:gmalpha_flutter/NewMessageModel/service/remote/entity/AttentionEntity.dart'
;
import
'package:gmalpha_flutter/NewMessageModel/util/message_date.dart'
;
import
'package:gmalpha_flutter/res/value/ALColors.dart'
;
...
...
@@ -19,7 +20,7 @@ class AttentionListItem extends StatelessWidget {
maxLines:
maxLines
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
fontSize:
size
,
fontSize:
ScreenUtil
().
setSp
(
size
)
,
color:
color
,
height:
1.38
,
fontWeight:
weight
?
FontWeight
.
bold
:
FontWeight
.
normal
...
...
@@ -29,7 +30,7 @@ class AttentionListItem extends StatelessWidget {
Widget
listItemHead
()
{
return
Container
(
margin:
const
EdgeInsets
.
only
(
right:
10.0
),
margin:
EdgeInsets
.
only
(
right:
ScreenUtil
().
setWidth
(
10
)
),
child:
CircleAvatar
(
radius:
21.0
,
backgroundImage:
NetworkImage
(
item
.
icon
),
...
...
@@ -46,11 +47,11 @@ class AttentionListItem extends StatelessWidget {
child:
myText
(
'
${item.title}
'
,
ALColors
.
Color464646
,
13.0
,
weight:
true
),
),
Padding
(
padding:
const
EdgeInsets
.
only
(
top:
4.0
),
padding:
EdgeInsets
.
only
(
top:
ScreenUtil
().
setHeight
(
4
)
),
child:
myText
(
'
${item.content}
'
,
ALColors
.
Color666666
,
13.0
,
maxLines:
2
),
),
Padding
(
padding:
const
EdgeInsets
.
only
(
top:
3.0
),
padding:
EdgeInsets
.
only
(
top:
ScreenUtil
().
setHeight
(
3
)
),
child:
myText
(
MessageDate
(
item
.
pushTime
).
diffTime
(),
ALColors
.
Color999999
,
10.0
)
)
],
...
...
@@ -60,9 +61,9 @@ class AttentionListItem extends StatelessWidget {
Widget
listItemButton
()
{
return
Container
(
padding:
const
EdgeInsets
.
only
(
top:
5.0
,
left:
12.0
),
width:
66.0
,
height:
34.0
,
padding:
EdgeInsets
.
only
(
top:
ScreenUtil
().
setHeight
(
5
),
left:
ScreenUtil
().
setWidth
(
12
)
),
width:
ScreenUtil
().
setWidth
(
66
)
,
height:
ScreenUtil
().
setHeight
(
34
)
,
child:
OutlineButton
(
padding:
const
EdgeInsets
.
only
(
left:
0.0
,
right:
0.0
,),
borderSide:
BorderSide
(
...
...
lib/NewMessageModel/page/AttentionModel.dart
View file @
1ca8ceec
...
...
@@ -5,8 +5,13 @@ import 'package:gmalpha_flutter/commonModel/live/BaseModel.dart';
import
'package:gmalpha_flutter/commonModel/live/LiveData.dart'
;
import
'package:gmalpha_flutter/commonModel/toast/toast.dart'
;
enum
DataStatus
{
DATA
,
NODATA
}
class
AttentionModel
extends
BaseModel
{
LiveData
<
AttentionEntity
>
zzg
Live
=
new
LiveData
();
LiveData
<
AttentionEntity
>
attentive
Live
=
new
LiveData
();
List
<
Data
>
_newList
=
[];
int
page
;
...
...
@@ -16,24 +21,18 @@ class AttentionModel extends BaseModel {
AttentionModel
(
this
.
page
,
this
.
fromPage
);
init
(
BuildContext
context
,
{
Function
callback
})
{
// 初始化或者刷新的时候增加一项无用项,用来渲染列表title
if
(
page
==
1
)
{
Data
firstData
=
Data
();
_newList
.
add
(
firstData
);
}
DataStatus
loadStatus
=
DataStatus
.
DATA
;
MessageRepository
.
getInstance
().
getAttentionList
(
page
,
count
).
listen
((
value
)
{
if
(
value
!=
null
)
{
// 增加一个字段,用来判断是否还有数据
if
(
value
.
data
.
length
==
0
)
{
value
.
noData
=
true
;
}
else
{
value
.
noData
=
false
;
loadStatus
=
DataStatus
.
NODATA
;
}
_newList
.
addAll
(
value
.
data
);
value
.
data
=
_newList
;
zzg
Live
.
notifyView
(
value
);
attentive
Live
.
notifyView
(
value
);
if
(
callback
is
Function
)
{
callback
();
callback
(
loadStatus
);
}
}
}).
onError
((
error
)
{
...
...
@@ -55,6 +54,6 @@ class AttentionModel extends BaseModel {
@override
void
dispose
()
{
zzg
Live
.
dispost
();
attentive
Live
.
dispost
();
}
}
lib/NewMessageModel/page/AttentionPage.dart
View file @
1ca8ceec
This diff is collapsed.
Click to expand it.
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