Skip to content

Commit

Permalink
fix #887
Browse files Browse the repository at this point in the history
  • Loading branch information
CarGuo committed Jul 3, 2024
1 parent 66e2071 commit f4fbbd3
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 33 deletions.
2 changes: 2 additions & 0 deletions lib/common/localization/gsy_string_base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -266,4 +266,6 @@ abstract class GSYStringBase {
String get search_sort;

String get search_language;

String get feed_back_tip;
}
2 changes: 2 additions & 0 deletions lib/common/localization/gsy_string_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -293,4 +293,6 @@ class GSYStringEn extends GSYStringBase {
String search_sort = "sort";
@override
String search_language = "language";
@override
String feed_back_tip = "Your feedback will be submitted to GitHub through a public issue";
}
2 changes: 2 additions & 0 deletions lib/common/localization/gsy_string_zh.dart
Original file line number Diff line number Diff line change
Expand Up @@ -295,4 +295,6 @@ class GSYStringZh extends GSYStringBase {
String search_sort = "排序";
@override
String search_language = "语言";
@override
String feed_back_tip = "你的反馈将通过 github issue 被提交";
}
2 changes: 2 additions & 0 deletions lib/common/utils/common_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ class CommonUtils {
TextEditingController? titleController,
TextEditingController? valueController,
bool needTitle = true,
String? hintText,
}) {
return NavigatorUtils.showGSYDialog(
context: context,
Expand All @@ -446,6 +447,7 @@ class CommonUtils {
titleController: titleController,
valueController: valueController,
needTitle: needTitle,
hintText: hintText,
),
);
});
Expand Down
52 changes: 28 additions & 24 deletions lib/page/home/widget/home_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class HomeDrawer extends StatelessWidget {
context: context,
builder: (BuildContext context) => AboutDialog(
applicationName: GSYLocalizations.i18n(context)!.app_name,
applicationVersion: "${GSYLocalizations.i18n(context)!.app_version}: ${versionName ?? ""}",
applicationVersion:
"${GSYLocalizations.i18n(context)!.app_version}: ${versionName ?? ""}",
applicationIcon: const Image(
image: AssetImage(GSYICons.DEFAULT_USER_ICON),
width: 50.0,
Expand Down Expand Up @@ -91,9 +92,8 @@ class HomeDrawer extends StatelessWidget {
onTap: () {},
child: CircleAvatar(
//圆形图标控件
backgroundImage: NetworkImage(
user.avatar_url ??
GSYICons.DEFAULT_REMOTE_PIC),
backgroundImage: NetworkImage(user.avatar_url ??
GSYICons.DEFAULT_REMOTE_PIC),
),
),
decoration: BoxDecoration(
Expand All @@ -102,36 +102,42 @@ class HomeDrawer extends StatelessWidget {
),
),
ListTile(
title: Text(
title: Text(
GSYLocalizations.i18n(context)!.home_reply,
style: GSYConstant.normalText,
),
onTap: () {
String content = "";
CommonUtils.showEditDialog(
context,
GSYLocalizations.i18n(context)!.home_reply,
style: GSYConstant.normalText,
),
onTap: () {
String content = "";
CommonUtils.showEditDialog(
context,
GSYLocalizations.i18n(context)!.home_reply,
(title) {}, (res) {
(title) {},
(res) {
content = res;
}, () {
},
() {
if (content.isEmpty) {
return;
}
CommonUtils.showLoadingDialog(context);
IssueDao.createIssueDao(
"CarGuo", "gsy_github_app_flutter", {
"title":
GSYLocalizations.i18n(context)!.home_reply,
"title": GSYLocalizations.i18n(context)!
.home_reply,
"body": content
}).then((result) {
Navigator.pop(context);
Navigator.pop(context);
});
},
titleController: TextEditingController(),
valueController: TextEditingController(),
needTitle: false);
}),
titleController: TextEditingController(),
valueController: TextEditingController(),
needTitle: false,
hintText:
GSYLocalizations.i18n(context)!.feed_back_tip,
);
},
),
ListTile(
title: Text(
GSYLocalizations.i18n(context)!.home_history,
Expand Down Expand Up @@ -176,11 +182,9 @@ class HomeDrawer extends StatelessWidget {
onTap: () {
CommonUtils.showLanguageDialog(context);
}),

ListTile(
title: Text(
GSYLocalizations.i18n(context)!
.home_change_grey,
GSYLocalizations.i18n(context)!.home_change_grey,
style: GSYConstant.normalText,
),
onTap: () {
Expand All @@ -201,7 +205,7 @@ class HomeDrawer extends StatelessWidget {
.home_about,
style: GSYConstant.normalText,
),
onLongPress: (){
onLongPress: () {
NavigatorUtils.goDebugDataPage(context);
},
onTap: () {
Expand Down
29 changes: 20 additions & 9 deletions lib/page/issue/issue_edit_dIalog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,19 @@ class IssueEditDialog extends StatefulWidget {
final TextEditingController? valueController;

final bool needTitle;

const IssueEditDialog(this.dialogTitle, this.onTitleChanged, this.onContentChanged,
this.onPressed,
{super.key, this.titleController, this.valueController, this.needTitle = true});
final String? hintText;

const IssueEditDialog(
this.dialogTitle,
this.onTitleChanged,
this.onContentChanged,
this.onPressed, {
super.key,
this.titleController,
this.valueController,
this.needTitle = true,
this.hintText,
});

@override
_IssueEditDialogState createState() => _IssueEditDialogState();
Expand Down Expand Up @@ -58,8 +67,8 @@ class _IssueEditDialogState extends State<IssueEditDialog> {
itemBuilder: (context, index) {
return RawMaterialButton(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
padding:
const EdgeInsets.only(left: 8.0, right: 8.0, top: 5.0, bottom: 5.0),
padding: const EdgeInsets.only(
left: 8.0, right: 8.0, top: 5.0, bottom: 5.0),
constraints: const BoxConstraints(minWidth: 0.0, minHeight: 0.0),
child: Icon(FAST_INPUT_LIST[index].iconData, size: 16.0),
onPressed: () {
Expand Down Expand Up @@ -144,8 +153,9 @@ class _IssueEditDialogState extends State<IssueEditDialog> {
onChanged: widget.onContentChanged,
controller: widget.valueController,
decoration: InputDecoration(
hintText: GSYLocalizations.i18n(context)!
.issue_edit_issue_title_tip,
hintText: widget.hintText ??
GSYLocalizations.i18n(context)!
.issue_edit_issue_title_tip,
hintStyle: GSYConstant.middleSubText,
isDense: true,
border: InputBorder.none,
Expand Down Expand Up @@ -193,7 +203,8 @@ class _IssueEditDialogState extends State<IssueEditDialog> {
minWidth: 0.0, minHeight: 0.0),
onPressed: widget.onPressed,
child: Text(
GSYLocalizations.i18n(context)!.app_ok,
GSYLocalizations.i18n(context)!
.app_ok,
style: GSYConstant.normalTextBold))),
],
)
Expand Down

0 comments on commit f4fbbd3

Please sign in to comment.