From b3a0ad1b6e14aa8ea7770d6e089f3cf668c59175 Mon Sep 17 00:00:00 2001 From: ggurdin Date: Tue, 22 Oct 2024 11:09:25 -0400 Subject: [PATCH] added x button to coversation bot settings and make text fields expand to fit contents --- .../conversation_bot_mode_dynamic_zone.dart | 9 +++++++ .../conversation_bot_settings.dart | 25 ++++++++++++------- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/lib/pangea/widgets/conversation_bot/conversation_bot_mode_dynamic_zone.dart b/lib/pangea/widgets/conversation_bot/conversation_bot_mode_dynamic_zone.dart index f001fe8f7..e8f33fe3d 100644 --- a/lib/pangea/widgets/conversation_bot/conversation_bot_mode_dynamic_zone.dart +++ b/lib/pangea/widgets/conversation_bot/conversation_bot_mode_dynamic_zone.dart @@ -35,6 +35,9 @@ class ConversationBotModeDynamicZone extends StatelessWidget { ? L10n.of(context)!.enterDiscussionTopic : null, enabled: enabled, + minLines: 1, // Minimum number of lines + maxLines: null, // Allow the field to expand based on content + keyboardType: TextInputType.multiline, ), const SizedBox(height: 12), TextFormField( @@ -44,6 +47,9 @@ class ConversationBotModeDynamicZone extends StatelessWidget { ), controller: discussionKeywordsController, enabled: enabled, + minLines: 1, // Minimum number of lines + maxLines: null, // Allow the field to expand based on content + keyboardType: TextInputType.multiline, ), ]; @@ -60,6 +66,9 @@ class ConversationBotModeDynamicZone extends StatelessWidget { : null, controller: customSystemPromptController, enabled: enabled, + minLines: 1, // Minimum number of lines + maxLines: null, // Allow the field to expand based on content + keyboardType: TextInputType.multiline, ), ]; diff --git a/lib/pangea/widgets/conversation_bot/conversation_bot_settings.dart b/lib/pangea/widgets/conversation_bot/conversation_bot_settings.dart index 4ff52642f..833ba8924 100644 --- a/lib/pangea/widgets/conversation_bot/conversation_bot_settings.dart +++ b/lib/pangea/widgets/conversation_bot/conversation_bot_settings.dart @@ -169,17 +169,24 @@ class ConversationBotSettingsDialogState child: Column( mainAxisSize: MainAxisSize.min, children: [ - Align( - alignment: Alignment.centerLeft, - child: Padding( - padding: const EdgeInsets.symmetric( - vertical: 12, + Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: const EdgeInsets.symmetric( + vertical: 12, + ), + child: Text( + L10n.of(context)!.botConfig, + style: Theme.of(context).textTheme.titleLarge, + ), ), - child: Text( - L10n.of(context)!.botConfig, - style: Theme.of(context).textTheme.titleLarge, + IconButton( + icon: const Icon(Icons.close), + onPressed: () => Navigator.of(context).pop(null), ), - ), + ], ), SwitchListTile( title: Text(