From d0fb44717c3c9fdeff9b848ceebc81ad344ce0a0 Mon Sep 17 00:00:00 2001 From: yaso Date: Thu, 23 Jan 2025 14:31:35 +0200 Subject: [PATCH] remove Mzansi AI Package --- .../lib/mih_packages/mzansi_ai/ai_chat.dart | 75 -------- .../lib/mih_packages/mzansi_ai/mzansi_ai.dart | 174 ------------------ 2 files changed, 249 deletions(-) delete mode 100644 Frontend/lib/mih_packages/mzansi_ai/ai_chat.dart delete mode 100644 Frontend/lib/mih_packages/mzansi_ai/mzansi_ai.dart diff --git a/Frontend/lib/mih_packages/mzansi_ai/ai_chat.dart b/Frontend/lib/mih_packages/mzansi_ai/ai_chat.dart deleted file mode 100644 index 5a81fac8..00000000 --- a/Frontend/lib/mih_packages/mzansi_ai/ai_chat.dart +++ /dev/null @@ -1,75 +0,0 @@ -import 'package:Mzansi_Innovation_Hub/main.dart'; -import 'package:Mzansi_Innovation_Hub/mih_components/mih_inputs_and_buttons/mih_text_input.dart'; -import 'package:flutter/material.dart'; - -class AiChat extends StatefulWidget { - const AiChat({super.key}); - - @override - State createState() => _AiChatState(); -} - -class _AiChatState extends State { - final TextEditingController _chatMessageController = TextEditingController(); - Widget getChatBody(double height) { - return Container( - // height: height, - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - "Mzansi AI Chat", - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 25, - fontWeight: FontWeight.bold, - color: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - ), - ), - ], - ), - Divider( - color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), - ), - const SizedBox(height: 10), - Container( - height: height - 300, - color: Colors.black, - ), - const SizedBox(height: 10), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: SizedBox( - height: 50, - child: MIHTextField( - controller: _chatMessageController, - hintText: "Ask Mzansi AI", - editable: true, - required: true, - ), - ), - ), - IconButton( - onPressed: () { - print("Sent Message"); - }, - icon: Icon(Icons.send), - ), - ], - ), - ], - ), - ); - } - - @override - Widget build(BuildContext context) { - double height = MediaQuery.of(context).size.height; - return getChatBody(height); - } -} diff --git a/Frontend/lib/mih_packages/mzansi_ai/mzansi_ai.dart b/Frontend/lib/mih_packages/mzansi_ai/mzansi_ai.dart deleted file mode 100644 index 265c09a0..00000000 --- a/Frontend/lib/mih_packages/mzansi_ai/mzansi_ai.dart +++ /dev/null @@ -1,174 +0,0 @@ -import 'package:Mzansi_Innovation_Hub/mih_components/mih_layout/mih_action.dart'; -import 'package:Mzansi_Innovation_Hub/mih_components/mih_layout/mih_body.dart'; -import 'package:Mzansi_Innovation_Hub/mih_components/mih_layout/mih_header.dart'; -import 'package:Mzansi_Innovation_Hub/mih_components/mih_layout/mih_layout_builder.dart'; -import 'package:Mzansi_Innovation_Hub/mih_objects/arguments.dart'; -import 'package:Mzansi_Innovation_Hub/mih_packages/mzansi_ai/ai_chat.dart'; -import 'package:flutter/material.dart'; - -class MzansiAi extends StatefulWidget { - const MzansiAi({super.key}); - - @override - State createState() => _MzansiAiState(); -} - -class _MzansiAiState extends State { - int _selectedIndex = 0; - - MIHAction getActionButton() { - return MIHAction( - icon: const Icon(Icons.arrow_back), - iconSize: 35, - onTap: () { - Navigator.of(context).pushNamedAndRemoveUntil( - '/', - arguments: AuthArguments(true, false), - (route) => false, - ); - }, - ); - } - - MIHHeader getHeader() { - return const MIHHeader( - headerAlignment: MainAxisAlignment.center, - headerItems: [ - Text( - "", - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 25, - ), - ), - ], - ); - } - - MIHHeader getSecAction() { - return MIHHeader( - headerAlignment: MainAxisAlignment.end, - headerItems: [ - //============ Patient Details ================ - Visibility( - visible: _selectedIndex != 0, - child: IconButton( - onPressed: () { - setState(() { - _selectedIndex = 0; - }); - }, - icon: const Icon( - Icons.chat_bubble, - size: 35, - ), - ), - ), - Visibility( - visible: _selectedIndex == 0, - child: IconButton.filled( - iconSize: 35, - onPressed: () { - setState(() { - _selectedIndex = 0; - }); - }, - icon: const Icon( - Icons.chat_bubble, - ), - ), - ), - //============ Patient Notes ================ - // Visibility( - // visible: _selectedIndex != 1, - // child: IconButton( - // onPressed: () { - // setState(() { - // _selectedIndex = 1; - // }); - // }, - // icon: const Icon( - // Icons.article_outlined, - // size: 35, - // ), - // ), - // ), - // Visibility( - // visible: _selectedIndex == 1, - // child: IconButton.filled( - // onPressed: () { - // setState(() { - // _selectedIndex = 1; - // }); - // }, - // icon: const Icon( - // Icons.article_outlined, - // size: 35, - // ), - // ), - // ), - // //============ Patient Files ================ - // Visibility( - // visible: _selectedIndex != 2, - // child: IconButton( - // onPressed: () { - // setState(() { - // _selectedIndex = 2; - // }); - // }, - // icon: const Icon( - // Icons.file_present, - // size: 35, - // ), - // ), - // ), - // Visibility( - // visible: _selectedIndex == 2, - // child: IconButton.filled( - // onPressed: () { - // setState(() { - // _selectedIndex = 2; - // }); - // }, - // icon: const Icon( - // Icons.file_present, - // size: 35, - // ), - // ), - // ), - ], - ); - } - - MIHBody getBody() { - return MIHBody( - borderOn: true, - bodyItems: [showSelection(_selectedIndex)], - ); - } - - Widget showSelection(int index) { - if (index == 0) { - return const AiChat(); - } else if (index == 1) { - return const Placeholder(); - } else { - return const Placeholder(); - } - } - - @override - Widget build(BuildContext context) { - return MIHLayoutBuilder( - actionButton: getActionButton(), - secondaryActionButton: getSecAction(), - header: getHeader(), - body: getBody(), - actionDrawer: null, - secondaryActionDrawer: null, - bottomNavBar: null, - pullDownToRefresh: false, - onPullDown: () async {}, - ); - } -}