Skip to content

Commit f4fbbd3

Browse files
committed
fix #887
1 parent 66e2071 commit f4fbbd3

File tree

6 files changed

+56
-33
lines changed

6 files changed

+56
-33
lines changed

lib/common/localization/gsy_string_base.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,4 +266,6 @@ abstract class GSYStringBase {
266266
String get search_sort;
267267

268268
String get search_language;
269+
270+
String get feed_back_tip;
269271
}

lib/common/localization/gsy_string_en.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,4 +293,6 @@ class GSYStringEn extends GSYStringBase {
293293
String search_sort = "sort";
294294
@override
295295
String search_language = "language";
296+
@override
297+
String feed_back_tip = "Your feedback will be submitted to GitHub through a public issue";
296298
}

lib/common/localization/gsy_string_zh.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,4 +295,6 @@ class GSYStringZh extends GSYStringBase {
295295
String search_sort = "排序";
296296
@override
297297
String search_language = "语言";
298+
@override
299+
String feed_back_tip = "你的反馈将通过 github issue 被提交";
298300
}

lib/common/utils/common_utils.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,7 @@ class CommonUtils {
433433
TextEditingController? titleController,
434434
TextEditingController? valueController,
435435
bool needTitle = true,
436+
String? hintText,
436437
}) {
437438
return NavigatorUtils.showGSYDialog(
438439
context: context,
@@ -446,6 +447,7 @@ class CommonUtils {
446447
titleController: titleController,
447448
valueController: valueController,
448449
needTitle: needTitle,
450+
hintText: hintText,
449451
),
450452
);
451453
});

lib/page/home/widget/home_drawer.dart

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ class HomeDrawer extends StatelessWidget {
2929
context: context,
3030
builder: (BuildContext context) => AboutDialog(
3131
applicationName: GSYLocalizations.i18n(context)!.app_name,
32-
applicationVersion: "${GSYLocalizations.i18n(context)!.app_version}: ${versionName ?? ""}",
32+
applicationVersion:
33+
"${GSYLocalizations.i18n(context)!.app_version}: ${versionName ?? ""}",
3334
applicationIcon: const Image(
3435
image: AssetImage(GSYICons.DEFAULT_USER_ICON),
3536
width: 50.0,
@@ -91,9 +92,8 @@ class HomeDrawer extends StatelessWidget {
9192
onTap: () {},
9293
child: CircleAvatar(
9394
//圆形图标控件
94-
backgroundImage: NetworkImage(
95-
user.avatar_url ??
96-
GSYICons.DEFAULT_REMOTE_PIC),
95+
backgroundImage: NetworkImage(user.avatar_url ??
96+
GSYICons.DEFAULT_REMOTE_PIC),
9797
),
9898
),
9999
decoration: BoxDecoration(
@@ -102,36 +102,42 @@ class HomeDrawer extends StatelessWidget {
102102
),
103103
),
104104
ListTile(
105-
title: Text(
105+
title: Text(
106+
GSYLocalizations.i18n(context)!.home_reply,
107+
style: GSYConstant.normalText,
108+
),
109+
onTap: () {
110+
String content = "";
111+
CommonUtils.showEditDialog(
112+
context,
106113
GSYLocalizations.i18n(context)!.home_reply,
107-
style: GSYConstant.normalText,
108-
),
109-
onTap: () {
110-
String content = "";
111-
CommonUtils.showEditDialog(
112-
context,
113-
GSYLocalizations.i18n(context)!.home_reply,
114-
(title) {}, (res) {
114+
(title) {},
115+
(res) {
115116
content = res;
116-
}, () {
117+
},
118+
() {
117119
if (content.isEmpty) {
118120
return;
119121
}
120122
CommonUtils.showLoadingDialog(context);
121123
IssueDao.createIssueDao(
122124
"CarGuo", "gsy_github_app_flutter", {
123-
"title":
124-
GSYLocalizations.i18n(context)!.home_reply,
125+
"title": GSYLocalizations.i18n(context)!
126+
.home_reply,
125127
"body": content
126128
}).then((result) {
127129
Navigator.pop(context);
128130
Navigator.pop(context);
129131
});
130132
},
131-
titleController: TextEditingController(),
132-
valueController: TextEditingController(),
133-
needTitle: false);
134-
}),
133+
titleController: TextEditingController(),
134+
valueController: TextEditingController(),
135+
needTitle: false,
136+
hintText:
137+
GSYLocalizations.i18n(context)!.feed_back_tip,
138+
);
139+
},
140+
),
135141
ListTile(
136142
title: Text(
137143
GSYLocalizations.i18n(context)!.home_history,
@@ -176,11 +182,9 @@ class HomeDrawer extends StatelessWidget {
176182
onTap: () {
177183
CommonUtils.showLanguageDialog(context);
178184
}),
179-
180185
ListTile(
181186
title: Text(
182-
GSYLocalizations.i18n(context)!
183-
.home_change_grey,
187+
GSYLocalizations.i18n(context)!.home_change_grey,
184188
style: GSYConstant.normalText,
185189
),
186190
onTap: () {
@@ -201,7 +205,7 @@ class HomeDrawer extends StatelessWidget {
201205
.home_about,
202206
style: GSYConstant.normalText,
203207
),
204-
onLongPress: (){
208+
onLongPress: () {
205209
NavigatorUtils.goDebugDataPage(context);
206210
},
207211
onTap: () {

lib/page/issue/issue_edit_dIalog.dart

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,19 @@ class IssueEditDialog extends StatefulWidget {
2121
final TextEditingController? valueController;
2222

2323
final bool needTitle;
24-
25-
const IssueEditDialog(this.dialogTitle, this.onTitleChanged, this.onContentChanged,
26-
this.onPressed,
27-
{super.key, this.titleController, this.valueController, this.needTitle = true});
24+
final String? hintText;
25+
26+
const IssueEditDialog(
27+
this.dialogTitle,
28+
this.onTitleChanged,
29+
this.onContentChanged,
30+
this.onPressed, {
31+
super.key,
32+
this.titleController,
33+
this.valueController,
34+
this.needTitle = true,
35+
this.hintText,
36+
});
2837

2938
@override
3039
_IssueEditDialogState createState() => _IssueEditDialogState();
@@ -58,8 +67,8 @@ class _IssueEditDialogState extends State<IssueEditDialog> {
5867
itemBuilder: (context, index) {
5968
return RawMaterialButton(
6069
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
61-
padding:
62-
const EdgeInsets.only(left: 8.0, right: 8.0, top: 5.0, bottom: 5.0),
70+
padding: const EdgeInsets.only(
71+
left: 8.0, right: 8.0, top: 5.0, bottom: 5.0),
6372
constraints: const BoxConstraints(minWidth: 0.0, minHeight: 0.0),
6473
child: Icon(FAST_INPUT_LIST[index].iconData, size: 16.0),
6574
onPressed: () {
@@ -144,8 +153,9 @@ class _IssueEditDialogState extends State<IssueEditDialog> {
144153
onChanged: widget.onContentChanged,
145154
controller: widget.valueController,
146155
decoration: InputDecoration(
147-
hintText: GSYLocalizations.i18n(context)!
148-
.issue_edit_issue_title_tip,
156+
hintText: widget.hintText ??
157+
GSYLocalizations.i18n(context)!
158+
.issue_edit_issue_title_tip,
149159
hintStyle: GSYConstant.middleSubText,
150160
isDense: true,
151161
border: InputBorder.none,
@@ -193,7 +203,8 @@ class _IssueEditDialogState extends State<IssueEditDialog> {
193203
minWidth: 0.0, minHeight: 0.0),
194204
onPressed: widget.onPressed,
195205
child: Text(
196-
GSYLocalizations.i18n(context)!.app_ok,
206+
GSYLocalizations.i18n(context)!
207+
.app_ok,
197208
style: GSYConstant.normalTextBold))),
198209
],
199210
)

0 commit comments

Comments
 (0)