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
9067fe86
Commit
9067fe86
authored
Oct 17, 2019
by
杜欣
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
814f5430
53e588eb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
71 additions
and
59 deletions
+71
-59
AttentionListItem.dart
lib/NewMessageModel/page/AttentionListItem.dart
+59
-52
AttentionPage.dart
lib/NewMessageModel/page/AttentionPage.dart
+10
-5
common.dart
lib/NewMessageModel/page/common.dart
+1
-1
message_date.dart
lib/NewMessageModel/util/message_date.dart
+1
-1
No files found.
lib/NewMessageModel/page/AttentionListItem.dart
View file @
9067fe86
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:gmalpha_flutter/NewMessageModel/service/remote/entity/AttentionEntity.dart'
;
import
'package:gmalpha_flutter/NewMessageModel/service/remote/entity/AttentionEntity.dart'
;
import
'package:gmalpha_flutter/NewMessageModel/
page
/message_date.dart'
;
import
'package:gmalpha_flutter/NewMessageModel/
util
/message_date.dart'
;
import
'package:gmalpha_flutter/res/value/ALColors.dart'
;
import
'package:gmalpha_flutter/res/value/ALColors.dart'
;
class
AttentionListItem
extends
StatelessWidget
{
class
AttentionListItem
extends
StatelessWidget
{
...
@@ -27,59 +27,66 @@ class AttentionListItem extends StatelessWidget {
...
@@ -27,59 +27,66 @@ class AttentionListItem extends StatelessWidget {
);
);
}
}
Widget
listItemHead
()
{
return
Container
(
margin:
const
EdgeInsets
.
only
(
right:
10.0
),
child:
CircleAvatar
(
radius:
21.0
,
backgroundImage:
NetworkImage
(
item
.
icon
),
),
);
}
Widget
listItemInfo
()
{
return
Expanded
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
<
Widget
>[
Container
(
child:
myText
(
'
${item.title}
'
,
ALColors
.
Color464646
,
13.0
,
weight:
true
),
),
Padding
(
padding:
const
EdgeInsets
.
only
(
top:
4.0
),
child:
myText
(
'
${item.content}
'
,
ALColors
.
Color666666
,
13.0
,
maxLines:
2
),
),
Padding
(
padding:
const
EdgeInsets
.
only
(
top:
3.0
),
child:
myText
(
MessageDate
(
item
.
pushTime
).
diffTime
(),
ALColors
.
Color999999
,
10.0
)
)
],
),
);
}
Widget
listItemButton
()
{
return
Container
(
padding:
const
EdgeInsets
.
only
(
top:
5.0
,
left:
12.0
),
width:
66.0
,
height:
34.0
,
child:
OutlineButton
(
padding:
const
EdgeInsets
.
only
(
left:
0.0
,
right:
0.0
,),
borderSide:
BorderSide
(
color:
ALColors
.
Color323232
),
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
zero
),
onPressed:
()
{
// todo 跳转到原生页面 详情页面
},
child:
myText
(
'详情'
,
ALColors
.
Color323232
,
13.0
)
),
);
}
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
SizedBox
(
return
Container
(
child:
Card
(
child:
Row
(
elevation:
0.0
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
child:
Row
(
children:
<
Widget
>[
crossAxisAlignment:
CrossAxisAlignment
.
start
,
listItemHead
(),
children:
<
Widget
>[
listItemInfo
(),
Padding
(
listItemButton
()
padding:
const
EdgeInsets
.
only
(
top:
5.0
,
left:
16.0
,
right:
10.0
),
],
child:
CircleAvatar
(
radius:
21.0
,
backgroundImage:
NetworkImage
(
item
.
icon
),
),
),
Expanded
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
<
Widget
>[
Container
(
child:
myText
(
'
${item.title}
'
,
ALColors
.
Color464646
,
13.0
,
weight:
true
),
),
Padding
(
padding:
const
EdgeInsets
.
only
(
top:
4.0
),
child:
myText
(
'
${item.content}
'
,
ALColors
.
Color666666
,
13.0
,
maxLines:
2
),
),
Padding
(
padding:
const
EdgeInsets
.
only
(
top:
3.0
),
child:
myText
(
MessageDate
(
item
.
pushTime
).
diffTime
(),
ALColors
.
Color999999
,
10.0
)
)
],
),
),
Padding
(
padding:
const
EdgeInsets
.
only
(
top:
4.0
,
left:
12.0
,
right:
16.0
),
child:
Container
(
width:
54.0
,
height:
29.0
,
child:
OutlineButton
(
padding:
const
EdgeInsets
.
only
(
left:
0.0
,
right:
0.0
,),
borderSide:
BorderSide
(
color:
ALColors
.
Color323232
),
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
zero
),
onPressed:
()
{
// todo 跳转到原生页面 详情页面
},
child:
myText
(
'详情'
,
ALColors
.
Color323232
,
13.0
)
),
)
)
],
),
),
),
);
);
}
}
...
...
lib/NewMessageModel/page/AttentionPage.dart
View file @
9067fe86
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_svg/flutter_svg.dart'
;
import
'package:flutter_svg/flutter_svg.dart'
;
import
'package:gmalpha_flutter/NewMessageModel/page/AttentionModel.dart'
;
import
'package:gmalpha_flutter/NewMessageModel/page/AttentionModel.dart'
;
...
@@ -82,15 +83,19 @@ class _AttentionPageState extends BasePage<AttentionPage> {
...
@@ -82,15 +83,19 @@ class _AttentionPageState extends BasePage<AttentionPage> {
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
<
Widget
>[
children:
<
Widget
>[
Padding
(
Padding
(
padding:
const
EdgeInsets
.
only
(
top:
16.0
,
left:
16.0
,
right:
16.0
,
bottom:
10
.0
),
padding:
const
EdgeInsets
.
only
(
top:
5.0
,
left:
16.0
,
right:
16.0
,
bottom:
29
.0
),
child:
Text
(
child:
Text
(
'通知'
,
'通知'
,
style:
TextStyle
(
fontSize:
20.0
,
color:
ALColors
.
Color323232
),
style:
TextStyle
(
fontSize:
20.0
,
color:
ALColors
.
Color323232
),
),
),
),
),
Divider
(
Container
(
color:
ALColors
.
ColorE4E4E4
,
margin:
const
EdgeInsets
.
only
(
left:
15.0
,
right:
15.0
),
),
child:
Divider
(
height:
1.0
,
color:
ALColors
.
ColorE4E4E4
,
),
)
],
],
);
);
}
}
...
@@ -107,7 +112,7 @@ class _AttentionPageState extends BasePage<AttentionPage> {
...
@@ -107,7 +112,7 @@ class _AttentionPageState extends BasePage<AttentionPage> {
return
_buildProgressIndicator
();
return
_buildProgressIndicator
();
}
}
return
Padding
(
return
Padding
(
padding:
const
EdgeInsets
.
only
(
bottom:
21
.0
),
padding:
const
EdgeInsets
.
only
(
bottom:
16.0
,
top:
16.0
,
left:
15.0
,
right:
15
.0
),
child:
AttentionListItem
(
_noticeLists
[
index
]),
child:
AttentionListItem
(
_noticeLists
[
index
]),
);
);
}
}
...
...
lib/NewMessageModel/page/common.dart
View file @
9067fe86
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/Annotations/RouterCenterRestore.mark.dart'
;
import
'package:gmalpha_flutter/Annotations/RouterCenterRestore.mark.dart'
;
import
'package:gmalpha_flutter/NewMessageModel/
page
/message_date.dart'
;
import
'package:gmalpha_flutter/NewMessageModel/
util
/message_date.dart'
;
import
'package:gmalpha_flutter/res/value/ALColors.dart'
;
import
'package:gmalpha_flutter/res/value/ALColors.dart'
;
...
...
lib/NewMessageModel/
page
/message_date.dart
→
lib/NewMessageModel/
util
/message_date.dart
View file @
9067fe86
...
@@ -3,7 +3,7 @@ class MessageDate {
...
@@ -3,7 +3,7 @@ class MessageDate {
int
_currentDate
;
int
_currentDate
;
MessageDate
(
this
.
time
);
MessageDate
(
this
.
time
);
String
diffTime
()
{
String
diffTime
()
{
var
date
=
DateTime
.
now
();
var
date
=
DateTime
.
now
();
int
serverTime
=
(
time
*
1000
).
toInt
();
int
serverTime
=
(
time
*
1000
).
toInt
();
_currentDate
=
date
.
millisecondsSinceEpoch
;
_currentDate
=
date
.
millisecondsSinceEpoch
;
...
...
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