|
| 1 | +import 'package:flutter/material.dart'; |
| 2 | +import 'package:gsy_github_app_flutter/common/style/GSYStyle.dart'; |
| 3 | +import 'package:gsy_github_app_flutter/widget/GSYCardItem.dart'; |
| 4 | +import 'package:gsy_github_app_flutter/widget/GSYIConText.dart'; |
| 5 | + |
| 6 | +/** |
| 7 | + * Created by guoshuyu |
| 8 | + * Date: 2018-07-16 |
| 9 | + */ |
| 10 | + |
| 11 | +class ReposItem extends StatelessWidget { |
| 12 | + final ReposViewModel reposViewModel; |
| 13 | + |
| 14 | + ReposItem(this.reposViewModel) : super(); |
| 15 | + |
| 16 | + @override |
| 17 | + Widget build(BuildContext context) { |
| 18 | + return new Container( |
| 19 | + child: new GSYCardItem( |
| 20 | + child: new FlatButton( |
| 21 | + onPressed: () => {}, |
| 22 | + child: new Padding( |
| 23 | + padding: new EdgeInsets.only(left: 10.0, top: 10.0, right: 10.0, bottom: 10.0), |
| 24 | + child: new Column( |
| 25 | + mainAxisSize: MainAxisSize.min, |
| 26 | + children: <Widget>[ |
| 27 | + new Row( |
| 28 | + crossAxisAlignment: CrossAxisAlignment.start, |
| 29 | + children: <Widget>[ |
| 30 | + new ClipOval( |
| 31 | + child: new FadeInImage.assetNetwork( |
| 32 | + placeholder: "static/images/logo.png", |
| 33 | + //预览图 |
| 34 | + fit: BoxFit.fitWidth, |
| 35 | + image: "FFFF", |
| 36 | + width: 40.0, |
| 37 | + height: 40.0, |
| 38 | + ), |
| 39 | + ), |
| 40 | + new Padding(padding: EdgeInsets.all(10.0)), |
| 41 | + new Expanded( |
| 42 | + child: new Column( |
| 43 | + crossAxisAlignment: CrossAxisAlignment.start, |
| 44 | + children: <Widget>[ |
| 45 | + new Text("FFFF", style: GSYConstant.normalTextBold), |
| 46 | + new GSYIConText( |
| 47 | + GSYICons.REPOS_ITEM_USER, |
| 48 | + "FFF", |
| 49 | + GSYConstant.subLightSmallText, |
| 50 | + Color(GSYColors.subLightTextColor), |
| 51 | + 10.0, |
| 52 | + padding: 3.0, |
| 53 | + ), |
| 54 | + ], |
| 55 | + ), |
| 56 | + ), |
| 57 | + new Text("FFFF", style: GSYConstant.subSmallText), |
| 58 | + ], |
| 59 | + ), |
| 60 | + new Container( |
| 61 | + child: new Text("ggggggggggggggggggggggggggggggg", style: GSYConstant.subSmallText), |
| 62 | + margin: new EdgeInsets.only(top: 6.0, bottom: 2.0), |
| 63 | + alignment: Alignment.topLeft), |
| 64 | + ], |
| 65 | + ), |
| 66 | + ))), |
| 67 | + ); |
| 68 | + } |
| 69 | +} |
| 70 | + |
| 71 | +class ReposViewModel { |
| 72 | + String ownerName; |
| 73 | + String ownerPic; |
| 74 | + String repositoryName; |
| 75 | + String repositoryStar; |
| 76 | + String repositoryFork; |
| 77 | + String repositoryWatch; |
| 78 | + String hideWatchIcon; |
| 79 | + String repositoryTyp; |
| 80 | + String repositoryDes; |
| 81 | +} |
0 commit comments