forked from krille-chan/fluffychat
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into reorganize-extensions
- Loading branch information
Showing
20 changed files
with
1,496 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
lib/pangea/widgets/conversation_bot/conversation_bot_conversation_zone.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class ConversationBotConversationZone extends StatelessWidget { | ||
const ConversationBotConversationZone({ | ||
super.key, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return const Column( | ||
children: [ | ||
Text('Conversation Zone'), | ||
], | ||
); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
lib/pangea/widgets/conversation_bot/conversation_bot_custom_zone.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class ConversationBotCustomZone extends StatelessWidget { | ||
const ConversationBotCustomZone({ | ||
super.key, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return const Column( | ||
children: [ | ||
Text('Custom Zone'), | ||
], | ||
); | ||
} | ||
} |
71 changes: 71 additions & 0 deletions
71
lib/pangea/widgets/conversation_bot/conversation_bot_discussion_keywords_input.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import 'package:fluffychat/pangea/models/bot_options_model.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_gen/gen_l10n/l10n.dart'; | ||
|
||
class ConversationBotDiscussionKeywordsInput extends StatelessWidget { | ||
final BotOptionsModel initialBotOptions; | ||
// call this to update propagate changes to parents | ||
final void Function(BotOptionsModel) onChanged; | ||
|
||
const ConversationBotDiscussionKeywordsInput({ | ||
super.key, | ||
required this.initialBotOptions, | ||
required this.onChanged, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
String discussionKeywords = initialBotOptions.discussionKeywords ?? ""; | ||
|
||
final TextEditingController textFieldController = | ||
TextEditingController(text: discussionKeywords); | ||
|
||
void setBotDiscussionKeywordsAction() async { | ||
showDialog( | ||
context: context, | ||
useRootNavigator: false, | ||
builder: (BuildContext context) => AlertDialog( | ||
title: Text( | ||
L10n.of(context)! | ||
.conversationBotDiscussionZone_discussionKeywordsLabel, | ||
), | ||
content: TextField( | ||
controller: textFieldController, | ||
onChanged: (value) { | ||
discussionKeywords = value; | ||
}, | ||
), | ||
actions: [ | ||
TextButton( | ||
child: Text(L10n.of(context)!.cancel), | ||
onPressed: () { | ||
Navigator.of(context).pop(); | ||
}, | ||
), | ||
TextButton( | ||
child: Text(L10n.of(context)!.ok), | ||
onPressed: () { | ||
if (discussionKeywords == "") return; | ||
if (discussionKeywords != | ||
initialBotOptions.discussionKeywords) { | ||
initialBotOptions.discussionKeywords = discussionKeywords; | ||
onChanged.call(initialBotOptions); | ||
Navigator.of(context).pop(); | ||
} | ||
}, | ||
), | ||
], | ||
), | ||
); | ||
} | ||
|
||
return ListTile( | ||
onTap: setBotDiscussionKeywordsAction, | ||
title: Text( | ||
initialBotOptions.discussionKeywords ?? | ||
L10n.of(context)! | ||
.conversationBotDiscussionZone_discussionKeywordsPlaceholder, | ||
), | ||
); | ||
} | ||
} |
Oops, something went wrong.