From 96438313a1aa7f2c6749deb08bdee2f21a1c7f33 Mon Sep 17 00:00:00 2001 From: lollipopkit Date: Mon, 29 May 2023 17:37:24 +0800 Subject: [PATCH] update `ISSUE_TEMPLATE` --- .github/ISSUE_TEMPLATE/bug_report.md | 30 +++++++++++++++++++----- .github/ISSUE_TEMPLATE/bug_report_cn.md | 31 +++++++++++++++++++------ lib/view/page/editor.dart | 3 ++- lib/view/page/setting.dart | 28 +++++++++++++--------- 4 files changed, 67 insertions(+), 25 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index f4c51267..941f1cee 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -7,29 +7,47 @@ assignees: '' --- + + + **Describe the bug** -A clear and concise description of what the bug is. + + **To Reproduce** + + **Desired Results** -A clear description of the result you expected. + + **Actual Results** -A clear description of the actual result. + + **Screenshots** -If applicable, add screenshots(both bug screen and logs -screen) to help explain your problem. + + **Device** + + **Additional context** -Add any other context about the problem here. + + diff --git a/.github/ISSUE_TEMPLATE/bug_report_cn.md b/.github/ISSUE_TEMPLATE/bug_report_cn.md index 15faf4bd..5207325f 100644 --- a/.github/ISSUE_TEMPLATE/bug_report_cn.md +++ b/.github/ISSUE_TEMPLATE/bug_report_cn.md @@ -7,28 +7,45 @@ assignees: '' --- + + **描述BUG** -一个关于BUG的清晰描述。 + + **复现步骤** + + **期望结果** -一个关于你期望的结果的清晰描述。 + + **实际结果** -一个关于实际结果的清晰描述。 + + **截图** -如果可以,请添加截图(包括错误界面和日志界面)来帮助解释你的问题。 + + **设备** - - 系统: e.g. iOS16 or Android13 - - App版本: e.g. 1.0.302 + + **更多信息** -在这里添加关于这个问题的更多信息。 + + diff --git a/lib/view/page/editor.dart b/lib/view/page/editor.dart index bc4ca1b1..4b8cf527 100644 --- a/lib/view/page/editor.dart +++ b/lib/view/page/editor.dart @@ -68,10 +68,11 @@ class _EditorPageState extends State { centerTitle: true, title: TwoLineText(up: getFileName(widget.path) ?? '', down: _s.editor), actions: [ - PopupMenuButton( + PopupMenuButton( icon: const Icon(Icons.language), onSelected: (value) { _controller.language = suffix2HighlightMap[value]; + _langCode = value; }, initialValue: _langCode, itemBuilder: (BuildContext context) { diff --git a/lib/view/page/setting.dart b/lib/view/page/setting.dart index 5cbb2d40..4e35355c 100644 --- a/lib/view/page/setting.dart +++ b/lib/view/page/setting.dart @@ -559,25 +559,31 @@ class _SettingPageState extends State { title: Text(_s.diskIgnorePath), trailing: Text(_s.edit, style: textSize15), onTap: () { + final ctrller = TextEditingController(text: json.encode(paths)); + void onSubmit() { + try { + final list = List.from(json.decode(ctrller.text)); + _setting.diskIgnorePath.put(list); + context.pop(); + showSnackBar(context, Text(_s.success)); + } catch (e) { + showSnackBar(context, Text(e.toString())); + } + } + showRoundDialog( context: context, title: Text(_s.diskIgnorePath), child: Input( - controller: TextEditingController(text: json.encode(paths)), + controller: ctrller, label: 'JSON', type: TextInputType.visiblePassword, maxLines: 3, - onSubmitted: (p0) { - try { - final list = List.from(json.decode(p0)); - _setting.diskIgnorePath.put(list); - context.pop(); - showSnackBar(context, Text(_s.success)); - } catch (e) { - showSnackBar(context, Text(e.toString())); - } - }, + onSubmitted: (_) => onSubmit(), ), + actions: [ + TextButton(onPressed: onSubmit, child: Text(_s.ok)), + ], ); }, );