Merge pull request #53 from yaso-meth/QOL-Hide-model-selection
QOL-Hide-model-selection
This commit is contained in:
@@ -26,6 +26,7 @@ class AiChat extends StatefulWidget {
|
||||
|
||||
class _AiChatState extends State<AiChat> {
|
||||
TextEditingController _modelCopntroller = TextEditingController();
|
||||
final ValueNotifier<bool> _showModelOptions = ValueNotifier(false);
|
||||
List<types.Message> _messages = [];
|
||||
late types.User _user;
|
||||
late types.User _mihAI;
|
||||
@@ -206,8 +207,22 @@ class _AiChatState extends State<AiChat> {
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
if (_showModelOptions.value == true) {
|
||||
setState(() {
|
||||
_showModelOptions.value = false;
|
||||
});
|
||||
} else {
|
||||
setState(() {
|
||||
_showModelOptions.value = true;
|
||||
});
|
||||
}
|
||||
},
|
||||
icon: const Icon(Icons.settings),
|
||||
),
|
||||
Text(
|
||||
"Chat with AI",
|
||||
"Mzansi AI",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
@@ -224,7 +239,12 @@ class _AiChatState extends State<AiChat> {
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
ValueListenableBuilder(
|
||||
valueListenable: _showModelOptions,
|
||||
builder: (BuildContext context, bool value, Widget? child) {
|
||||
return Visibility(
|
||||
visible: value,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
@@ -242,6 +262,9 @@ class _AiChatState extends State<AiChat> {
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
Expanded(
|
||||
child: Chat(
|
||||
messages: _messages,
|
||||
|
||||
Reference in New Issue
Block a user