@@ -9,13 +9,59 @@ import 'package:gsy_github_app_flutter/widget/GSYInputWidget.dart';
99 * on 2018/7/21.
1010 */
1111class IssueEditDialog extends StatefulWidget {
12+ final String dialogTitle;
13+
14+ final ValueChanged <String > onTitleChanged;
15+
16+ final ValueChanged <String > onContentChanged;
17+
18+ final VoidCallback onPressed;
19+
20+ final TextEditingController titleController;
21+
22+ final TextEditingController valueController;
23+
24+ final bool needTitle;
25+
26+ IssueEditDialog (this .dialogTitle, this .onContentChanged, this .onTitleChanged, this .onPressed,
27+ {this .titleController, this .valueController, this .needTitle = true });
28+
1229 @override
13- _IssueEditDialogState createState () => _IssueEditDialogState ();
30+ _IssueEditDialogState createState () =>
31+ _IssueEditDialogState (this .dialogTitle, this .onContentChanged, this .onTitleChanged, this .onPressed, titleController, valueController, needTitle);
1432}
1533
1634class _IssueEditDialogState extends State <IssueEditDialog > {
35+ final String dialogTitle;
36+
37+ final ValueChanged <String > onTitleChanged;
38+
39+ final ValueChanged <String > onContentChanged;
40+
41+ final VoidCallback onPressed;
42+
43+ final TextEditingController titleController;
44+
45+ final TextEditingController valueController;
46+
47+ final bool needTitle;
48+
49+ _IssueEditDialogState (
50+ this .dialogTitle, this .onContentChanged, this .onTitleChanged, this .onPressed, this .titleController, this .valueController, this .needTitle);
51+
1752 @override
1853 Widget build (BuildContext context) {
54+ Widget title = (needTitle)
55+ ? new Padding (
56+ padding: new EdgeInsets .all (5.0 ),
57+ child: new GSYInputWidget (
58+ onChanged: onTitleChanged,
59+ controller: titleController,
60+ hintText: GSYStrings .login_password_hint_text,
61+ obscureText: false ,
62+ ))
63+ : new Container ();
64+
1965 return new GSYCardItem (
2066 margin: EdgeInsets .all (30.0 ),
2167 shape: new RoundedRectangleBorder (borderRadius: BorderRadius .all (Radius .circular (10.0 ))),
@@ -24,13 +70,12 @@ class _IssueEditDialogState extends State<IssueEditDialog> {
2470 child: new Column (
2571 mainAxisSize: MainAxisSize .min,
2672 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 ),
73+ new Padding (
74+ padding: new EdgeInsets .all (5.0 ),
75+ child: new Center (
76+ child: new Text (dialogTitle, style: GSYConstant .smallTextBold),
77+ )),
78+ title,
3479 new Container (
3580 height: 300.0 ,
3681 decoration: new BoxDecoration (
@@ -41,6 +86,8 @@ class _IssueEditDialogState extends State<IssueEditDialog> {
4186 padding: new EdgeInsets .only (left: 20.0 , top: 12.0 , right: 20.0 , bottom: 12.0 ),
4287 child: new TextField (
4388 autofocus: false ,
89+ onChanged: onContentChanged,
90+ controller: valueController,
4491 decoration: new InputDecoration .collapsed (
4592 hintText: GSYStrings .repos_issue_search,
4693 hintStyle: GSYConstant .middleSubText,
@@ -52,9 +99,14 @@ class _IssueEditDialogState extends State<IssueEditDialog> {
5299 new Row (
53100 crossAxisAlignment: CrossAxisAlignment .center,
54101 children: < Widget > [
55- new Expanded (child: new FlatButton (child: new Text ("FFF" ), onPressed: () {})),
102+ new Expanded (
103+ child: new FlatButton (
104+ child: new Text (GSYStrings .app_cancel),
105+ onPressed: () {
106+ Navigator .pop (context);
107+ })),
56108 new Container (width: 0.3 , height: 30.0 , color: Color (GSYColors .subTextColor)),
57- new Expanded (child: new FlatButton (child: new Text ("FFF" ), onPressed: () {})),
109+ new Expanded (child: new FlatButton (child: new Text (GSYStrings .app_cancel ), onPressed: () {})),
58110 ],
59111 )
60112 ],
0 commit comments