Repository navigation
Expand file tree
/
Copy pathPushCoedItem.dart
More file actions
64 lines (56 loc) · 1.71 KB
/
Copy pathPushCoedItem.dart
File metadata and controls
64 lines (56 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import 'package:flutter/material.dart';
import 'package:gsy_github_app_flutter/common/model/CommitFile.dart';
import 'package:gsy_github_app_flutter/common/style/GSYStyle.dart';
import 'package:gsy_github_app_flutter/widget/GSYCardItem.dart';
/**
* 推送修改代码Item
* Created by guoshuyu
* Date: 2018-07-27
*/
class PushCodeItem extends StatelessWidget {
final PushCodeItemViewModel pushCodeItemViewModel;
final VoidCallback onPressed;
PushCodeItem(this.pushCodeItemViewModel, this.onPressed);
@override
Widget build(BuildContext context) {
return new Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
new Container(
///修改文件路径
margin: EdgeInsets.only(left: 10.0, top: 5.0, right: 10.0, bottom: 0.0),
child: new Text(
pushCodeItemViewModel.path,
style: GSYConstant.smallSubLightText,
),
),
new GSYCardItem(
///修改文件名
margin: EdgeInsets.only(left: 10.0, top: 5.0, right: 10.0, bottom: 5.0),
child: new ListTile(
title: new Text(pushCodeItemViewModel.name, style: GSYConstant.smallSubText),
leading: new Icon(
GSYICons.REPOS_ITEM_FILE,
size: 15.0,
),
onTap: () {
onPressed();
},
),
),
]);
}
}
class PushCodeItemViewModel {
String path;
String name;
String patch;
String blob_url;
PushCodeItemViewModel();
PushCodeItemViewModel.fromMap(CommitFile map) {
String filename = map.fileName;
List<String> nameSplit = filename.split("/");
name = nameSplit[nameSplit.length - 1];
path = filename;
patch = map.patch;
blob_url = map.blobUrl;
}
}