Skip to content

Commit e9f5db0

Browse files
committed
调整头像
1 parent eb0eb8b commit e9f5db0

File tree

9 files changed

+79
-68
lines changed

9 files changed

+79
-68
lines changed

lib/page/CodeDetailPage.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ class _CodeDetailPageState extends State<CodeDetailPage> {
7676
Widget widget = (data == null)
7777
? new Center(
7878
child: new Container(
79-
width: 140.0,
80-
height: 140.0,
79+
width: 200.0,
80+
height: 200.0,
8181
padding: new EdgeInsets.all(4.0),
8282
child: new Row(
8383
mainAxisAlignment: MainAxisAlignment.center,

lib/page/CodeDetailPageWeb.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ class _CodeDetailPageState extends State<CodeDetailPageWeb> {
7979
),
8080
body: new Center(
8181
child: new Container(
82-
width: 140.0,
83-
height: 140.0,
82+
width: 200.0,
83+
height: 200.0,
8484
padding: new EdgeInsets.all(4.0),
8585
child: new Row(
8686
mainAxisAlignment: MainAxisAlignment.center,

lib/page/RepositoryDetailReadmePage.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ class RepositoryDetailReadmePageState extends State<RepositoryDetailReadmePage>
7272
if (markdownData == null) {
7373
return Center(
7474
child: new Container(
75-
width: 140.0,
76-
height: 140.0,
75+
width: 200.0,
76+
height: 200.0,
7777
padding: new EdgeInsets.all(4.0),
7878
child: new Row(
7979
mainAxisAlignment: MainAxisAlignment.center,

lib/widget/EventItem.dart

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import 'package:gsy_github_app_flutter/common/utils/CommonUtils.dart';
44
import 'package:gsy_github_app_flutter/common/utils/EventUtils.dart';
55
import 'package:gsy_github_app_flutter/common/utils/NavigatorUtils.dart';
66
import 'package:gsy_github_app_flutter/widget/GSYCardItem.dart';
7+
import 'package:gsy_github_app_flutter/widget/GSYUserIconWidget.dart';
78

89
/**
910
* 事件Item
@@ -24,37 +25,30 @@ class EventItem extends StatelessWidget {
2425
Widget des = (eventViewModel.actionDes == null || eventViewModel.actionDes.length == 0)
2526
? new Container()
2627
: new Container(
27-
child: new Text(
28-
eventViewModel.actionDes,
29-
style: GSYConstant.subSmallText,
30-
maxLines: 3,
31-
),
32-
margin: new EdgeInsets.only(top: 6.0, bottom: 2.0),
33-
alignment: Alignment.topLeft);
28+
child: new Text(
29+
eventViewModel.actionDes,
30+
style: GSYConstant.subSmallText,
31+
maxLines: 3,
32+
),
33+
margin: new EdgeInsets.only(top: 6.0, bottom: 2.0),
34+
alignment: Alignment.topLeft);
3435

3536
Widget userImage = (needImage)
36-
? new IconButton(
37-
padding: EdgeInsets.only(top: 0.0, left: 0.0, bottom: 0.0, right: 10.0),
38-
icon: new ClipOval(
39-
child: new FadeInImage.assetNetwork(
40-
placeholder: "static/images/logo.png",
41-
//预览图
42-
fit: BoxFit.fitWidth,
43-
image: eventViewModel.actionUserPic,
44-
width: 30.0,
45-
height: 30.0,
46-
),
47-
),
48-
onPressed: () {
49-
NavigatorUtils.goPerson(context, eventViewModel.actionUser);
50-
})
37+
? new GSYUserIconWidget(
38+
padding: const EdgeInsets.only(top: 0.0, right: 5.0, left: 0.0),
39+
width: 30.0,
40+
height: 30.0,
41+
image: eventViewModel.actionUserPic,
42+
onPressed: () {
43+
NavigatorUtils.goPerson(context, eventViewModel.actionUser);
44+
})
5145
: Container();
5246
return new Container(
5347
child: new GSYCardItem(
5448
child: new FlatButton(
5549
onPressed: onPressed,
5650
child: new Padding(
57-
padding: new EdgeInsets.only(left: 0.0, top: 5.0, right: 0.0, bottom: 10.0),
51+
padding: new EdgeInsets.only(left: 0.0, top: 10.0, right: 0.0, bottom: 10.0),
5852
child: new Column(
5953
mainAxisSize: MainAxisSize.min,
6054
children: <Widget>[

lib/widget/GSYSelectItemWidget.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class _GSYSelectItemWidgetState extends State<GSYSelectItemWidget> {
8181
list.add(_renderItem(itemNames[i], i));
8282
} else {
8383
list.add(_renderItem(itemNames[i], i));
84-
list.add(new Container(width: 1.0, height: 30.0, color: Color(GSYColors.subLightTextColor)));
84+
list.add(new Container(width: 1.0, height: 25.0, color: Color(GSYColors.subLightTextColor)));
8585
}
8686
}
8787
return list;

lib/widget/GSYUserIconWidget.dart

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import 'package:flutter/material.dart';
2+
3+
/**
4+
* 头像Icon
5+
* Created by guoshuyu
6+
* Date: 2018-07-30
7+
*/
8+
9+
class GSYUserIconWidget extends StatelessWidget {
10+
final String image;
11+
final VoidCallback onPressed;
12+
final double width;
13+
final double height;
14+
final EdgeInsetsGeometry padding;
15+
16+
GSYUserIconWidget({this.image, this.onPressed, this.width = 30.0, this.height = 30.0, this.padding});
17+
18+
@override
19+
Widget build(BuildContext context) {
20+
return new RawMaterialButton(
21+
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
22+
padding: padding ?? const EdgeInsets.only(top: 4.0, right: 5.0, left: 5.0),
23+
constraints: const BoxConstraints(minWidth: 0.0, minHeight: 0.0),
24+
child: new ClipOval(
25+
child: new FadeInImage.assetNetwork(
26+
placeholder: "static/images/logo.png",
27+
//预览图
28+
fit: BoxFit.fitWidth,
29+
image: image,
30+
width: width,
31+
height: height,
32+
),
33+
),
34+
onPressed: onPressed);
35+
}
36+
}

lib/widget/IssueHeaderItem.dart

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import 'package:gsy_github_app_flutter/common/utils/CommonUtils.dart';
44
import 'package:gsy_github_app_flutter/common/utils/NavigatorUtils.dart';
55
import 'package:gsy_github_app_flutter/widget/GSYCardItem.dart';
66
import 'package:gsy_github_app_flutter/widget/GSYIConText.dart';
7+
import 'package:gsy_github_app_flutter/widget/GSYUserIconWidget.dart';
78

89
/**
910
* Issue 详情头
@@ -59,17 +60,11 @@ class IssueHeaderItem extends StatelessWidget {
5960
new Row(
6061
crossAxisAlignment: CrossAxisAlignment.start,
6162
children: <Widget>[
62-
new IconButton(
63-
icon: new ClipOval(
64-
child: new FadeInImage.assetNetwork(
65-
placeholder: "static/images/logo.png",
66-
//预览图
67-
fit: BoxFit.fitWidth,
68-
image: issueHeaderViewModel.actionUserPic,
69-
width: 80.0,
70-
height: 80.0,
71-
),
72-
),
63+
new GSYUserIconWidget(
64+
padding: const EdgeInsets.only(top: 0.0, right: 5.0, left: 0.0),
65+
width: 50.0,
66+
height: 50.0,
67+
image: issueHeaderViewModel.actionUserPic,
7368
onPressed: () {
7469
NavigatorUtils.goPerson(context, issueHeaderViewModel.actionUser);
7570
}),

lib/widget/IssueItem.dart

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import 'package:gsy_github_app_flutter/common/utils/CommonUtils.dart';
44
import 'package:gsy_github_app_flutter/common/utils/NavigatorUtils.dart';
55
import 'package:gsy_github_app_flutter/widget/GSYCardItem.dart';
66
import 'package:gsy_github_app_flutter/widget/GSYIConText.dart';
7+
import 'package:gsy_github_app_flutter/widget/GSYUserIconWidget.dart';
78

89
/**
910
* Issue相关item
@@ -61,17 +62,10 @@ class IssueItem extends StatelessWidget {
6162
child: new Padding(
6263
padding: new EdgeInsets.only(left: 5.0, top: 5.0, right: 10.0, bottom: 8.0),
6364
child: new Row(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
64-
new IconButton(
65-
icon: new ClipOval(
66-
child: new FadeInImage.assetNetwork(
67-
placeholder: "static/images/logo.png",
68-
//预览图
69-
fit: BoxFit.fitWidth,
70-
image: issueItemViewModel.actionUserPic,
71-
width: 30.0,
72-
height: 30.0,
73-
),
74-
),
65+
new GSYUserIconWidget(
66+
width: 30.0,
67+
height: 30.0,
68+
image: issueItemViewModel.actionUserPic,
7569
onPressed: () {
7670
NavigatorUtils.goPerson(context, issueItemViewModel.actionUser);
7771
}),

lib/widget/ReposItem.dart

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import 'package:gsy_github_app_flutter/common/style/GSYStyle.dart';
33
import 'package:gsy_github_app_flutter/common/utils/NavigatorUtils.dart';
44
import 'package:gsy_github_app_flutter/widget/GSYCardItem.dart';
55
import 'package:gsy_github_app_flutter/widget/GSYIConText.dart';
6+
import 'package:gsy_github_app_flutter/widget/GSYUserIconWidget.dart';
67

78
/**
89
* 仓库Item
@@ -39,30 +40,21 @@ class ReposItem extends StatelessWidget {
3940
child: new FlatButton(
4041
onPressed: onPressed,
4142
child: new Padding(
42-
padding: new EdgeInsets.only(left: 10.0, top: 10.0, right: 10.0, bottom: 10.0),
43+
padding: new EdgeInsets.only(left: 0.0, top: 10.0, right: 10.0, bottom: 10.0),
4344
child: new Column(
4445
mainAxisSize: MainAxisSize.min,
4546
children: <Widget>[
4647
new Row(
4748
crossAxisAlignment: CrossAxisAlignment.start,
4849
children: <Widget>[
49-
new RawMaterialButton(
50-
constraints: new BoxConstraints(minWidth: 0.0, minHeight: 0.0),
51-
padding: new EdgeInsets.all(0.0),
50+
new GSYUserIconWidget(
51+
padding: const EdgeInsets.only(top: 0.0, right: 5.0, left: 0.0),
52+
width: 40.0,
53+
height: 40.0,
54+
image: reposViewModel.ownerPic,
5255
onPressed: () {
5356
NavigatorUtils.goPerson(context, reposViewModel.ownerName);
54-
},
55-
child: new ClipOval(
56-
child: new FadeInImage.assetNetwork(
57-
placeholder: "static/images/logo.png",
58-
//预览图
59-
fit: BoxFit.fitWidth,
60-
image: reposViewModel.ownerPic,
61-
width: 40.0,
62-
height: 40.0,
63-
),
64-
)),
65-
new Padding(padding: EdgeInsets.all(10.0)),
57+
}),
6658
new Expanded(
6759
child: new Column(
6860
crossAxisAlignment: CrossAxisAlignment.start,

0 commit comments

Comments
 (0)