temporarily remove schedule and specific reaction
This commit is contained in:
parent
a847389620
commit
c7c0634792
2 changed files with 129 additions and 126 deletions
|
|
@ -3957,6 +3957,6 @@
|
|||
"conversationBotDiscussionZone_discussionKeywordsHintText": "Comma separated list of keywords to guide the discussion",
|
||||
"conversationBotDiscussionZone_discussionTriggerScheduleEnabledLabel": "Send discussion prompt on a schedule",
|
||||
"conversationBotDiscussionZone_discussionTriggerScheduleHourIntervalLabel": "Hours between discussion prompts",
|
||||
"conversationBotDiscussionZone_discussionTriggerReactionEnabledLabel": "Send discussion prompt on reaction to bot's message",
|
||||
"conversationBotDiscussionZone_discussionTriggerReactionEnabledLabel": "Send discussion prompt when user reacts ⏩ to bot message",
|
||||
"conversationBotDiscussionZone_discussionTriggerReactionKeyLabel": "Reaction to send discussion prompt"
|
||||
}
|
||||
|
|
@ -17,11 +17,11 @@ class ConversationBotDiscussionZone extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
String discussionTopic = initialBotOptions.discussionTopic ?? "";
|
||||
String discussionKeywords = initialBotOptions.discussionKeywords ?? "";
|
||||
int discussionTriggerScheduleHourInterval =
|
||||
initialBotOptions.discussionTriggerScheduleHourInterval ?? 24;
|
||||
final String discussionTriggerReactionKey =
|
||||
initialBotOptions.discussionTriggerReactionKey ?? "⏩";
|
||||
final List<String> reactionKeyOptions = ["⏩"];
|
||||
// int discussionTriggerScheduleHourInterval =
|
||||
// initialBotOptions.discussionTriggerScheduleHourInterval ?? 24;
|
||||
// String discussionTriggerReactionKey =
|
||||
// initialBotOptions.discussionTriggerReactionKey ?? "⏩";
|
||||
// List<String> reactionKeyOptions = ["⏩"];
|
||||
return Column(
|
||||
children: [
|
||||
const SizedBox(height: 12),
|
||||
|
|
@ -91,50 +91,50 @@ class ConversationBotDiscussionZone extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
CheckboxListTile(
|
||||
title: Text(
|
||||
L10n.of(context)!
|
||||
.conversationBotDiscussionZone_discussionTriggerScheduleEnabledLabel,
|
||||
),
|
||||
value: initialBotOptions.discussionTriggerScheduleEnabled ?? false,
|
||||
onChanged: (value) {
|
||||
initialBotOptions.discussionTriggerScheduleEnabled = value ?? false;
|
||||
onChanged?.call(initialBotOptions);
|
||||
},
|
||||
),
|
||||
if (initialBotOptions.discussionTriggerScheduleEnabled == true)
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: TextField(
|
||||
keyboardType: TextInputType.number,
|
||||
controller: TextEditingController(
|
||||
text: discussionTriggerScheduleHourInterval.toString(),
|
||||
),
|
||||
onChanged: (value) {
|
||||
discussionTriggerScheduleHourInterval =
|
||||
int.tryParse(value) ?? 0;
|
||||
},
|
||||
decoration: InputDecoration(
|
||||
labelText: L10n.of(context)!
|
||||
.conversationBotDiscussionZone_discussionTriggerScheduleHourIntervalLabel,
|
||||
floatingLabelBehavior: FloatingLabelBehavior.auto,
|
||||
suffixIcon: IconButton(
|
||||
icon: const Icon(Icons.check),
|
||||
onPressed: () {
|
||||
if (discussionTriggerScheduleHourInterval !=
|
||||
initialBotOptions
|
||||
.discussionTriggerScheduleHourInterval) {
|
||||
initialBotOptions.discussionTriggerScheduleHourInterval =
|
||||
discussionTriggerScheduleHourInterval;
|
||||
onChanged?.call(
|
||||
initialBotOptions,
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
// CheckboxListTile(
|
||||
// title: Text(
|
||||
// L10n.of(context)!
|
||||
// .conversationBotDiscussionZone_discussionTriggerScheduleEnabledLabel,
|
||||
// ),
|
||||
// value: initialBotOptions.discussionTriggerScheduleEnabled ?? false,
|
||||
// onChanged: (value) {
|
||||
// initialBotOptions.discussionTriggerScheduleEnabled = value ?? false;
|
||||
// onChanged?.call(initialBotOptions);
|
||||
// },
|
||||
// ),
|
||||
// if (initialBotOptions.discussionTriggerScheduleEnabled == true)
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.all(8),
|
||||
// child: TextField(
|
||||
// keyboardType: TextInputType.number,
|
||||
// controller: TextEditingController(
|
||||
// text: discussionTriggerScheduleHourInterval.toString(),
|
||||
// ),
|
||||
// onChanged: (value) {
|
||||
// discussionTriggerScheduleHourInterval =
|
||||
// int.tryParse(value) ?? 0;
|
||||
// },
|
||||
// decoration: InputDecoration(
|
||||
// labelText: L10n.of(context)!
|
||||
// .conversationBotDiscussionZone_discussionTriggerScheduleHourIntervalLabel,
|
||||
// floatingLabelBehavior: FloatingLabelBehavior.auto,
|
||||
// suffixIcon: IconButton(
|
||||
// icon: const Icon(Icons.check),
|
||||
// onPressed: () {
|
||||
// if (discussionTriggerScheduleHourInterval !=
|
||||
// initialBotOptions
|
||||
// .discussionTriggerScheduleHourInterval) {
|
||||
// initialBotOptions.discussionTriggerScheduleHourInterval =
|
||||
// discussionTriggerScheduleHourInterval;
|
||||
// onChanged?.call(
|
||||
// initialBotOptions,
|
||||
// );
|
||||
// }
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
const SizedBox(height: 12),
|
||||
CheckboxListTile(
|
||||
title: Text(
|
||||
|
|
@ -144,85 +144,88 @@ class ConversationBotDiscussionZone extends StatelessWidget {
|
|||
value: initialBotOptions.discussionTriggerReactionEnabled ?? false,
|
||||
onChanged: (value) {
|
||||
initialBotOptions.discussionTriggerReactionEnabled = value ?? false;
|
||||
initialBotOptions.discussionTriggerReactionKey =
|
||||
"⏩"; // hard code this for now
|
||||
onChanged?.call(initialBotOptions);
|
||||
},
|
||||
),
|
||||
if (initialBotOptions.discussionTriggerReactionEnabled == true)
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
L10n.of(context)!
|
||||
.conversationBotDiscussionZone_discussionTriggerReactionKeyLabel,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
width: 0.5,
|
||||
),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(10)),
|
||||
),
|
||||
child: DropdownButton(
|
||||
// Initial Value
|
||||
hint: Padding(
|
||||
padding: const EdgeInsets.only(left: 15),
|
||||
child: Text(
|
||||
reactionKeyOptions[0],
|
||||
style: const TextStyle().copyWith(
|
||||
color: Theme.of(context).textTheme.bodyLarge!.color,
|
||||
fontSize: 14,
|
||||
),
|
||||
overflow: TextOverflow.clip,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
isExpanded: true,
|
||||
underline: Container(),
|
||||
// Down Arrow Icon
|
||||
icon: const Icon(Icons.keyboard_arrow_down),
|
||||
// Array list of items
|
||||
items: [
|
||||
for (final entry in reactionKeyOptions)
|
||||
DropdownMenuItem(
|
||||
value: entry,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 15),
|
||||
child: Text(
|
||||
entry,
|
||||
style: const TextStyle().copyWith(
|
||||
color: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyLarge!
|
||||
.color,
|
||||
fontSize: 14,
|
||||
),
|
||||
overflow: TextOverflow.clip,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
onChanged: (String? value) {
|
||||
if (value !=
|
||||
initialBotOptions.discussionTriggerReactionKey) {
|
||||
initialBotOptions.discussionTriggerReactionKey = value;
|
||||
onChanged?.call(
|
||||
initialBotOptions,
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
// if (initialBotOptions.discussionTriggerReactionEnabled == true)
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.all(8),
|
||||
// child: Column(
|
||||
// children: [
|
||||
// Text(
|
||||
// L10n.of(context)!
|
||||
// .conversationBotDiscussionZone_discussionTriggerReactionKeyLabel,
|
||||
// style: TextStyle(
|
||||
// color: Theme.of(context).colorScheme.secondary,
|
||||
// fontWeight: FontWeight.bold,
|
||||
// ),
|
||||
// textAlign: TextAlign.left,
|
||||
// ),
|
||||
// Container(
|
||||
// decoration: BoxDecoration(
|
||||
// border: Border.all(
|
||||
// color: Theme.of(context).colorScheme.secondary,
|
||||
// width: 0.5,
|
||||
// ),
|
||||
// borderRadius: const BorderRadius.all(Radius.circular(10)),
|
||||
// ),
|
||||
// child: DropdownButton(
|
||||
// // Initial Value
|
||||
// hint: Padding(
|
||||
// padding: const EdgeInsets.only(left: 15),
|
||||
// child: Text(
|
||||
// reactionKeyOptions[0],
|
||||
// style: const TextStyle().copyWith(
|
||||
// color: Theme.of(context).textTheme.bodyLarge!.color,
|
||||
// fontSize: 14,
|
||||
// ),
|
||||
// overflow: TextOverflow.clip,
|
||||
// textAlign: TextAlign.center,
|
||||
// ),
|
||||
// ),
|
||||
// isExpanded: true,
|
||||
// underline: Container(),
|
||||
// // Down Arrow Icon
|
||||
// icon: const Icon(Icons.keyboard_arrow_down),
|
||||
// // Array list of items
|
||||
// items: [
|
||||
// for (final entry in reactionKeyOptions)
|
||||
// DropdownMenuItem(
|
||||
// value: entry,
|
||||
// child: Padding(
|
||||
// padding: const EdgeInsets.only(left: 15),
|
||||
// child: Text(
|
||||
// entry,
|
||||
// style: const TextStyle().copyWith(
|
||||
// color: Theme.of(context)
|
||||
// .textTheme
|
||||
// .bodyLarge!
|
||||
// .color,
|
||||
// fontSize: 14,
|
||||
// ),
|
||||
// overflow: TextOverflow.clip,
|
||||
// textAlign: TextAlign.center,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// onChanged: (String? value) {
|
||||
// if (value !=
|
||||
// initialBotOptions.discussionTriggerReactionKey) {
|
||||
// initialBotOptions.discussionTriggerReactionKey = value;
|
||||
// onChanged?.call(
|
||||
// initialBotOptions,
|
||||
// );
|
||||
// }
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
const SizedBox(height: 12),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue