Skip to content

Commit 7bb8364

Browse files
committed
增加 input dialog
1 parent dda6e16 commit 7bb8364

5 files changed

Lines changed: 79 additions & 2 deletions

File tree

‎lib/common/utils/CommonUtils.dart‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import 'dart:async';
22

33
import 'package:flutter/material.dart';
44
import 'package:gsy_github_app_flutter/common/style/GSYStyle.dart';
5+
import 'package:gsy_github_app_flutter/widget/IssueEditDIalog.dart';
56

67
/**
78
* 通用逻辑
@@ -82,4 +83,14 @@ class CommonUtils {
8283
);
8384
});
8485
}
86+
87+
static Future<Null> showEditDialog(BuildContext context) {
88+
return showDialog(
89+
context: context,
90+
builder: (BuildContext context) {
91+
return Center(
92+
child: new IssueEditDialog(),
93+
);
94+
});
95+
}
8596
}

‎lib/common/utils/EventUtils.dart‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ class EventUtils {
177177
if (fullName.toLowerCase() == currentRepository.toLowerCase()) {
178178
return;
179179
}
180+
NavigatorUtils.goReposDetail(context, owner, repositoryName);
180181
NavigatorUtils.goReposDetail(context, "carsmallguo", "GSYGithubApp-Weex");
181182
break;
182183
}

‎lib/page/IssueDetailPage.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ class _IssueDetailPageState extends GSYListState<IssueDetailPage> {
7777
: <Widget>[
7878
new FlatButton(
7979
onPressed: () {
80-
CommonUtils.showLoadingDialog(context);
8180
/*return ReposDao.doRepositoryStarDao(userName, reposName, bottomStatusModel.star).then((result) {
8281
_getHeaderInfo();
8382
Navigator.pop(context);
8483
});*/
84+
CommonUtils.showEditDialog(context);
8585
},
8686
child: new Text(GSYStrings.issue_reply, style: GSYConstant.smallText)),
8787
new Container(width: 0.3, height: 30.0, color: Color(GSYColors.subLightTextColor)),

‎lib/widget/GSYInputWidget.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class _GSYInputWidgetState extends State<GSYInputWidget> {
4444
obscureText: obscureText,
4545
decoration: new InputDecoration(
4646
hintText: hintText,
47-
icon: new Icon(iconData),
47+
icon: iconData == null ? null : new Icon(iconData),
4848
),
4949
);
5050
}

‎lib/widget/IssueEditDIalog.dart‎

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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/GSYInputWidget.dart';
5+
6+
/**
7+
* issue 编辑输入框
8+
* Created by guoshuyu
9+
* on 2018/7/21.
10+
*/
11+
class IssueEditDialog extends StatefulWidget {
12+
@override
13+
_IssueEditDialogState createState() => _IssueEditDialogState();
14+
}
15+
16+
class _IssueEditDialogState extends State<IssueEditDialog> {
17+
@override
18+
Widget build(BuildContext context) {
19+
return new GSYCardItem(
20+
margin: EdgeInsets.all(30.0),
21+
shape: new RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(10.0))),
22+
child: new Padding(
23+
padding: new EdgeInsets.all(12.0),
24+
child: new Column(
25+
mainAxisSize: MainAxisSize.min,
26+
children: <Widget>[
27+
new Container(height: 10.0),
28+
new Center(child: new Text("Title")),
29+
new GSYInputWidget(
30+
hintText: GSYStrings.login_password_hint_text,
31+
obscureText: false,
32+
),
33+
new Container(height: 10.0),
34+
new Container(
35+
height: 300.0,
36+
decoration: new BoxDecoration(
37+
borderRadius: BorderRadius.all(Radius.circular(4.0)),
38+
color: Colors.white,
39+
border: new Border.all(color: Color(GSYColors.subTextColor), width: 1.0),
40+
),
41+
padding: new EdgeInsets.only(left: 20.0, top: 12.0, right: 20.0, bottom: 12.0),
42+
child: new TextField(
43+
autofocus: false,
44+
decoration: new InputDecoration.collapsed(
45+
hintText: GSYStrings.repos_issue_search,
46+
hintStyle: GSYConstant.middleSubText,
47+
),
48+
style: GSYConstant.middleText,
49+
),
50+
),
51+
new Container(height: 10.0),
52+
new Row(
53+
crossAxisAlignment: CrossAxisAlignment.center,
54+
children: <Widget>[
55+
new Expanded(child: new FlatButton(child: new Text("FFF"), onPressed: () {})),
56+
new Container(width: 0.3, height: 30.0, color: Color(GSYColors.subTextColor)),
57+
new Expanded(child: new FlatButton(child: new Text("FFF"), onPressed: () {})),
58+
],
59+
)
60+
],
61+
),
62+
),
63+
);
64+
}
65+
}

0 commit comments

Comments
 (0)