From 8bf9c970d7f9cf45653bd5321838024d2ebb4c3a Mon Sep 17 00:00:00 2001 From: singularity <12184989+singularity-s0@users.noreply.github.com> Date: Fri, 17 May 2024 17:12:32 +0800 Subject: [PATCH] feat: new chat --- lib/views/chat_page.dart | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/views/chat_page.dart b/lib/views/chat_page.dart index 42d614e..53d9951 100644 --- a/lib/views/chat_page.dart +++ b/lib/views/chat_page.dart @@ -400,8 +400,7 @@ class _ChatViewState extends State { children: [ TextButton.icon( icon: const Icon(Icons.refresh, size: 16), - label: Text( - AppLocalizations.of(context)!.regenerate), + label: const Text("重新生成"), onPressed: () async { final lastMessage = _records.last.request; setState(() { @@ -500,7 +499,6 @@ class _ChatViewState extends State { AppLocalizations.of(context)! .copied_to_clipboard))); }), - const Spacer(), IconButton( onPressed: () { String content = ""; @@ -517,6 +515,16 @@ class _ChatViewState extends State { .copied_to_clipboard))); }, icon: const Icon(Icons.copy_all)), + const Spacer(), + TextButton.icon( + icon: const Icon(Icons.add, size: 16), + label: const Text("新对话"), + onPressed: () { + setState(() { + _messages.clear(); + _records.clear(); + }); + }), // IconButton( // onPressed: () async { // try {