Skip to content

Commit d3ea546

Browse files
committed
细节优化
1 parent c4cb9fa commit d3ea546

File tree

1 file changed

+32
-13
lines changed

1 file changed

+32
-13
lines changed

lib/page/home/project/project_page.dart

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class _ProjectSubPageState extends State<ProjectSubPage>
8888
await Future.delayed(Duration(seconds: 2));
8989
Response res =
9090
await dio.get('https://www.wanandroid.com/article/listproject/0/json');
91-
await dio.get('https://www.wanandroid.com/lg/collect/list/0/json');
91+
await dio.get('https://www.wanandroid.com/lg/collect/list/0/json');
9292
BaseEntity baseEntity = BaseEntity.fromJson(res.data);
9393
BaseListEntity<List> baseListEntity =
9494
BaseListEntity.fromJson(baseEntity.data);
@@ -438,10 +438,11 @@ class _ProjectSubPageState extends State<ProjectSubPage>
438438
///项目item
439439
Widget projectItem(ProjectEntity data) {
440440
return Card(
441+
elevation: 0.5,
441442
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(pt(6))),
442443
clipBehavior: Clip.antiAlias,
443444
child: GestureDetector(
444-
onTap: (){
445+
onTap: () {
445446
print('click item');
446447
t();
447448
},
@@ -469,13 +470,30 @@ class _ProjectSubPageState extends State<ProjectSubPage>
469470
},
470471
),
471472
Positioned(
472-
bottom: pt(4),
473-
left: pt(4),
474-
child: Text(
475-
data.author,
476-
style: TextStyle(color: Colors.white, fontSize: 11),
477-
maxLines: 1,
478-
overflow: TextOverflow.ellipsis,
473+
bottom: 0,
474+
left: 0,
475+
right: 0,
476+
child: Container(
477+
decoration: BoxDecoration(
478+
gradient: LinearGradient(
479+
colors: [
480+
Colors.transparent,
481+
Colors.black26,
482+
],
483+
begin: Alignment.topCenter,
484+
end: Alignment.bottomCenter,
485+
)),
486+
padding: EdgeInsets.only(
487+
left: pt(4),
488+
bottom: pt(2),
489+
top: pt(10),
490+
),
491+
child: Text(
492+
data.author,
493+
style: TextStyle(color: Colors.white, fontSize: 11),
494+
maxLines: 1,
495+
overflow: TextOverflow.ellipsis,
496+
),
479497
),
480498
),
481499
],
@@ -487,16 +505,17 @@ class _ProjectSubPageState extends State<ProjectSubPage>
487505
data.title,
488506
maxLines: 1,
489507
overflow: TextOverflow.ellipsis,
490-
style: TextStyle(fontSize: 14,fontWeight: FontWeight.w500),
508+
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w500),
491509
),
492510
),
493511
GestureDetector(
494512
behavior: HitTestBehavior.opaque,
495-
onTap: (){
513+
onTap: () {
496514
print('click type ${data.chapterName}');
497515
},
498516
child: Padding(
499-
padding: EdgeInsets.only(bottom: pt(6), left: pt(4), right: pt(4)),
517+
padding:
518+
EdgeInsets.only(bottom: pt(6), left: pt(4), right: pt(4)),
500519
child: Row(
501520
children: <Widget>[
502521
Text(
@@ -524,7 +543,7 @@ class _ProjectSubPageState extends State<ProjectSubPage>
524543
: WColors.hint_color_dark,
525544
size: pt(15),
526545
),
527-
onTap: (){
546+
onTap: () {
528547
print('click fav ${data.collect}');
529548
},
530549
),

0 commit comments

Comments
 (0)